# \paulimatrix

Used in quantum mechanics and quantum computing to generate 2×2 Pauli matrices (σ_0, σ_x, σ_y, σ_z) within matrix environments

https://texform.dev/latex/commands/paulimatrix

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Physics: matrices](https://texform.dev/latex/topics/physics-matrices) |
| Packages | physics |
| Allowed mode | math |
| Tags |  |
| Commonality | low |
| Kind | prefix |

## Syntax

### physics

Argument specification: `m`

Used in quantum mechanics and quantum computing to generate 2×2 Pauli matrices (σ_0, σ_x, σ_y, σ_z) within matrix environments

## Examples

```latex
\paulimatrix{0}
```

[Open in Playground](https://play.texform.dev/?input=%5Cpaulimatrix%7B0%7D)

```latex
\paulimatrix{1}
```

[Open in Playground](https://play.texform.dev/?input=%5Cpaulimatrix%7B1%7D)

```latex
\paulimatrix{x}
```

[Open in Playground](https://play.texform.dev/?input=%5Cpaulimatrix%7Bx%7D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| physics | full | none | full |

## In TeXForm

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

### Expands to (physics)

```latex
\paulimatrix{0}
```

→

```latex
0 1 & 0\\ 0 & 1
```

Rewrites parser string with Pauli matrix content based on first character: 0→identity, 1/x→σ_x, 2/y→σ_y, 3/z→σ_z. Rest of argument is prepended to matrix.

## Equivalent forms

```latex
\pmat{0}
```

exact. Alias for \paulimatrix

## See also

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

## Test cases

### physics

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \paulimatrix{a} | Positive: baseline | Pass | Fail | Pass |
| \paulimatrix a | Positive: bare[0] | Pass | Fail | Pass |
