MrMustard icon indicating copy to clipboard operation
MrMustard copied to clipboard

Modes are not concatenated correctly between fock and gaussian states

Open sduquemesa opened this issue 1 year ago • 1 comments

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

sduquemesa avatar Apr 14 '23 15:04 sduquemesa

Oh 🤔 well spotted

ziofil avatar Apr 14 '23 15:04 ziofil