| Package | MathJax | KaTeX | XeTeX |
|---|---|---|---|
physics | MathJax: Full | KaTeX: None | XeTeX: Full |
Syntax#
\ops*starm{a}math contentg{b}optional math contentArgspec s m g — two optional and one mandatory argument. Reading argspecs
Examples#
In TeXForm#
TeXForm parses this entry as prefix syntax; the package determines its argument specification.
Expands to#
\op{#1}{#2} \left\vert{#1}\middle\rangle\!\middle\langle{#2}\right\vertThis is the unstarred two-argument branch. If the second argument is omitted, MathJax reuses #1 in its place; the starred form instead reparses \vert{#1}\rangle\!\langle{#2}\vert without \left/\middle/\right sizing.
Equivalent forms#
\outerproduct{#1}{#2}exactSame MathJax parser behavior, including the optional star and the omitted-second-argument default to the first argument.
\dyad{#1}{#2}exactSame MathJax parser behavior, including the optional star and the omitted-second-argument default to the first argument.
\ketbra{#1}{#2}exactSame MathJax parser behavior, including the optional star and the omitted-second-argument default to the first argument.
See also#
\dyadphysics\ketbrabraket\outerproductphysics
Test cases#
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\op{a} | Positive · baseline | Pass | Fail | Pass |
\op*{a} | Positive · vary:s[0] | Pass | Fail | Pass |
\op{a}{b} | Positive · vary:g[2] | Pass | Fail | Pass |
\op*{a}{b} | Positive · maximal | Pass | Fail | Pass |
\op a | Positive · bare[1] | Pass | Fail | Pass |