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

AUTOCUTOFF_MAX_CUTOFF

The maximum value for autocutoff.

AUTOCUTOFF_MIN_CUTOFF

The minimum value for autocutoff.

AUTOCUTOFF_PROBABILITY

The autocutoff probability.

CIRCUIT_DECIMALS

The number of decimals displayed when drawing a circuit with parameters.

COMPLEX_WARNING

Whether tensorflow's ``ComplexWarning``s should be raised when a complex is casted to a float.

DEBUG

Whether or not to print the vector of means and the covariance matrix alongside the html representation of a state.

DEFAULT_BS_METHOD

The default method for computing the transformation operated by a beam splitter in

DISCRETIZATION_METHOD

The method used to discretize the Wigner function.

EQ_TRANSFORMATION_CUTOFF

The cutoff used when comparing two transformations via the Choi–Jamiolkowski isomorphism.

EQ_TRANSFORMATION_RTOL_FOCK

The relative tolerance used when comparing two transformations via the Choi–Jamiolkowski isomorphism.

EQ_TRANSFORMATION_RTOL_GAUSS

The relative tolerance used when comparing two transformations on Gaussian states.

HBAR

The value of the Planck constant.

HOMODYNE_SQUEEZING

The value of squeezing for homodyne measurements.

PNR_INTERNAL_CUTOFF

The cutoff used when computing the output of a PNR detection.

PRECISION_BITS_HERMITE_POLY

The number of bits used to represent a single Fock amplitude when calculating Hermite polynomials.

PROGRESSBAR

Whether or not to display the progress bar when performing training.

SEED

Returns the seed value if set, otherwise returns a random seed.

instance

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