| Permanent-functions | R Documentation |
These three functions are used in the classical Boson Sampling problem
cxPerm(A)
rePerm(B)
cxPermMinors(C)
A |
a square complex matrix. |
B |
a square real matrix. |
C |
a rectangular complex matrix where |
Permanents are evaluated using Glynn's formula (equivalently that of Nijenhuis and Wilf (1978))
cxPerm(A) returns a complex number: the permanent of the complex matrix A.
rePerm(B) returns a real number: the permanent of the real matrix B.
cxPermMinors(C) returns a complex vector of length ncol(C)+1: the permanents of all
ncol(C)-dimensional square matrices constructed by removing individual rows from C.
Glynn, D.G. (2010) The permanent of a square matrix. European Journal of Combinatorics, 31(7):1887–1891.
Nijenhuis, A. and Wilf, H. S. (1978). Combinatorial algorithms: for computers and calculators. Academic press.
set.seed(7)
n <- 20
A <- randomUnitary(n)
cxPerm(A)
#
B <- Re(A)
rePerm(B)
#
C <- A[,-n]
v <- cxPermMinors(C)
#
# Check Laplace expansion by sub-permanents
c(cxPerm(A),sum(v*A[,n]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.