sf.ops.MZgate no observable interference as a function of phase

Hello I’m trying to see destructive interference of from Mach Zehnder interferometer when the phase difference between the two arms is pi. Here’s the script:

import strawberryfields as sf
from strawberryfields.ops import *

import numpy as np
import plotly.graph_objects as go
from plotly.subplots import make_subplots

# start here: 
prog = sf.Program(2)
eng = sf.Engine("gaussian", backend_options={"cutoff_dim": 10})

with prog.context as q:
    Coherent(2, 0)  | q[0]
    Coherent(2, 0)  | q[1]
    MZgate(np.pi, 0) | (q[0], q[1])

state = eng.run(prog).state
results = eng.run(prog)

plt.figure(figsize = (10, 5))
for i in range(2):
    plt.subplot(1, 2, i + 1)
    X = np.linspace(-10, 10, 100)
    P = np.linspace(-10, 10, 100)
    Z = state.wigner(i, X, P)
    X, P = np.meshgrid(X, P)
    plt.pcolormesh(X, P, Z, cmap = 'RdBu_r')
    plt.xlabel('X'); plt.ylabel('P')


I don’t think I see any interference as a function of the phi_in of the MZgate. I tried both gaussian and fock bases. Maybe my displacement operator is only 2 is causing problem since it might Hong-Ou-Mandel?

Hi @yypai: I am not sure you will see anything as a function of phi_in since your interferometer is fixed to be MZgate(np.pi, 0)

Thank you Nicolas. Sorry, I mean I manually changed the np.pi to several different values. Please also allow me to add some details. I also changed the coherent states to Coherent(4, 0). Below are the Wigner functions of the q[0] and q[1] after MZI.

I see the photon number (distance from origin) does not change when internal phase is 0 or pi, but photon number is doubled in one whereas the other becomes zero when the internal phase is pi/2 or 3*pi/2. I guess this is a manifestation of Hong-Ou-Mandel effect here? Thanks again!

Also, is it possible to see the classical limit, i.e., destructive interference when internal phase = pi. I guess I need large photon number to see that maybe? Thank you again!

Hi @yypai — What you are seeing by looking into the energy (mean photon number) at the output is indeed interference, but al the classical type. Classical Maxwell’s equation are more than sufficient to explain what you are seeing.

Thank you again Nicolas.

I think I see why I didn’t understand earlier now. For semiclassical = coherent light source Wikipedia MZI I see destructive interference when internal phase is pi.

Here I see destructive interference when the internal phase is pi/2 and 3pi/2 because this parameter is not the same thing as I thought, it’s the argument for this ops.Rgate.

Correct! Glad it was helpful.