mm.Settings¶
- class mrmustard.Settings[source]¶
Bases:
object
A class containing various settings that are used by Mr Mustard throughout a session.
Some of these settings (such as those representing cutoff values) can be changed at any time, while others (such as the value of the Planck constant) can only be changed before being queried for the first time.
from mrmustard import settings >>> settings.AUTOCUTOFF_MAX_CUTOFF # check the default values 100 >>> settings.AUTOCUTOFF_MAX_CUTOFF = 150 # update to new values >>> settings.AUTOCUTOFF_MAX_CUTOFF 150
Attributes
The maximum value for autocutoff.
The minimum value for autocutoff.
The autocutoff probability.
The number of decimals displayed when drawing a circuit with parameters.
Whether tensorflow's ``ComplexWarning``s should be raised when a complex is casted to a float.
Whether or not to print the vector of means and the covariance matrix alongside the html representation of a state.
The default method for computing the transformation operated by a beam splitter in
The method used to discretize the Wigner function.
The cutoff used when comparing two transformations via the Choi–Jamiolkowski isomorphism.
The relative tolerance used when comparing two transformations via the Choi–Jamiolkowski isomorphism.
The relative tolerance used when comparing two transformations on Gaussian states.
The value of the Planck constant.
The value of squeezing for homodyne measurements.
The cutoff used when computing the output of a PNR detection.
The number of bits used to represent a single Fock amplitude when calculating Hermite polynomials.
Whether or not to display the progress bar when performing training.
Returns the seed value if set, otherwise returns a random seed.
- AUTOCUTOFF_MAX_CUTOFF¶
The maximum value for autocutoff. Default is
100
.
- AUTOCUTOFF_MIN_CUTOFF¶
The minimum value for autocutoff. Default is
1
.
- AUTOCUTOFF_PROBABILITY¶
The autocutoff probability. Default is
0.999
.
- CIRCUIT_DECIMALS¶
The number of decimals displayed when drawing a circuit with parameters. Default is
3
.
- COMPLEX_WARNING¶
Whether tensorflow’s
ComplexWarning``s should be raised when a complex is casted to a float. Default is ``False
.
- DEBUG¶
Whether or not to print the vector of means and the covariance matrix alongside the html representation of a state. Default is
False
.
- DEFAULT_BS_METHOD¶
- The default method for computing the transformation operated by a beam splitter in
the Fock basis . Default is
vanilla
.
Can be either
'vanilla'
or'schwinger'
.
- DISCRETIZATION_METHOD¶
The method used to discretize the Wigner function. Default is
iterative
.Can be either
'iterative'
or'clenshaw'
.
- EQ_TRANSFORMATION_CUTOFF¶
The cutoff used when comparing two transformations via the Choi–Jamiolkowski isomorphism. Default is
3
.
- EQ_TRANSFORMATION_RTOL_FOCK¶
The relative tolerance used when comparing two transformations via the Choi–Jamiolkowski isomorphism. Default is
1e-3
.
- EQ_TRANSFORMATION_RTOL_GAUSS¶
The relative tolerance used when comparing two transformations on Gaussian states. Default is
1e-6
.
- HBAR¶
The value of the Planck constant. Default is
2
.Cannot be changed after its value is queried for the first time.
- HOMODYNE_SQUEEZING¶
The value of squeezing for homodyne measurements. Default is
10
.
- PNR_INTERNAL_CUTOFF¶
The cutoff used when computing the output of a PNR detection. Default is
50
.
- PRECISION_BITS_HERMITE_POLY¶
The number of bits used to represent a single Fock amplitude when calculating Hermite polynomials. Default is 128 (i.e. the Fock representation has dtype complex128). Currently allowed values: 128, 256, 384, 512
- PROGRESSBAR¶
Whether or not to display the progress bar when performing training. Default is
True
.
- SEED¶
Returns the seed value if set, otherwise returns a random seed.
- instance¶