A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
Qmat
, Amat
from generate_hafnian_sample
. (#343)
This release contains contributions from (in alphabetical order):
Mikhail Andrenkov (@Mandrenkov), Sebastián Duque (@sduquemesa), Jacob Hastrup (@JacobHast), Antonín Hoskovec (@thonic), Martin Houde (@MHoude2), Benjamin Lanthier (@benjaminlanthier), Dominic Leclerc (@dleclerc33), Filippo Miatto (@ziofil), Will McCutcheon, Brandon Turcotte (@brandonpolymtl), Jiaqi Zhao (@JQZ1111)
New functions for calculating properties of distinguishable squeezed states of light having passed through an interferometer. #326
New function ltor
is added which allows threshold_detector_prob
to act more consistently on displaced and zero-mean Gaussian states. #317
New functions for threshold detection probabilities of Fock states, the Bristolian (brs) and the Unitary Bristolian (ubrs). #316
Entanglement measures entanglement_entropy
and log_negativity
for bipartite Gaussian states are added to the quantum submodule. #332
New functions, recursive_hafnian
and solve
added in the _hafnian
module. #325
New function to check if a matrix is symplectic is_symplectic
. #334.
Adds support for Python 3.10. #337
Update methods for calculating threshold detector probabilities of Gaussian states, now using ltor
function within threshold_detection_prob
#317
numba_tor
now can benefit from numba parallelization #317
Recursive Torontonian added for faster computation based on paper "Polynomial speedup in Torontonian calculation by a scalable recursive algorithm" by Ágoston Kaposi, Zoltán Kolarovszki, Tamás Kozsik, Zoltán Zimborás, and Péter Rakyta. #321
Recursive Loop Torontonian added for faster computation based on combining recursive Torontonian improvement and new loop Torontonian feature. #332
Hafnians of odd-sized matrices are calculated roughly twice as fast. #329
The new Hafnian functions now use the Labudde method to calculate power traces instead of using diagonalization. #333
This release contains contributions from (in alphabetical order):
Jake Bulmer, Luke Helt, Martin Houde, Theodor Isacsson, Benjamin Lanthier, Fabian Laudenbach, Dominic Leclerc, Gregory Morse, Nicolas Quesada, Brandon Turcotte, Jiaqi Zhao
Permanent algorithms are implemented in Python using Numba just-in-time compilation. #300
Hafnian algorithms are implemented in Python using Numba just-in-time compilation. #311
Documentation is updated to include the characteristic polynomials and decompositions modules. #312
Makes modules reachable via the global namespace, instead of requiring importing the modules explicitly. #312
import thewalrus as tw
tw.samples.generate_torontonian_sample
This release contains contributions from (in alphabetical order):
Theodor Isacsson, Benjamin Lanthier, Dominic Leclerc, Nicolas Quesada, Brandon Turcotte, Trevor Vincent, Jiaqi Zhao
Python installation no longer requires repoze.lru
. #293
Multidimensional Hermite polynomials are now implemented in Numba, hence reducing the C++ dependencies of The Walrus. #295
Updates missing figures in the "Basics of Hafnians and Loop Hafnians" documentation. #288
This release contains contributions from (in alphabetical order):
Mikhail Andrenkov, Sebastián Duque
hermite_multidimensional_numba
can now handle a cutoff of type np.ndarray
with shape=[]
. #283
This release contains contributions from (in alphabetical order):
Filippo Miatto
hermite_multidimensional_numba
and hermite_multidimensional_numba_grad
. #280
Updates the samples.generate_torontonian_sample
function to ensure probabilities are normalized. #250
Pins Numba to version <0.54
to avoid binary imcompatibilities with the 1.21 release of NumPy. #250
This release contains contributions from (in alphabetical order):
Josh Izaac, Filippo Miatto, Nicolas Quesada.
Adds the function hafnian_sparse
to compute sparse loop hafnians (pure Python implementation). #245
The symplectic.squeezing
function is now generalized to multiple modes of single mode squeezing. #249
Adds a function symplectic.passive_transformation
which allows for Gaussian states to be transformed by arbitrary non-unitary, non-square linear optical transformations. #249
The torontonian_sample_state
function can now sample displaced Gaussian states. #248
Adds the function hafnian_banded
to calculate the hafnian of a banded matrix. #246
Adds the functions hermite_multidimensional_numba
and grad_hermite_multidimensional_numba
to calculate renormalized multidimensional Hermite polynomials and its gradients using Numba. #251
Adds the functions mzgate
and grad_mzgate
to calculate the Fock representation of the Mach-Zehnder gate and its gradients. #257
Adds the ability to calculate n-body photon number distributions using the function n_body_marginals
. #253
Adds the ability to calculate cumulants and arbitrary expectation values of products of powers of photon numbers with the functions photon_number_cumulant
and photon_number_moment
respectively. #264
Adds support for calculating the permanent using the BBFG algorithm and changes this to the default method for calculating permanents. #267
Adds the ability to calculate click cumulants in threshold detection with the function click_cumulant
. #264
Speeds up the calculation of photon number variances/covariances. #244
Updates documentation for the the tor
function. #265
Numba methods for multidimensional hermite can now detect dtype automatically. #271
Corrects bug in the function photon_number_covar
that gave incorrect results when the covariance between two modes with finite displacements was calculated. #264
Fixes a bug in setup.py
that would cause the build to fail when using miniforge for M1 macs. #273
Updates the samples.generate_hafnian_sample
function to renormalize probabilities. #250
This release contains contributions from (in alphabetical order):
Ali Asadi, Jake Bulmer, Timjan Kalajdzievski, Filippo Miatto, Nicolas Quesada, Yuan Yao
This release contains contributions from (in alphabetical order):
Josh Izaac
Adds the function random_banded_interferometer
to generate unitary matrices with a given bandwidth. #208
Adds the function tvd_cutoff_bounds
to calculate bounds in the total variation distance between a Fock-truncated and an ideal GBS distribution. #210
Adds function for calculating threshold detection probabilities for Gaussian states with displacement. #220
Adds new functions total_photon_number_distribution
and characteristic_function
to study properties of the total photon number distribution of a k
identical lossy squeezers. #230
Adds new functions xxpp_to_xpxp
and xpxp_to_xxpp
in the symplectic
module to swap the ordering of the quadrature operators in vectors and matrices. #237
The hafnians and loop hafnians of diagonal matrices are now calculated in polynomial time. #212
Refactors setup.py
to avoid issues with CFLAGS
. #229
The fidelity
function in quantum/gaussian_checks.py
is rewritten to add clarity. #226
Simplifies logic of normal_ordered_expectation
by removing mutually cancelling np.conj
. #228
Removes unnecessary np.real_if_close
statements in quantum/fock_tensors.py
causing the probabilities
to not be normalized. #215
Fixes the prefactor in pure_state_amplitude
. #231
This release contains contributions from (in alphabetical order):
Jack Brown, Jake Bulmer, Rachel Chadwick, Stefano Paesani, Nicolas Quesada
Adds the function find_classical_subsystem
that tries to find a subset of the modes with a classical covariance matrix. #193
Adds the functions mean_number_of_clicks
and variance_number_of_clicks
that calculate the first and second statistical moments of the total number of clicks in a Gaussian state centered at the origin. #195
Adds the module decompositions
with the function williamson
to find the Williamson decomposition of an even-size positive-semidefinite matrix. #200
Adds the loop_hafnian_quad
function to the Python interface for converting double precision matrices into quad precision, doing the calculations in quad precision, and then return the result as a double. #201
Introduces a new faster and significantly more accurate algorithm to calculate power traces allowing to speed up the calculation of loop hafnians #199
The quantum
module has been refactored and organized into sub-modules. Several functions have been renamed, while the old names are being deprecated. #197
Adds support for C++14 #202
pytest-randomly
is added to the test suite to improve testing and avoid stochastically failing tests. #205
Modifies the function input_validation
to use np.allclose
for checking the symmetry of the input matrices. #206
Modifies the function _hafnian
to calculate efficiently loop hafnians of diagonal matrices. #206
Removes the redundant function normal_ordered_complex_cov
. #194
Renames the function mean_number_of_clicks
to be mean_number_of_click_graph
. #195
This release contains contributions from (in alphabetical order):
Theodor Isacsson, Nicolas Quesada, Trevor Vincent