예제 #1
0
 def circuit(x=None):
     DisplacementEmbedding(features=x,
                           wires=range(n_wires),
                           method='phase',
                           c=1.)
     Beamsplitter(pi / 2, 0, wires=[0, 1])
     DisplacementEmbedding(features=[0, 0],
                           wires=range(n_wires),
                           method='phase',
                           c=1.)
     return [
         qml.expval(qml.NumberOperator(wires=0)),
         qml.expval(qml.NumberOperator(wires=1))
     ]
 def circuit(x=None):
     DisplacementEmbedding(features=x,
                           wires=range(n_wires),
                           method='phase',
                           c=1.)
     Beamsplitter(pi / 2, 0, wires=[0, 1])
     DisplacementEmbedding(features=[0, 0],
                           wires=range(n_wires),
                           method='phase',
                           c=1.)
     return [
         qml.expval.MeanPhoton(wires=0),
         qml.expval.MeanPhoton(wires=1)
     ]
예제 #3
0
 def circuit(x=None):
     DisplacementEmbedding(features=x,
                           wires=range(n_wires),
                           method='amplitude',
                           c=1.)
     return [
         qml.expval(qml.NumberOperator(wires=0)),
         qml.expval(qml.NumberOperator(wires=1))
     ]
 def circuit(x=None):
     DisplacementEmbedding(features=x,
                           wires=range(n_wires),
                           method='amplitude',
                           c=1.)
     return [
         qml.expval.MeanPhoton(wires=0),
         qml.expval.MeanPhoton(wires=1)
     ]
예제 #5
0
 def circuit(x=None):
     DisplacementEmbedding(features=x, wires=[0, 1])
     return qml.expval(qml.X(0))
예제 #6
0
 def circuit(x=None):
     DisplacementEmbedding(features=x, wires=range(n_wires), method='A')
     return [qml.expval(qml.X(i)) for i in range(n_wires)]
예제 #7
0
 def circuit(x=None):
     DisplacementEmbedding(features=x, wires=3, method='A')
     return qml.expval(qml.X(0))