Hello there. I have a question regarding the conventions with the heterodyne measurement. So I’m trying to build a covariance matrix from heterodyne measurements on two modes that are squeezed together with a S2gate. I just wanted to know if the values given by heterodyne measurement the quadratures X1,P1,X2,P2 or are they rather complex amplitudes like alpha, alpha*, beta, beta*. Below is the code I use to make covariance matrices from my measurements, in r=(X1,X2,P1,P2) ordering. Also it would seem to me that setting a value for hbar does not seem to change that heterodyne measurement considers hbar=1/2. Atleast I think that because to get approximately the same mean vector when comparing homodyne and heterodyne measurments I have to set sf.hbar=1/2 and setting it to another value does not seem to change the results of heterodyne measurements.

T=300

gamma =np.pi/2

theta = 0

phi = 0

alpha = 4 # coherent state parameter |alpha|=20

eta = 0.1 # Transmitssivity parameter

r=7

omega=2*np.pi*100E9 #rad/s

def nbar_thermal(T):

lamb = (constants.hbar*omega)/(constants.Boltzmann*T)

return(1/(np.exp(lamb) - 1))

nbar=nbar_thermal(T)

hbar=1/2

sf.hbar=hbar

prog=sf.Program(2)

size_simulation=int(1e3)

#Quadrature simulation data vector

dataX1 = np.empty(size_simulation)

dataP1 = np.empty(size_simulation)

dataX2 = np.empty(size_simulation)

dataP2 = np.empty(size_simulation)

Number_of_covs=[1,30]

simulation_mean_cov=np.empty([len(Number_of_covs),4,4])

with prog.context as q:

S2gate(r,gamma) | (q[0], q[1])

Dgate(alpha,theta) | q[0]

Dgate(alpha,theta) | q[1]

MeasureHeterodyne() | q[0]

MeasureHeterodyne() | q[1]

for k, Ncov in enumerate(Number_of_covs):

```
simulation_cov=np.empty([Ncov,4,4])
for j in range(Ncov):
eng = sf.Engine(backend='gaussian')
for i in range(size_simulation):
Z=eng.run(prog).samples
dataX1[i] = np.real(Z[0][0])
dataP1[i] = np.imag(Z[0][0])
dataX2[i] = np.real(Z[0][1])
dataP2[i] = np.imag(Z[0][1])
covW = np.cov((dataX1,dataX2,dataP1,dataP2),bias=False) - (hbar/2)*np.eye(4)
simulation_cov[j] = covW
simulation_mean_cov[k]=np.mean(simulation_cov,axis=0)
```

for k in range(len(simulation_mean_cov)):

print(f’\nMean covariance matrix with {Number_of_covs[k]} cov matrices:\n {simulation_mean_cov[k]}')