08.02.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

Sage Reference Manual: Matrices and Spaces of Matrices - Mirrors

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Matrices</strong> <strong>and</strong> <strong>Spaces</strong> <strong>of</strong> <strong>Matrices</strong>, Release 6.1.1<br />

•self – matrix <strong>of</strong> size m × n with m ≤ n<br />

OUTPUT:<br />

The permanental k-minor <strong>of</strong> the matrix self.<br />

EXAMPLES:<br />

sage: M = MatrixSpace(ZZ,4,4)<br />

sage: A = M([1,0,1,0,1,0,1,0,1,0,10,10,1,0,1,1])<br />

sage: A.permanental_minor(2)<br />

114<br />

sage: M = MatrixSpace(ZZ,3,6)<br />

sage: A = M([1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1])<br />

sage: A.permanental_minor(0)<br />

1<br />

sage: A.permanental_minor(1)<br />

12<br />

sage: A.permanental_minor(2)<br />

40<br />

sage: A.permanental_minor(3)<br />

36<br />

Note that if k = m = n, the permanental k-minor equals per(A):<br />

sage: A.permanent()<br />

36<br />

sage: A.permanental_minor(5)<br />

0<br />

For C the “complement” <strong>of</strong> A:<br />

sage: M = MatrixSpace(ZZ,3,6)<br />

sage: C = M([0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0])<br />

sage: m, n = 3, 6<br />

sage: sum([(-1)^k * C.permanental_minor(k)*factorial(n-k)/factorial(n-m) for k in range(m+1)<br />

36<br />

See Theorem 7.2.1 <strong>of</strong> Brualdi <strong>and</strong> Ryser: Combinatorial Matrix Theory: per(A)<br />

AUTHORS:<br />

•Jaap Spies (2006-02-19)<br />

pfaffian(algorithm=None, check=True)<br />

Return the Pfaffian <strong>of</strong> self, assuming that self is an alternating matrix.<br />

INPUT:<br />

•algorithm – string, the algorithm to use; currently the following algorithms have been implemented:<br />

–’definition’ - using the definition given by perfect matchings<br />

•check (default: True) – Boolean determining whether to check self for alternatingness <strong>and</strong><br />

squareness. This has to be set to False if self is defined over a non-discrete ring.<br />

The Pfaffian <strong>of</strong> an alternating matrix is defined as follows:<br />

Let A be an alternating k × k matrix over a commutative ring. (Here, “alternating” means that A T = −A<br />

<strong>and</strong> that the diagonal entries <strong>of</strong> A are zero.) If k is odd, then the Pfaffian <strong>of</strong> the matrix A is defined to<br />

be 0. Let us now define it when k is even. In this case, set n = k/2 (this is an integer). For every i<br />

220 Chapter 7. Base class for matrices, part 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!