I was trying to reconstruct the Hamiltonian from a covariance matrix but I always get nan values. this function implements the conversion. I checked and I realized that it’s the “atanh” that causes the problem. is there a way to overcome this issue??
I’m using the latest version of strawberryfields from the master
here is a simple script to produce the same error:
prog = sf.Program(1) amp = .7 np.random.seed(5) x = np.random.rand(1) with prog.context as q: sf.ops.DisplacedSqueezed(r=amp,p=x) | q eng = sf.Engine('gaussian') result = eng.run(prog) cov = result.state.cov() print(sf.decompositions.covmat_to_hamil(cov))