Exemplo n.º 1
0
    def test_queue(self, n_wires, weight_shape, expected_queue):
        """Checks the queue for the default settings."""

        with pennylane._queuing.OperationRecorder() as rec:
            QAOAEmbedding(features=list(range(n_wires)),
                          weights=np.zeros(shape=weight_shape),
                          wires=range(n_wires))

        for gate, expected_gate in zip(rec.queue, expected_queue):
            assert isinstance(gate, expected_gate)
Exemplo n.º 2
0
 def circuit(x=None):
     QAOAEmbedding(features=x,
                   weights=weights,
                   wires=range(n_wires),
                   local_field='A')
     return [qml.expval(qml.PauliZ(i)) for i in range(n_wires)]
Exemplo n.º 3
0
 def circuit(x=None):
     QAOAEmbedding(features=x, weights=weights, wires=range(2))
     return [qml.expval(qml.PauliZ(i)) for i in range(2)]
Exemplo n.º 4
0
 def circuit(x=None):
     QAOAEmbedding(features=x, weights=weights, wires='a')
     return qml.expval(qml.PauliZ(0))