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
import strawberryfields as sf
import strawberryfields.ops as op
p = sf.Program(2)
with p.context as q:
op.Squeezed(1) | q[0]
e = sf.Engine('fock', backend_options={'cutoff_dim': 4})
r = e.run(p)
print(f"Fock engine density matrix shape {r.state.dm().shape}")
e = sf.Engine('gaussian')
r = e.run(p)
print(f"Gaussian engine density matrix shape {r.state.dm(cutoff=4).shape}")
Tracebacks
No response
Additional information
No response
The text was updated successfully, but these errors were encountered:
Hi @aplund, thank you for reporting this bug. We will take a look into it.
sduquemesa
changed the title
[replace with a short descriptive title for your report]
Base Gaussian State dm doesn't preserve locality dimensions
Jul 26, 2022
Before posting a bug report
Expected behavior
BaseGaussianState.dm() doesn't preserve locality dimensions. The Fock basis backend and Gaussian backend should give the same results.
Actual behavior
state.dm() gives gives only 2 dimensional matricies. The Fock basis state gives a multi-index object depending on the number of modes.
Reproduces how often
Always
System information
Source code
Tracebacks
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: