コード例 #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))
コード例 #2
0
ファイル: test_qnode.py プロジェクト: wuben3125/pennylane
 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)
コード例 #3
0
ファイル: test_qnode.py プロジェクト: zeta1999/pennylane
 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))