Convert co-variance to Hamiltonian matrix

hey @Nicolas_Quesada, I tried the following:

prog = sf.Program(2)
np.random.seed(5)
x = np.random.rand(1)
print(x[0])
with prog.context as q:

    sf.ops.Thermal(n=1e-015) | q[0]
    sf.ops.Thermal(n=1e-015) | q[1]
    #sf.ops.S2gate(r=0.7,phi=0) | q
    #sf.ops.DisplacedSqueezed(alpha=1.,r=.7,p=x[0]) | q[0]
    #sf.ops.DisplacedSqueezed(alpha=2,r=.7,p=x[0]+np.pi) |q[1]
    sf.ops.Sgate(r=0.7,phi=x[0]) | q[0]
    sf.ops.Sgate(r=0.7,phi=x[0]+np.pi/4) | q[1]
    sf.ops.Dgate(7.2) | q[0]
    sf.ops.Dgate(-0.6-0.3j) | q[1]

eng = sf.Engine('gaussian')

result = eng.run(prog)    

cov = result.state.cov()
print(cov)
print(" ")
print(sf.decompositions.covmat_to_hamil(cov)) 

the result didn’t include any nan and was perfect except for the fact that the hamiltonian was not symmetric.
besides that, if i used a displacedsqueezed operation instead of the S and D gates i get nan values