Problem when using permutation

Hello, I’m having a problem while using object PERM.

Alice_circuit=(pcvl.Circuit(10)
.add((2,3),phys.BS())
.add((0,1,2,3,4,5,6,7,8,9),phys.PERM([0,1,3,4,5,6,7,2,8,9]))

Using the input state:

pcvl.StateVector("|1,0,1,0,1,0,0,0,0,0>")

I get after the Beam Splitter :

sqrt(2)/2*|1,0,1,0,1,0,0,0,0,0>+sqrt(2)/2*|1,0,0,1,1,0,0,0,0,0>

And the final output (after permutation) is :

sqrt(2)/2*|1,0,1,1,0,0,0,0,0,0>+sqrt(2)/2*|1,0,0,1,0,0,0,1,0,0>

instead of getting :

sqrt(2)/2*|1,0,0,0,1,1,0,0,0,0>+sqrt(2)/2*|1,0,0,1,0,0,0,1,0,0>

Best regards,

Hello @QuantumMaster - indeed, this is the issue reported here: Error in the Permutation component · Issue #29 · Quandela/Perceval · GitHub - we are releasing a fix in a few days.

If you work with the source, it can be corrected using this patch: fix #29: permutation matrix was transposed · jsenellart/Perceval@0cad65f · GitHub

Thanks !
Jean