State#

class State(calculator: BaseCalculator, config: Config | None = None)#

The base class from which all State classes are derived.

Properties:

d (int): Instance attribute specifying the number of modes. calculator (BaseCalculator): Instance containing calculation functions. config (Config): Instance containing constants for the simulation.

copy() State#

Returns an exact copy of this state.

Returns:

An exact copy of this state.

Return type:

State

abstract property d: int#

The number of modes.

abstract property fock_probabilities: ndarray#

Returns the particle detection probabilities.

Note

The ordering of the Fock basis is increasing with particle numbers, and in each particle number conserving subspace, lexicographic ordering is used.

Returns:

The particle detection probabilities.

Return type:

numpy.ndarray

abstract validate() None#

Validates the state.

abstract get_particle_detection_probability(occupation_number: ndarray) float#

Returns the particle number detection probability using the occupation number specified as a parameter.

Parameters:

occupation_number (tuple) – Tuple of natural numbers representing the number of particles in each mode.

Returns:

The probability of detection.

Return type:

float