Rewrite Rulesphysics/antidiagonalmatrix-to-admat

physics/antidiagonalmatrix-to-admat

Collapse antidiagonalmatrix to the shorter admat helper.

Rewrite patterns#

  1. antidiagonalmatrix-braced\antidiagonalmatrix{#1}\admat{#1}
  2. antidiagonalmatrix-bare\antidiagonalmatrix\admat

Examples#

Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.

admat sign flip#

Before

J=\mqty(\antidiagonalmatrix{1,-1})

After this rule

J=\mqty(\admat{1,-1})

Rendering verified with the declared packages.

admat bare no elements#

Before

J_0=\mqty(\antidiagonalmatrix)

After this rule

J_0=\mqty(\admat)

Rendering verified with the declared packages.

Same family#

Notes#

Alias rewrite: antidiagonalmatrix and admat share the same physics DiagonalMatrix handler with the anti-diagonal flag, so the braced and bare forms are preserved by renaming the command.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["physics/antidiagonalmatrix-to-admat"])
new TransformEngine({ profile: 'corpus', disableRules: ['physics/antidiagonalmatrix-to-admat'] })

Open in Playground