BosonSampling.proba_partition_partialMethod
proba_partition_partial(;U, S, occupancy_vector, input_state, checks=true)

Return a $n+1$ sized array giving the probability to find [0,1,...], photons inside the bins given by occupancy_vector at the output of U.

Note
  • We take U of dimension $m$ while M is the scattering matrix, as in Tichy, $M_ij = U_{d_i}, _{d_j}$.
  • Given $n$ photons, generally in the first modes, the distinguishability matrix is defined as in Tichy, $S_{ij} = <phi_{d_i}|phi_{d_j}>$. This is not a problem as it does not depend on the output partition but be aware of it.
source
BosonSampling.best_partition_sizeMethod
best_partition_size(;m, n, n_subsets, distance=tvd)

Return the ideal partition_size_vector for a given number of subsets n_subsets and the Haar averaged TVD in second parameter.

Note

For a single subset, n_subsets=2 as we need a complete partition, occupying all modes.

source
BosonSampling.all_mode_configurationsMethod
all_mode_configurations(n, n_subset; only_photon_number_conserving=false)
all_mode_configurations(input_state::Input, part::Partition; only_photon_number_conserving=false)
all_mode_configurations(input_state::Input, sub::Subset; only_photon_number_conserving=false)

Generate all possible photon counts of n photons in a partition/subset of n_subset subsets.

Note
  • Does not take into account photon number conservation by default
  • This is the photon counting in partitions and not events outputs but it can be used likewise
source
BosonSampling.check_photon_conservationMethod
check_photon_conservation(physical_indexes,  pdf, n; atol=ATOL, partition_spans_all_modes=false)

Check if probabilities corresponding to non photon number conserving events are zero.

source
BosonSampling.compute_probabilities_partitionMethod
compute_probabilities_partition(physical_interferometer::Interferometer, part::Partition, input_state::Input)

Compute the probability to find a certain photon counts in a partition part of the output modes for the given interferometer.

Return `(counts = physical_indexes, probabilities = pdf) corresponding to the occupation numbers in the partition and the associated probability.

source
BosonSampling.compute_probability!Method
compute_probability!(ev::Event{TIn,TOut}) where {TIn<:InputType, TOut<:PartitionCount}
compute_probability!(ev::Event{TIn,TOut}) where {TIn<:InputType, TOut<:PartitionCountsAll}

Given a defined Event, computes/updates its probability or set of probabilities (for instance if looking at partition outputs, with MultipleCounts begin filled).

This function is defined separately as it is most often the most time consuming step of calculations and one may which to separate the evaluation of probabilities from preliminary definitions.

source
BosonSampling.compute_probability_partition_occupancyMethod
compute_probability_partition_occupancy(physical_interferometer::Interferometer, part_occupancy::PartitionOccupancy, input_state::Input)

Compute the probability to find a partition occupancy.

Note

Inefficient to use multiple times for the same physical setting, rather use computeprobabilitiespartition.

source
BosonSampling.p_partitionMethod
p_partition(ev::Event{TIn1, TOut1}, ev_theory::Event{TIn2, TOut2}) where {TIn1<:InputType, TOut1 <: PartitionCount, TIn2 <:InputType, TOut2 <:PartitionCountsAll}

Outputs the probability that an observed count in ev happens under the conditions set by ev_theory. For instance, if we take the conditions

ib = Input{Bosonic}(first_modes(n,m))
part = equilibrated_partition(m,n_subsets)
o = PartitionCountsAll(part)

evb = Event(ib,o,interf)

then

p_partition(ev, evb)

gives the probability that this ev is observed under the hypotheses of ev_theory.

source
BosonSampling.photon_number_conserving_eventsMethod
photon_number_conserving_events(physical_indexes, n; partition_spans_all_modes=false)

Return only the events conserving photon number n.

Note
  • If partition_spans_all_modes=false, gives all events with less than n or n photons
  • If partition_spans_all_modes = true only exact photon number conserving physical_indexes
source
BosonSampling.ranked_partition_listMethod
ranked_partition_list(part_list)

Remove partitions such as [1,2] when [2,1] is already counted as only the size of the partition counts; only keeps vectors of decreasing count.

source
BosonSampling.to_partition_countMethod
to_partition_count(event::Event{TIn, TOut}, part::Partition) where {TIn<:InputType, TOut <: FockDetection}

Converts an Event with FockDetection to a PartitionCount one.

source