piel.tools.thewalrus#

Submodules#

Package Contents#

Functions#

unitary_permanent(→ tuple)

The permanent of a unitary is used to determine the state probability of combinatorial Gaussian boson samping systems.

unitary_permanent(unitary_matrix: jax.numpy.ndarray) tuple[source]#

The permanent of a unitary is used to determine the state probability of combinatorial Gaussian boson samping systems.

thewalrus Ryser’s algorithm permananet implementation is described here: https://the-walrus.readthedocs.io/en/latest/gallery/permanent_tutorial.html

Note that this function needs to be as optimised as possible, so we need to minimise our computational complexity of our operation.

# TODO implement validation # TODO maybe implement subroutine if computation is taking forever. # TODO why two outputs? Understand this properly later.

Parameters:

unitary_permanent (np.ndarray) – The unitary matrix.

Returns:

The circuit permanent and the time it took to compute it.

Return type:

tuple