1
1
"""
2
- noisy_distribution(;input::Input, reflectivity ::Real, interf::Interferometer, exact=true, approx=true, samp=true)
2
+ noisy_distribution(;input::Input, loss ::Real, interf::Interferometer, exact=true, approx=true, samp=true; error=1e-4, failure_probability=1e-4 )
3
3
4
4
Compute the exact and/or approximated and/or sampled probability distribution of
5
5
all possible output configurations of partially-distinguishable photons through a
@@ -13,11 +13,11 @@ returns an array containing the three distributions.
13
13
!!! note "Reference"
14
14
[https://arxiv.org/pdf/1809.01953.pdf](https://arxiv.org/pdf/1809.01953.pdf)
15
15
"""
16
- function noisy_distribution (;input:: Input , reflectivity :: Real , interf:: Interferometer , exact= true , approx= true , samp= true )
16
+ function noisy_distribution (;input:: Input , loss :: Real , interf:: Interferometer , exact= true , approx= true , samp= true ; error = 1e-4 , failure_probability = 1e-4 )
17
17
18
18
output = []
19
- ϵ = 1e-4
20
- δ = 1e-4
19
+ ϵ = error
20
+ δ = failure_probability
21
21
22
22
input_modes = input. r. state
23
23
number_photons = input. n
@@ -30,14 +30,14 @@ function noisy_distribution(;input::Input, reflectivity::Real, interf::Interfero
30
30
get_parametric_type (input)[1 ] == Bosonic ? distinguishability = 1.0 : distinguishability = 0.0
31
31
end
32
32
33
- number_output_photons = trunc (Int, number_photons* reflectivity )
33
+ number_output_photons = trunc (Int, number_photons* loss )
34
34
input_occupancy_modes = fill_arrangement (input_modes)
35
35
36
- if reflectivity == 1 || distinguishability == 0
36
+ if loss == 1 || distinguishability == 0
37
37
throw (ArgumentError (" invalid input parameters" ))
38
38
end
39
39
40
- ki = (log (ϵ* δ* (1 - reflectivity * distinguishability^ 2 )/ 2 ))/ log (reflectivity * distinguishability^ 2 )
40
+ ki = (log (ϵ* δ* (1 - loss * distinguishability^ 2 )/ 2 ))/ log (loss * distinguishability^ 2 )
41
41
ki = 10 ^ (trunc (Int, log (10 , ki)))
42
42
ki < 10 ? k = number_photons : k = min (ki, number_photons)
43
43
kmax = k- 1
0 commit comments