BosonSampling.matrix_phi
— Methodmatrix_phi(k, U, occupancy_vector, n)
BosonSampling.partition_probability_distribution_distinguishable_rand_walk
— Methodpartition_probability_distribution_distinguishable_rand_walk(part, U)
Generate a vector giving the probability to have $k$ photons in the partition part
at the output of the interferomter U
.
BosonSampling.proba_partition_bosonic
— Methodproba_partition_bosonic(;U, occupancy_vector, input_state=ones(Int, size(U,1)), checks=true)
Indistinguishable version of proba_partition_partial
.
BosonSampling.proba_partition_partial
— Methodproba_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
.
- We take
U
of dimension $m$ whileM
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.
BosonSampling.best_partition_size
— Methodbest_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.
For a single subset, n_subsets
=2 as we need a complete partition, occupying all modes.
BosonSampling.choose_best_average_subset
— Methodchoose_best_average_subset(;m, n, distance=tvd)
Return the ideal subset size on average and its total variance distance.
BosonSampling.partition_expectation_values
— Methodpartition_expectation_values(partition_size_vector, partition_counts)
partition_expectation_values(part_occ::PartitionOccupancy)
Return the Haar averaged probability of photon number count in binned outputs for Distinguishable
and Bosonic
particles.
BosonSampling.subset_expectation_value
— Methodsubset_expectation_value(subset_size, k, n, m)
Return the Haar averaged probability to find k
from n
photons inside a subset of binned output modes of length size_subset
among m
modes for Distinguishable
and Bosonic
cases.
BosonSampling.subset_relative_distance_of_averages
— Methodsubset_relative_distance_of_averages(subset_size, n, m)
BosonSampling.all_mode_configurations
— Methodall_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.
- 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
BosonSampling.check_photon_conservation
— Methodcheck_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.
BosonSampling.compute_probabilities_partition
— Methodcompute_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.
BosonSampling.compute_probability!
— Methodcompute_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.
BosonSampling.compute_probability_partition_occupancy
— Methodcompute_probability_partition_occupancy(physical_interferometer::Interferometer, part_occupancy::PartitionOccupancy, input_state::Input)
Compute the probability to find a partition occupancy.
Inefficient to use multiple times for the same physical setting, rather use computeprobabilitiespartition.
BosonSampling.p_partition
— Methodp_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
.
BosonSampling.photon_number_conserving_events
— Methodphoton_number_conserving_events(physical_indexes, n; partition_spans_all_modes=false)
Return only the events conserving photon number n
.
- If
partition_spans_all_modes
=false
, gives all events with less thann
orn
photons - If
partition_spans_all_modes
=true
only exact photon number conserving physical_indexes
BosonSampling.photon_number_non_conserving_events
— Methodphoton_number_non_conserving_events(physical_indexes, n; partition_spans_all_modes=false)
Return the elements not conserving the number of photons.
BosonSampling.ranked_partition_list
— Methodranked_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.
BosonSampling.remove_trivial_partitions!
— Methodremove_trivial_partitions!(part_list)
In a list of partitions sizes, ex. [[2,0],[1,1],[0,2]]
, keeps only the elements with non trivial subset size, in this ex. only [1,1]
.
BosonSampling.to_partition_count
— Methodto_partition_count(event::Event{TIn, TOut}, part::Partition) where {TIn<:InputType, TOut <: FockDetection}
Converts an Event
with FockDetection
to a PartitionCount
one.