Function libwalrus::hafnian_recursive_quad(std::vector<std::complex<double>>&)¶
Defined in File recursive_hafnian.hpp
Function Documentation¶
-
std::complex<double>
libwalrus
::
hafnian_recursive_quad
(std::vector<std::complex<double>> &mat) Returns the hafnian of a matrix using the recursive algorithm described in Counting perfect matchings as fast as Ryser [5], where it is labelled as ‘Algorithm 2’.
Modified with permission from https://github.com/eklotek/Hafnian.
This is a wrapper around the templated function
libwalrus::hafnian_recursive
for Python integration. It accepts and returns complex double numeric types, and returns sensible values for empty and non-even matrices.In addition, this wrapper function automatically casts all matrices to type
complex<long double>
, allowing for greater precision than supported by Python and NumPy.- Return
the hafnian
- Parameters
mat
: vector representing the flattened matrix
libwalrus_cpp_api/function_namespacelibwalrus_1aec5347c2e1787fae4d413f3cb7c752c0
Download Python script
Download Notebook
View on GitHub
Contents
Downloads