Implements Ryser's algorithm for the permanent.
Install:
$ pip install permanent
Use:
>>> from numpy import *
>>> from permanent import permanent
>>> permanent(eye(15))
(1-0j)
Please note that for now we assume that the input array's dtype
is complex
. So for example:
>>> permanent(array([[0,1],[1,1]]), dtype=complex)
(1+0j)
whereas permanent(array([[0,1],[1,1]]))
will not produce the expected result.