Overview¶
Python API¶
The
thewalrus
Python API provides access to various highly optimized hafnian, permanent, and torontonian algorithmsThe
thewalrus.quantum
submodule provides access to various utility functions that act on Gaussian quantum statesThe
thewalrus.samples
submodule provides access to algorithms to sample from the hafnian or the torontonian of Gaussian quantum statesThe
thewalrus.symplectic
submodule provides access to a convenient set of symplectic matrices and utility functions to manipulate themThe
thewalrus.decompositions
submodule provides access to common shared matrix decompositions used to perform gate decompositionsThe
thewalrus.charpoly
submodule provides access to La Budde’s algorithm to calculate the characteristic polynomials of matricesThe
thewalrus.random
submodule provides access to random unitary, symplectic and covariance matricesThe
thewalrus.fock_gradients
submodule provides access to the Fock representation of certain continuous-variable gates and their gradientsThe
thewalrus.reference
submodule provides access to pure-Python reference implementations of the hafnian, loop hafnian, and torontonian
Octave¶
In addition, two Octave functions are provided: octave/hafnian.m
and octave/loophafnian.m
.