F = glynn M
Uses Glynn's formula (see Glynn, David G. (2010), "The permanent of a square matrix", European Journal of Combinatorics 31 (7): 1887–1891, doi:10.1016/j.ejc.2010.01.010).
Let $M=(m_{i,j})$ be an nxn matrix. Then $perm(M)=\sum_{\delta}\prod_{k=1}^n(\delta_k) \prod_{i=1}^n\sum_{j=1}^n \delta_j m_{i,j}$ where the outer summation is over $\delta\in \{ -1,+1\}^n$ with $\delta_1=1$.
For example, for the 3x3 generic matrix Glynn’s formula gives $2^2 perm(M) =(a + b + c)(d + e + f)(g + h + i) − (a − b + c)(d − e + f)(g − h + i) −(a + b − c)(d + e − f)(g + h − i) + (a − b − c)(d − e − f)(g − h − i)$.
Here is the permanent of a 3x3 generic matrix of variables.
|
|
|
Here is the permanent of a 4x4 generic matrix of variables.
|
|
|
Here is the permanent of a 3x3 matrix of integers.
|
|
Works in characteristic not equal to 2 because need to divide by $2^{n-1}$. Computationally intensive for moderate size matrices.
The object glynn is a method function.