Boson Sampling State#

class SamplingState(d: int, calculator: piquasso.api.calculator.BaseCalculator, config: Optional[piquasso.api.config.Config] = None)#
Parameters
  • d (int) – The number of modes.

  • calculator (BaseCalculator) – Instance containing calculation functions.

  • config (Config) – Instance containing constants for the simulation.

validate() None#

Validates the currect state.

Raises

InvalidState – If the interferometer matrix is non-unitary.

property d: int#

The number of modes, on which the state is defined.

property particle_number: int#

The number of particles in the system.

get_particle_detection_probability(occupation_number: Tuple[int, ...]) 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

property fock_probabilities: numpy.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