TuringQ / deepquantum

DeepQuantum for quantum computing
https://deepquantum.turingq.com/
Apache License 2.0
31 stars 7 forks source link

Homodyne measurement error for large squeezing parameter r #31

Closed Hugh-888 closed 5 days ago

Hugh-888 commented 3 weeks ago

Problem

large squeezing parameter r leads to non-positive definite covariance matrix

image

code

nmode = 2
circ = dq.QumodeCircuit(nmode=nmode, init_state='vac', cutoff=3, backend='gaussian', basis=True)
circ.s([0], r=11)
st = circ()
circ.draw()
re = circ.measure_homodyne(wires=[0], shots=1)
re 
sansiro77 commented 3 weeks ago

Maybe we can add an identity matrix of epsilon=1e-7 or epsilon=1e-15 to the covariance matrix if the minimum value of its diagonal elements is too small according to the dtype.