MrMustard
MrMustard copied to clipboard
Modes are not concatenated correctly between fock and gaussian states
Before posting a bug report
- [X] I have searched exisisting GitHub issues to make sure the issue does not already exist.
Expected behavior
When concatenating a Fock and a Gaussian state its modes should be consecutive, meaning the following code
from mrmustard.lab import TMSV, Fock, SqueezedVacuum
state_fock = TMSV(r=-0.5,phi=0,modes=[0,1]) & Fock([1,2,3],modes=[2,3,4])
state_fock.modes
should produce the output [0, 1, 2, 3, 4]
. Similarly, concatenating two gaussian state
state_guassian = TMSV(r=-0.5,phi=0,modes=[0,1]) & SqueezedVacuum(r=[1.0]*3,phi=[0.0]*3,modes=[2,3,4])
state_guassian.modes
should produce [0, 1, 2, 3, 4]
as well.
Actual behavior
in the first case modes come out to be [0, 1, 4, 5, 6]
whereas in the second they are [0, 1, 2, 3, 4]
as expected.
Reproduces how often
always
System information
not relevant
Source code
from mrmustard.lab import TMSV, Fock, SqueezedVacuum
state_fock = TMSV(r=-0.5,phi=0,modes=[0,1]) & Fock([1,2,3],modes=[2,3,4])
state_fock.modes
Tracebacks
No response
Additional information
No response
Oh 🤔 well spotted