v5.0.0
What's Changed
Added
get_purity
in*FockState
for calculating the purity.PostSelectPhotons
andImperfectPostSelectPhotons
forPureFockSimulator
and
SamplingSimulator
.Beamsplitter5050
support.SamplingState.state_vector
, analog of*FockState.state_vector
.- JAX support for
SamplingSimulator
. - Support for multiple occupation numbers in
SamplingSimulator
. PureFockState.get_particle_detection_probability_on_modes
, which is similar to
get_particle_detection_probability
, but for the specified modes.HomodyneMeasurement
support forPureFockSimulator
.cvqnn.get_cvqnn_weight_indices
is created, which enables slicing of the weights when
needed.PureFockState.variance_photon_number
for calculating the variance of the photon
number operator.- Partial JAX support for
GaussianSimulator
. GaussianState.get_threshold_detection_probability
.- Python 3.12 support.
- Support for
ParticleNumberMeasurement
inGaussianSimulator
with the config
use_torontonian=True
and displaced Gaussian states. Config.validate
flag. If set tovalidate=False
, validations are skipped, possibly
enabling minor speed-up or JIT compilation.piquasso.fermionic
package with support for fermionic Gaussian states.- Support for differentiable
GaussianState.get_particle_detection_probability
.
Fixed
Simulator.execute
withinitial_state
specified while usingtf.function
.GaussianSimulator
random number generation fromConfig.rng
.- Error message formatting in
Simulator
. Beamsplitter
default parameters.fock_probabilities
differentiability inPureFockSimulator
.SamplingState.fock_probabilities
returns with probabilities corresponding to all
particle number sectors.
Breaking changes
- Delete unused attributes in
SamplingState
. - Clements decomposition rewritten.
- The original RNG is kept when a
Config
is copied. This is done to prevent unexpected
behaviour with seeded calculations. - The config variable
Config.normalize
is deleted. For the same result, one can call
State.normalize
at the end of the calculations. Simulator._default_calculator_class
initial value got deleted to avoid confusion.- Renamed
Calculator
toConnector
and corresponding names containing the term
calculator
, referring to the originalCalculator
class (e.g.,
_default_calculator_class
->_default_connector_class
). BaseConnector
(formerBaseCalculator
) rewritten as an abstract class.- Added/updated
__repr__
methods for all classes in the Piquasso API.
Performance improvements
- Hafnian, loop hafnian, torontonian and permanent implementations replaced with faster
implementations. The torontonian calculation is written in C++, and is distributed in
the wheels alongside the Python code. - Faster
FockState.norm
. - Faster
SamplingState.get_particle_detection_probability
. - JIT compilation of passive linear gates in
*FockSimulator
. - Common Fock-space related calculations got rewritten, JIT compilation enabled.
- More efficient sampling algorithms for BS and GBS simulations.
New Contributors
- @czaba7 made their first contribution in #307
- @dependabot made their first contribution in #355
Full Changelog: 4.0.0...v5.0.0