# physics/antidiagonalmatrix-to-admat

Collapse antidiagonalmatrix to the shorter admat helper.

https://texform.dev/rules/physics/antidiagonalmatrix-to-admat

## Metadata

| Field | Value |
| --- | --- |
| Key | physics/antidiagonalmatrix-to-admat |
| Level | authoring |
| Fidelity | render |
| Enabled by packages | physics |
| Profiles | Authoring, Faithful, Corpus, Equiv |

## Rewrite patterns

### antidiagonalmatrix-braced

From:

```latex
\antidiagonalmatrix{#1}
```

To:

```latex
\admat{#1}
```

### antidiagonalmatrix-bare

From:

```latex
\antidiagonalmatrix
```

To:

```latex
\admat
```

## Examples

Examples show the rule in isolation, not a complete normalization profile.

### admat sign flip

Before:

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

After this rule:

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

Packages: base, physics.

Rendering verified with the declared packages.

### admat bare no elements

Before:

```latex
J_0=\mqty(\antidiagonalmatrix)
```

After this rule:

```latex
J_0=\mqty(\admat)
```

Packages: base, physics.

Rendering verified with the declared packages.

## Triggers

- [\\antidiagonalmatrix](https://texform.dev/latex/commands/antidiagonalmatrix)

## Eliminates

- [\\antidiagonalmatrix](https://texform.dev/latex/commands/antidiagonalmatrix)

## Produces

- [\\admat](https://texform.dev/latex/commands/admat)

## Same family

- [ams/Bmatrix-env-to-brace-matrix](https://texform.dev/rules/ams/Bmatrix-env-to-brace-matrix): Rewrite the fenced Bmatrix environment to explicit braces around a core matrix environment.
- [ams/Vmatrix-env-to-Vert-matrix](https://texform.dev/rules/ams/Vmatrix-env-to-Vert-matrix): Rewrite the fenced Vmatrix environment to explicit double bars around a core matrix environment.
- [ams/bmatrix-env-to-bracket-matrix](https://texform.dev/rules/ams/bmatrix-env-to-bracket-matrix): Rewrite the fenced bmatrix environment to explicit brackets around a core matrix environment.
- [ams/pmatrix-env-to-paren-matrix](https://texform.dev/rules/ams/pmatrix-env-to-paren-matrix): Rewrite the fenced pmatrix environment to explicit parens around a core matrix environment.
- [ams/vmatrix-env-to-vert-matrix](https://texform.dev/rules/ams/vmatrix-env-to-vert-matrix): Rewrite the fenced vmatrix environment to explicit vertical bars around a core matrix environment.
- [base/cases-to-cases-env](https://texform.dev/rules/base/cases-to-cases-env): Rewrite plain-TeX cases to the standard cases environment with row breaks.
- [base/eqalign-to-aligned-env](https://texform.dev/rules/base/eqalign-to-aligned-env): Rewrite eqalign to the standard aligned environment.
- [base/eqalignno-to-align-env](https://texform.dev/rules/base/eqalignno-to-align-env): Rewrite eqalignno to the standard align* environment.
- [base/matrix-to-matrix-env](https://texform.dev/rules/base/matrix-to-matrix-env): Rewrite plain-TeX matrix to the standard matrix environment with row breaks.
- [base/pmatrix-to-pmatrix-env](https://texform.dev/rules/base/pmatrix-to-pmatrix-env): Rewrite plain-TeX pmatrix to the standard pmatrix environment with row breaks.
- [physics/diagonalmatrix-to-dmat](https://texform.dev/rules/physics/diagonalmatrix-to-dmat): Collapse diagonalmatrix to the shorter dmat helper.
- [physics/matrixdeterminant-to-mdet](https://texform.dev/rules/physics/matrixdeterminant-to-mdet): Collapse matrixdeterminant to the shorter mdet determinant helper.
- [physics/bmqty-to-mqty](https://texform.dev/rules/physics/bmqty-to-mqty): Expand bmqty to the core mqty builder with bracket fence syntax.
- [physics/mdet-to-vmqty](https://texform.dev/rules/physics/mdet-to-vmqty): Expand mdet to the vmqty determinant-style builder.
- [physics/pmqty-to-mqty](https://texform.dev/rules/physics/pmqty-to-mqty): Expand pmqty to the core mqty builder with paren fence syntax.
- [physics/zmat-to-xmat](https://texform.dev/rules/physics/zmat-to-xmat): Expand zmat to the explicit xmat zero-filled builder.

## 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

```python
TransformEngine(profile="corpus", disable_rules=["physics/antidiagonalmatrix-to-admat"])
```

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

[Open in Playground](https://play.texform.dev/?input=J%3D%5Cmqty%28%5Cantidiagonalmatrix%7B1%2C-1%7D%29)
