Macaulay2 Engine
Loading...
Searching...
No Matches
pfaff.hpp File Reference

PfaffianComputation — Pfaffians of skew-symmetric matrices via row expansion. More...

#include "matrix.hpp"
#include "matrix-con.hpp"

Go to the source code of this file.

Classes

class  PfaffianComputation
 Computation of pfaffians of a skew symmetric matrix. More...

Detailed Description

PfaffianComputation — Pfaffians of skew-symmetric matrices via row expansion.

Note
AI-generated documentation. Verify against the source before relying on it.

Declares PfaffianComputation, the engine routine that returns Pf(A) for a square skew-symmetric A. The Pfaffian satisfies Pf(A)^2 = det(A) but has half the polynomial degree in the entries, so for skew-symmetric inputs it is the natural and cheaper invariant. The class stores the ambient ring R, the input matrix M (skew-symmetry is asserted by the caller — not verified), a size_t* row_set scratch for the current surviving index set, and an output MatrixConstructor pfaffs that collects the non-zero Pfaffians as one-row entries; calc(nsteps) drives the iteration via step(), and pfaffians() materialises the accumulated row matrix.

Computation runs the recursive Laplace-style expansion Pf(A) = sum_j (-1)^{j+1} A[1, j] Pf(A_{1, j}) (with A_{1, j} the (2n-2) x (2n-2) matrix obtained by deleting rows / columns 1 and j), bottoming out at the 2 x 2 base case Pf([[0, a], [-a, 0]]) = a. No memoisation cache — unlike det.hpp's DET_DYNAMIC strategy, calc_pfaff recomputes each submatrix Pfaffian afresh.

See also
matrix.hpp
matrix-con.hpp
det.hpp

Definition in file pfaff.hpp.