Пример #1
0
 def qf(x, y):
     qml.Displacement(x, 0, wires=[0])
     qml.Displacement(1.2, y, wires=[0])
     qml.Beamsplitter(0.2, 1.7, wires=[0, 1])
     qml.Rotation(1.9, wires=[0])
     qml.Kerr(0.3, wires=[1])  # nongaussian succeeding both x and y due to the beamsplitter
     return qml.expval(qml.X(0)), qml.expval(qml.X(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 circuit(y):
     qml.Displacement(alpha, 0., wires=[0])
     qml.Beamsplitter(y, 0, wires=[0, 1])
     return qml.expval.X(0)
 def circuit():
     qml.Beamsplitter(
         0.2, 0.1,
         wires=[0, 1])  #this expectation will never be supported
     return qml.expval.Homodyne(0.7, 0)
Пример #5
0
 def qf(x, y):
     qml.Kerr(y, [1])
     qml.Displacement(x, 0, [0])
     qml.Beamsplitter(0.2, 1.7, [0, 1])
     return qml.expval.X(0), qml.expval.X(1)
Пример #6
0
 def qf(x, y):
     qml.Kerr(y, wires=[1])
     qml.Displacement(x, 0, wires=[0])
     qml.Beamsplitter(0.2, 1.7, wires=[0, 1])
     return qml.expval(qml.X(0)), qml.expval(qml.X(1))