예제 #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.MeanPhoton(wires=0)),
         qml.expval(qml.MeanPhoton(wires=1))
     ]
예제 #2
0
 def circuit(x=None):
     SqueezingEmbedding(features=x,
                        wires=range(n_wires),
                        method='phase',
                        c=1)
     Beamsplitter(pi / 2, 0, wires=[0, 1])
     SqueezingEmbedding(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):
     SqueezingEmbedding(features=x,
                        wires=range(n_wires),
                        method='phase',
                        c=1)
     Beamsplitter(pi / 2, 0, wires=[0, 1])
     SqueezingEmbedding(features=[0, 0],
                        wires=range(n_wires),
                        method='phase',
                        c=1)
     return [
         qml.expval.MeanPhoton(wires=0),
         qml.expval.MeanPhoton(wires=1)
     ]