summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/phfqit
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-10-11 20:24:49 +0000
committerKarl Berry <karl@freefriends.org>2021-10-11 20:24:49 +0000
commit84b9715766a8fdd110bad3f57d0ec53b502a404b (patch)
treea0d27e8b2fe104a77887b16f9acc83da7f76e4f4 /Master/texmf-dist/tex/latex/phfqit
parente5ce0cde7b90ac10f3f1e87757282a7086e2645f (diff)
phfqit (11oct21)
git-svn-id: svn://tug.org/texlive/trunk@60734 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/phfqit')
-rw-r--r--Master/texmf-dist/tex/latex/phfqit/phfqit.sty192
1 files changed, 148 insertions, 44 deletions
diff --git a/Master/texmf-dist/tex/latex/phfqit/phfqit.sty b/Master/texmf-dist/tex/latex/phfqit/phfqit.sty
index 23b8a5b1778..e7e3735e91f 100644
--- a/Master/texmf-dist/tex/latex/phfqit/phfqit.sty
+++ b/Master/texmf-dist/tex/latex/phfqit/phfqit.sty
@@ -22,10 +22,11 @@
%%
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{phfqit}
- [2017/08/16 v2.0 phfqit package]
+ [2021/10/08 v4.1 phfqit package]
\RequirePackage{calc}
\RequirePackage{etoolbox}
\RequirePackage{amsmath}
+\RequirePackage{amssymb}
\RequirePackage{dsfont}
\RequirePackage{mathrsfs}
\RequirePackage{mathtools}
@@ -58,7 +59,13 @@
\operatorname{id}_{#1\notblank{#2}{\to #2}{}}%
\notblank{#3}{\expandafter\phfqitParens\phfqit@val@sizearg{#3}}{}%
}
-\def\ee^#1{e^{#1}} % we could imagine that in inlines, we replace this by exp()...
+\edef\phfqit@def@hat{\detokenize{^}}
+\expandafter\def\expandafter\phfqit@ee@gobblehat\phfqit@def@hat{%
+ \phfqitExpPowerExpression}
+\def\phfqitExpPowerExpression#1{e^{#1}}
+\def\ee#1{\expandafter\phfqit@ee@gobblehat\detokenize{#1}}
+\robustify\phfqitExpPowerExpression
+\robustify\ee
\DeclareMathOperator{\tr}{tr}
\DeclareMathOperator{\supp}{supp}
\DeclareMathOperator{\rank}{rank}
@@ -96,45 +103,19 @@
\newcommand{\CNOT}{\gate{C-Not}}
\newcommand{\NOT}{\gate{Not}}
\newcommand{\NOOP}{\gate{No-Op}}
-\def\uu(#1){\phfqit@fmtLieAlgebra{u}(#1)}
-\def\UU(#1){\phfqit@fmtGroup{U}(#1)}
-\def\su(#1){\phfqit@fmtLieAlgebra{su}(#1)}
-\def\SU(#1){\phfqit@fmtGroup{SU}(#1)}
-\def\so(#1){\phfqit@fmtLieAlgebra{so}(#1)}
-\def\SO(#1){\phfqit@fmtGroup{SO}(#1)}
-\def\SN(#1){\mathrm{S}_{#1}}
-\def\phfqit@fmtLieAlgebra#1{\mathrm{#1}}
-\def\phfqit@fmtGroup#1{\mathrm{#1}}
-\DeclarePairedDelimiterX\ket[1]{\lvert}{\rangle}{{#1}}
-\DeclarePairedDelimiterX\bra[1]{\langle}{\rvert}{{#1}}
-\DeclarePairedDelimiterX\braket[2]{\langle}{\rangle}{%
- {#1}\hspace*{0.2ex}\delimsize\vert\hspace*{0.2ex}{#2}%
-}
-\DeclarePairedDelimiterX\ketbra[2]{\lvert}{\rvert}{%
- {#1}\delimsize\rangle\hspace*{-0.25ex}\delimsize\langle{#2}%
-}
-\DeclarePairedDelimiterX\proj[1]{\lvert}{\rvert}{%
- {#1}\delimsize\rangle\hspace*{-0.25ex}\delimsize\langle{#1}%
-}
-\DeclarePairedDelimiterX\matrixel[3]{\langle}{\rangle}{%
- {#1}\hspace*{0.2ex}\delimsize\vert\hspace*{0.2ex}{#2}%
- \hspace*{0.2ex}\delimsize\vert\hspace*{0.2ex}{#3}%
-}
-\DeclarePairedDelimiterX\dmatrixel[2]{\langle}{\rangle}{%
- {#1}\hspace*{0.2ex}\delimsize\vert\hspace*{0.2ex}{#2}%
- \hspace*{0.2ex}\delimsize\vert\hspace*{0.2ex}{#1}%
-}
-\DeclarePairedDelimiterX\innerprod[2]{\langle}{\rangle}{%
- {#1},\hspace*{0.2ex}{#2}%
-}
-\DeclarePairedDelimiterX\abs[1]{\lvert}{\rvert}{{#1}}
-\DeclarePairedDelimiterX\avg[1]{\langle}{\rangle}{{#1}}
-\DeclarePairedDelimiterX\norm[1]{\lVert}{\rVert}{{#1}}
-\def\phfqit@insideinterval#1#2{{#1\mathclose{},\mathopen{}#2}}
-\DeclarePairedDelimiterX\intervalc[2]{[}{]}{\phfqit@insideinterval{#1}{#2}}
-\DeclarePairedDelimiterX\intervalo[2]{]}{[}{\phfqit@insideinterval{#1}{#2}}
-\DeclarePairedDelimiterX\intervalco[2]{[}{[}{\phfqit@insideinterval{#1}{#2}}
-\DeclarePairedDelimiterX\intervaloc[2]{]}{]}{\phfqit@insideinterval{#1}{#2}}
+\def\uu(#1){\phfqitLieAlgebra{u}{#1}}
+\def\UU(#1){\phfqitLieGroup{U}{#1}}
+\def\su(#1){\phfqitLieAlgebra{su}{#1}}
+\def\SU(#1){\phfqitLieGroup{SU}{#1}}
+\def\so(#1){\phfqitLieAlgebra{so}{#1}}
+\def\SO(#1){\phfqitLieGroup{SO}{#1}}
+\def\slalg(#1){\phfqitLieAlgebra{sl}{#1}} % \sl is "slanted font" in TeX
+\def\SL(#1){\phfqitLieGroup{SL}{#1}}
+\def\GL(#1){\phfqitLieGroup{GL}{#1}}
+\def\SN(#1){\phfqitDiscreteGroup{S}{#1}}
+\newcommand\phfqitLieAlgebra[2]{\mathfrak{#1}({#2})}
+\newcommand\phfqitLieGroup[2]{\mathrm{#1}({#2})}
+\newcommand\phfqitDiscreteGroup[2]{\mathrm{#1}_{#2}}
\def\phfqit@parsesizearg#1{%
\begingroup%
\mathcode`\`="0060\relax%
@@ -155,6 +136,89 @@
\expandafter\phfqit@tmp@cont%
\fi%
}
+\def\phfqitDeclarePairedDelimiterXWithAltSizing{%
+ \phfqitDeclareMathtoolsPairedDelimiterCmdWithAltSizing\DeclarePairedDelimiterX
+}
+\def\phfqitDeclarePairedDelimiterXPPWithAltSizing{%
+ \phfqitDeclareMathtoolsPairedDelimiterCmdWithAltSizing\DeclarePairedDelimiterXPP
+}
+\def\phfqitDeclareMathtoolsPairedDelimiterCmdWithAltSizing#1#2{%
+ \begingroup
+ \escapechar=-1\relax
+ \xdef\phfqit@tmp@thecmd{%
+ \expandafter\noexpand\csname phfqit@paireddelim@def@\string#2\endcsname}%
+ \endgroup
+ \edef\x{%
+ \noexpand\phfqit@paireddelim@parsesizearg{\expandonce\phfqit@tmp@thecmd}%
+ }%
+ \expandafter\DeclareRobustCommand\expandafter#2\expandafter{\x}%
+ \expandafter#1\phfqit@tmp@thecmd
+}
+\def\phfqit@paireddelim@parsesizearg#1{%
+ \phfqit@parsesizearg{\expandafter#1\phfqit@val@sizearg}%
+}
+\def\phfqitKetsBarSpace{\mkern 1.5mu\relax}
+\def\phfqitKetsRLAngleSpace{\mkern -1.8mu\relax}
+\phfqitDeclarePairedDelimiterXWithAltSizing\ket[1]{\lvert}{\rangle}{{#1}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\bra[1]{\langle}{\rvert}{{#1}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\braket[2]{\langle}{\rangle}{%
+ {#1}\phfqitKetsBarSpace\delimsize\vert\phfqitKetsBarSpace{#2}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\ketbra[2]{\lvert}{\rvert}{%
+ {#1}\delimsize\rangle\phfqitKetsRLAngleSpace\delimsize\langle{#2}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\proj[1]{\lvert}{\rvert}{%
+ {#1}\delimsize\rangle\phfqitKetsRLAngleSpace\delimsize\langle{#1}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\matrixel[3]{\langle}{\rangle}{%
+ {#1}\phfqitKetsBarSpace\delimsize\vert\phfqitKetsBarSpace{#2}%
+ \phfqitKetsBarSpace\delimsize\vert\phfqitKetsBarSpace{#3}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\dmatrixel[2]{\langle}{\rangle}{%
+ {#1}\phfqitKetsBarSpace\delimsize\vert\phfqitKetsBarSpace{#2}%
+ \phfqitKetsBarSpace\delimsize\vert\phfqitKetsBarSpace{#1}%
+}
+\def\phfqitKetsBeforeCommaSpace{}
+\def\phfqitKetsAfterCommaSpace{\mkern 1.5mu\relax}
+\phfqitDeclarePairedDelimiterXWithAltSizing\innerprod[2]{\langle}{\rangle}{%
+ {#1}\phfqitKetsBeforeCommaSpace,\phfqitKetsAfterCommaSpace{#2}%
+}
+\def\phfqitOKetsBarSpace{\phfqitKetsBarSpace}
+\def\phfqitOKetsRLAngleSpace{\phfqitKetsRLAngleSpace}
+\phfqitDeclarePairedDelimiterXWithAltSizing\oket[1]{\lvert}{\rrangle}{{#1}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\obra[1]{\llangle}{\rvert}{{#1}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\obraket[2]{\llangle}{\rrangle}{%
+ {#1}\phfqitOKetsBarSpace\delimsize\vert\phfqitOKetsBarSpace{#2}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\oketbra[2]{\lvert}{\rvert}{%
+ {#1}\delimsize\rrangle\phfqitOKetsRLAngleSpace\delimsize\llangle{#2}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\oproj[1]{\lvert}{\rvert}{%
+ {#1}\delimsize\rrangle\phfqitOKetsRLAngleSpace\delimsize\llangle{#1}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\omatrixel[3]{\llangle}{\rrangle}{%
+ {#1}\phfqitOKetsBarSpace\delimsize\vert\phfqitOKetsBarSpace{#2}%
+ \phfqitOKetsBarSpace\delimsize\vert\phfqitOKetsBarSpace{#3}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\odmatrixel[2]{\llangle}{\rrangle}{%
+ {#1}\phfqitOKetsBarSpace\delimsize\vert\phfqitOKetsBarSpace{#2}%
+ \phfqitOKetsBarSpace\delimsize\vert\phfqitOKetsBarSpace{#1}%
+}
+\phfqitDeclarePairedDelimiterXWithAltSizing\abs[1]{\lvert}{\rvert}{{#1}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\avg[1]{\langle}{\rangle}{{#1}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\norm[1]{\lVert}{\rVert}{{#1}}
+\def\phfqitDefineNorm#1#2#3{%
+ \phfqitDeclarePairedDelimiterXPPWithAltSizing#1[1]{#2}{\lVert}{\rVert}{#3}{{##1}}%
+}
+\def\phfqit@insideinterval#1#2{{#1\mathclose{},\mathopen{}#2}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\intervalc[2]{[}{]}{%
+ \phfqit@insideinterval{#1}{#2}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\intervalo[2]{]}{[}{%
+ \phfqit@insideinterval{#1}{#2}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\intervalco[2]{[}{[}{%
+ \phfqit@insideinterval{#1}{#2}}
+\phfqitDeclarePairedDelimiterXWithAltSizing\intervaloc[2]{]}{]}{%
+ \phfqit@insideinterval{#1}{#2}}
\DeclarePairedDelimiterX\phfqitParens[1]{(}{)}{#1}
\DeclarePairedDelimiterX\phfqitSquareBrackets[1]{[}{]}{#1}
\DeclarePairedDelimiterX\phfqitCurlyBrackets[1]{\{}{\}}{#1}
@@ -366,10 +430,19 @@
\DCohbase@tmp@toks=\expandafter{\the\DCohbase@tmp@toks#1}}%
\def\DCohbaseRenderContents#1#2#3#4{%
\DCohbase@tmp@toks={#2}%
- \notblank{#3#4}{%
+ \notblank{#3}{%
\DCohbase@addtoks\mathclose{}\,\delimsize\Vert\,\mathopen{}%
- #3\mathclose{},\mathopen{}#4\@DCohbase@END@ADD@TOKS%
- }{}%
+ #3\@DCohbase@END@ADD@TOKS%
+ \notblank{#4}{%
+ \DCohbase@addtoks\mathclose{},\mathopen{}%
+ #4\@DCohbase@END@ADD@TOKS%
+ }{}%
+ }{%
+ \notblank{#4}{%
+ \PackageWarning{phfqit}{Value `#4' ignored because previous parameter
+ was blank}%
+ }{}%
+ }
\edef\tmp@args{\unexpanded{#1}{\the\DCohbase@tmp@toks}}%
\expandafter\DCohbaseRenderContentsInnerParens\tmp@args%
}
@@ -390,12 +463,42 @@
prefix=phfqit@opt@
}
\DeclareStringOption[stdset]{qitobjdef}
+\DeclareBoolOption[true]{llanglefrommnsymbolfonts}
\DeclareBoolOption[true]{newReIm}
\ProcessKeyvalOptions*
\ifphfqit@opt@newReIm
\renewcommand{\Re}{\phfqit@Realpart}
\renewcommand{\Im}{\phfqit@Imagpart}
\fi
+\ifphfqit@opt@llanglefrommnsymbolfonts
+ \DeclareFontFamily{OMX}{MnSymbolE}{}
+ \DeclareSymbolFont{phfqit@MnLargeSymbols}{OMX}{MnSymbolE}{m}{n}
+ \SetSymbolFont{phfqit@MnLargeSymbols}{bold}{OMX}{MnSymbolE}{b}{n}
+ \DeclareFontShape{OMX}{MnSymbolE}{m}{n}{
+ <-6> MnSymbolE5
+ <6-7> MnSymbolE6
+ <7-8> MnSymbolE7
+ <8-9> MnSymbolE8
+ <9-10> MnSymbolE9
+ <10-12> MnSymbolE10
+ <12-> MnSymbolE12
+ }{}
+ \DeclareFontShape{OMX}{MnSymbolE}{b}{n}{
+ <-6> MnSymbolE-Bold5
+ <6-7> MnSymbolE-Bold6
+ <7-8> MnSymbolE-Bold7
+ <8-9> MnSymbolE-Bold8
+ <9-10> MnSymbolE-Bold9
+ <10-12> MnSymbolE-Bold10
+ <12-> MnSymbolE-Bold12
+ }{}
+ \let\llangle\@undefined
+ \let\rrangle\@undefined
+ \DeclareMathDelimiter{\llangle}{\mathopen}%
+ {phfqit@MnLargeSymbols}{'164}{phfqit@MnLargeSymbols}{'164}
+ \DeclareMathDelimiter{\rrangle}{\mathclose}%
+ {phfqit@MnLargeSymbols}{'171}{phfqit@MnLargeSymbols}{'171}
+\fi
\def\phfqit@tmp@str@none{none}
\def\phfqit@tmp@str@stdset{stdset}
\ifx\phfqit@opt@qitobjdef\phfqit@tmp@str@none%
@@ -412,6 +515,7 @@
\newcommand\Dmax[1][]{\Dbase{\DSym}_{\mathrm{max}}^{#1}}
\newcommand\Dr[1][]{\Dbase{\DSym}_{\mathrm{r}}^{#1}}
\newcommand\DHyp[1][\eta]{\Dbase{\DSym}_{\mathrm{H}}^{#1}}
+\newcommand\Dhyp[1][\eta]{\Dbase{\DSym}_{\mathrm{h}}^{#1}}
\DefineTunedQitObject{DCoh}{\DCohbaseParse}{\DCohbaseRender}{{\DCSym}}{}
\DefineTunedQitObject{DCohx}{\DCohbaseParse}{\DCohbaseRender}%
{{\DCSym}}{%