 # Modeling distinguishability

Hey!
I have a question on how to model non-unit indistinguishability with Perceval. Considering the simple case of the Hong-Ou-Mandel interference, the non-perfect bunching of the two photons can be fundamentally related to a mode mismatch in some degree of freedom.

Thus, checking also the code of the object `Source`, one can model an imperfect HOM interference using annotations. In other words I can introduce a distinuishability feature `_` and use it in this way:

``````psi_0 = pcvl.StateVector("|1{_:0}>")
psi_1 = np.sqrt(p) * pcvl.StateVector("|1{_:0}>") + np.sqrt(1-p) * pcvl.StateVector("|1{_:randfeat}>")
``````

where `p` is the square root of the HOM visibility and `randfeat` is some random value for the distinguishability feature.

Now if I want to model an experiment where the photons of the HOM interference are polarized, let’s say horizontally, an obvious extension would be:

``````psi_0 = pcvl.StateVector("|1{P:H}{_:0}>")
psi_1 = np.sqrt(p) * pcvl.StateVector("|1{P:H}{_:0}>") + np.sqrt(1-p) * pcvl.StateVector("|1{P:H}{_:randfeat}>").
``````

But it does not work. For the backend the two states `pcvl.AnnotatedBasicState("|1{P:H}{_:0}>")` and `pcvl.AnnotatedBasicState("|1{P:H}{_:randfeat}>")` are perfectly indistinguishable. In other words, if the polarization is the same, any other difference in any other degree of freedom is ignored. Don’t you think this should be corrected?

Thanks and best,
Francesco