Conventions on heterodyne measurement

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

def nbar_thermal(T):
lamb = (constants.hbaromega)/(constants.BoltzmannT)
return(1/(np.exp(lamb) - 1))

nbar=nbar_thermal(T)

hbar=1/2
sf.hbar=hbar

prog=sf.Program(2)
size_simulation=int(1e3)

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]}')

Hey @Nicolas-Ivan,

The heterodyne measurements give a single complex outcome. So that must be the alpha variable in the a / a^\dagger basis, not the q/p basis, which would have two real values (one for q and one for p). The parameters in the a / a^\dagger basis do not have \hbar dependence, so changing \hbar should not affect the measurement outcomes. To convert from the alpha parameter to the q/p parameters they need to use \alpha = \tfrac{1}{\sqrt{2\hbar}}(q+ip). In your code, you are missing the \sqrt{2\hbar} and by choosing \hbar=1/2, that factor becomes 1 which is why it works. For general \hbar you need to remember that \sqrt{2\hbar} factor.

Hope this helps!

Thank you very much! Have a great day!

1 Like