Rewrite patterns#
- expectation-body-auto-sized
\ev{#1}\left\langle #1 \right\rangle - expectation-body-fixed-size
\ev*{#1}\langle #1 \rangle - expectation-state-auto-sized
\ev{#1}{#2}\left\langle #2 \right\vert #1 \left\vert #2 \right\rangle - expectation-state-fixed-size
\ev*{#1}{#2}\langle #2 \vert #1 \vert #2 \rangle - expectation-state-middle-sized
\ev**{#1}{#2}\left\langle #2 \middle\vert #1 \middle\vert #2 \right\rangle
Examples#
Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.
Expectation state label#
Rendering verified with the declared packages.
Expectation state argument#
Rendering verified with the declared packages.
Expectation star body fixed size#
Rendering verified with the declared packages.
Expectation star state fixed size#
Rendering verified with the declared packages.
Expectation double star state middle sized#
Rendering verified with the declared packages.
Related rules#
Same family#
physics/matrixel-expandExpand matrix elements to explicit angle-bracket and bar fences.physics/physics-bra-expandExpand bra to an explicit angle-bracket and bar fence form.physics/physics-braket-expandExpand braket to an explicit angle-bracket form with a middle bar.physics/physics-ket-expandExpand ket to an explicit bar and angle-bracket fence form.physics/commutator-expandExpand commutators to explicit square-bracket fences.physics/poisson-bracket-expandExpand poisson brackets to explicit brace fences.
Notes#
Covers body-only and braced-state branches. The second star only changes the braced-state branch; body-only double-star input renders like the single-star body branch.
Disable this rule#
TransformEngine(profile="corpus", disable_rules=["physics/expectation-expand"])new TransformEngine({ profile: 'corpus', disableRules: ['physics/expectation-expand'] })