Source losses not simulated

I noticed that the losses and emission_probability options for the Source class are not taken into account when using probs(). I think this was already working correctly in a previous version, but I cannot remember exactly.

source = pcvl.Source(losses=0.1, emission_probability=0.9)
qpu = pcvl.Processor(“SLOS”, pcvl.BS(), source)
qpu.with_input(pcvl.BasicState([1, 1]))
pcvl.pdisplay(qpu.probs()[“results”])

Cheers,
Stephen

Hi Stephen,

losses and emission_probability are currently well simulated in Perceval. However, what you’d like to see (I guess) conflicts with the default value of the “min_detected_photons_filter”. By default, you only get output states with as many photons as in the expected input state (before losses and transmittance are taken into account). In this case, other output states, with a lower photon count, get discarded and the “physical performance” gets lower.
You can check the computed physical performance by calling print(qpu.probs()["physical_perf"])

But in the end, I think you’d like to get the whole distribution without filtering. In that case, you can modify your code like the following:

source = pcvl.Source(losses=0.1, emission_probability=0.9)
qpu = pcvl.Processor('SLOS', pcvl.BS(), source)
qpu.with_input(pcvl.BasicState([1, 1]))
qpu.min_detected_photons_filter(0)  # disable any output state filtering
probs = qpu.probs()
pcvl.pdisplay(probs['results'])

Which outputs:

+-------+-------------+
| state | probability |
+-------+-------------+
| |2,0> |   0.32805   |
| |0,2> |   0.32805   |
| |1,0> |   0.1539    |
| |0,1> |   0.1539    |
| |0,0> |   0.0361    |
+-------+-------------+

Best wishes!
Eric

Hi Eric,

Thanks, this is exactly what I was missing. I remember now that I used to use .mode_post_selection(0) to accomplish this, but it was removed. I wasn’t aware it was replaced by this filter, and I just assumed that the new default would give all outcomes (it’s a bit weird that the default includes a filter).

Cheers,
Stephen