Physics: quantities\comm

\commCommand

Used to typeset operator commutators such as [A,B] in quantum mechanics and algebra.

\comm{A}{B}
Available in
physics
Kind
prefix
Allowed mode
math
Frequency
Not measured
Commonality
low
Renderer support
PackageMathJaxKaTeXXeTeX
physicsMathJax: FullKaTeX: NoneXeTeX: Full
About the test scope

Syntax#

\comms*starm{}{a}math contentm{b}math content

Argspec s m{} m — one optional and two mandatory arguments. Reading argspecs

Examples#

\comm*{A}B

In TeXForm#

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

Expands to#

\comm{#1}#2 \left[#1,#2\right]

If a neighboring \big, \bigg, \Big, or \Bigg follows the command, that size command is used instead of \left...\right; if starred, the result is fixed [#1,#2] and any such size modifier is consumed but ignored in the final rewrite.

physics/commutator-expandfrom Faithfulrender

Expand commutators to explicit square-bracket fences.

\comm{#1}{#2} \left[#1,#2\right]

Equivalent forms#

  • \commutator{#1}#2exact
  • \left[#1,#2\right]exact

    Matches the unstarred form when no intervening \big/\bigg/\Big/\Bigg size modifier is used.

See also#

Test cases#

physics
InputCaseMathJaxKaTeXXeTeX
\comm{a}{b}Positive · baselinePassFailPass
\comm*{a}{b}Positive · vary:s[0]PassFailPass
\comm{a}bPositive · bare[2]PassFailPass
All 28 in Physics: quantities