Template Function libwalrus::hafnian_nonneg¶
Defined in File hafnian_approx.hpp
Function Documentation¶
-
template<typename
T
>
long doublelibwalrus
::
hafnian_nonneg
(std::vector<T> &mat, int &nsamples)¶ Returns the approximation to the hafnian of a matrix with non-negative entries.
The approximation follows an stochastic algorithm according to which the hafnian can be approximated as the sum of determinants of matrices. The accuracy of the approximation increases with increasing number of iterations.
- Return
the approximate hafnian
- Parameters
mat
: vector representing the flattened matrixnsamples
: positive integer representing the number of samples to perform
libwalrus_cpp_api/function_namespacelibwalrus_1ab3892f822df7396c55cf9151f92a874b
Download Python script
Download Notebook
View on GitHub
Contents
Downloads