Beispiel #1
0
 def qf(x, y):
     qml.Displacement(x, 0, [0])
     qml.CubicPhase(0.2, [0])  # nongaussian succeeding x
     qml.Squeezing(0.3, x,
                   [1])  # x affects gates on both wires, y unused
     qml.Rotation(1.3, [1])
     return qml.expval.X(0), qml.expval.X(1)
Beispiel #2
0
 def qf(x, y):
     qml.Displacement(x, 0, [0])
     qml.CubicPhase(0.2, [0])
     qml.Squeezing(0.3, y, [1])
     qml.Rotation(1.3, [1])
     #qml.Kerr(0.4, [0])  # nongaussian succeeding x but not y   TODO when QNode uses a DAG to describe the circuit, uncomment this line
     return qml.expval.X(0), qml.expval.X(1)
 def qf(x, y):
     qml.Displacement(0.5, 0, wires=[0])
     qml.Squeezing(x, 0, wires=[0])
     M = np.zeros((5, 5), dtype=object)
     M[1, 1] = y
     M[1, 2] = 1.0
     M[2, 1] = 1.0
     return qml.expval.PolyXP(M, [0, 1])
 def circuit(x):
     args = [0.3] * G.num_params
     args[0] = x
     qml.Displacement(0.5, 0, wires=0)
     G(*args, wires=range(G.num_wires))
     qml.Beamsplitter(1.3, -2.3, wires=[0, 1])
     qml.Displacement(-0.5, 0, wires=0)
     qml.Squeezing(0.5, -1.5, wires=0)
     qml.Rotation(-1.1, wires=0)
     return O(wires=0)
 def qf(x, y):
     qml.Displacement(x, 0, wires=[0])
     qml.Squeezing(y, -1.3 * y, wires=[0])
     return qml.expval.X(0)
 def qf(x, y, z):
     qml.Displacement(x, 0.2, wires=[0])
     qml.Squeezing(y, z, wires=[0])
     qml.Rotation(-0.2, wires=[0])
     return qml.expval.X(0)
 def circuit(y):
     qml.Squeezing(y, 0., wires=[0])
     return qml.expval.NumberState(np.array([2, 0]), wires=[0, 1])
 def circuit(y, r=0.5):
     qml.Displacement(r, 0., wires=[0])
     qml.Squeezing(y, 0., wires=[0])
     return qml.expval.X(0)
Beispiel #9
0
 def circuit(y):
     qml.Squeezing(y, 0., wires=[0])
     return qml.expval(qml.FockStateProjector(np.array([2, 0]), wires=[0, 1]))
Beispiel #10
0
 def circuit(r, phi):
     qml.Squeezing(r, 0, wires=0)
     qml.Rotation(phi, wires=0)
     return qml.var(qml.X(0))
Beispiel #11
0
        def circuit(theta, phi, varphi):
            for w in wires:
                qml.Squeezing(sq[w][0], sq[w][1], wires=w)

            qml.template.Interferometer(theta, phi, varphi, wires=wires)
            return [qml.expval.MeanPhoton(w) for w in wires]
 def qf(r0, phi0, r1, phi1):
     qml.Squeezing(r0, phi0, wires=[0])
     qml.Squeezing(r1, phi1, wires=[0])
     return qml.expval(qml.NumberOperator(0))