You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Fock` implements [_preferred_projection](https://github.com/XanaduAI/MrMustard/blob/develop/mrmustard/lab/states.py#L493) and [_contract_with_other](https://github.com/XanaduAI/MrMustard/blob/develop/mrmustard/lab/abstract/state.py#L424) takes [advantage of it](https://github.com/XanaduAI/MrMustard/blob/develop/mrmustard/lab/abstract/state.py#L429). When performing [_project_onto_fock](https://github.com/XanaduAI/MrMustard/blob/develop/mrmustard/lab/abstract/state.py#L395), the marginal is computed through [_preferred_projection](https://github.com/XanaduAI/MrMustard/blob/develop/mrmustard/lab/states.py#L516), which returns either a vector or a density matrix depending on the value of `other.is_hilbert_vector`. The form of the resulting state [is determined](https://github.com/XanaduAI/MrMustard/blob/develop/mrmustard/lab/abstract/state.py#L412) through `other.is_pure`. As per the referenced bug https://github.com/XanaduAI/MrMustard/issues/292, these two properties are not equal.
The text was updated successfully, but these errors were encountered:
You're welcome. It is a consequence of the other bug. Sadly the additional information above was interpreted as code block and explains how the bug happens with references to the implementation. Pasted below.
Thanks, @jan-provaznik!
Yes, I believe that this will be addressed automatically in the next few weeks when we add Tensor support to states, as we have done for transformations. I will add this example to the list of tests to make sure that it works :)
Before posting a bug report
Expected behavior
Once expects a projection onto a Fock state to work.
Actual behavior
One is met with
Reproduces how often
Whenever the bug #292 gets triggered.
System information
Source code
Tracebacks
No response
Additional information
The text was updated successfully, but these errors were encountered: