Macaulay2 » Documentation
Packages » Macaulay2Doc » matrices » determinants and minors » pfaffian
next | previous | forward | backward | up | index | toc

# pfaffian -- Pfaffian of a skew-symmetric matrix

- Usage:
    `pfaffian M`
- Inputs:
  - M, a matrix, must be skew-symmetric;
- Outputs:
  - a number or a ring element, the Pfaffian of M;

## Description

The Pfaffian of a $2n\times 2n$ skew-symmetric matrix $M=(m_{ij})$ is $$\frac{1}{2^nn!}\sum_{\sigma\in S_{2n}}\operatorname{sgn}(\sigma)\prod_{i=1}^nm_{\sigma(2i-1),\sigma(2i)},$$ where $S_n$ is the symmetric group on $2n$ elements.

    i1 : M = matrix {{0, 1, 2, 3}, {-1, 0, 4, 5}, {-2, -4, 0, 6}, {-3, -5, -6, 0}}

    o1 = | 0  1  2  3 |
         | -1 0  4  5 |
         | -2 -4 0  6 |
         | -3 -5 -6 0 |

                  4       4
    o1 : Matrix ZZ  <-- ZZ

    i2 : pfaffian M

    o2 = 8

The square of the Pfaffian is the determinant.

    i3 : determinant M

    o3 = 64

Skew-symmetric matrices with an odd number of rows and columns have Pfaffian zero.

    i4 : M = matrix {{0, 1, 2}, {-1, 0, 3}, {-2, -3, 0}}

    o4 = | 0  1  2 |
         | -1 0  3 |
         | -2 -3 0 |

                  3       3
    o4 : Matrix ZZ  <-- ZZ

    i5 : pfaffian M

    o5 = 0

## See also

- determinant -- determinant of a matrix
- pfaffians -- ideal generated by Pfaffians

## Ways to use pfaffian:

- `pfaffian(Matrix)`

## For the programmer

The object pfaffian is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/pfaffian-doc.m2:36:0.