def circuit2(weights): qml.QubitStateVector(np.array([1, 0, 1, 1]) / np.sqrt(3), [0, 1]) qml.Rot(weights[0], weights[1], 0.3, 0) qml.CNOT([0, 1]) return qml.expval.PauliZ(0), qml.expval.PauliY(1)
def circuit(x, y, z): qml.QubitStateVector(np.array([1, 0, 1, 1]) / np.sqrt(3), [0, 1]) qml.Rot(x, y, z, 0) qml.CNOT([0, 1]) return qml.expval.PauliZ(0), qml.expval.PauliY(1)
def circuit(): qml.QubitStateVector(state, wires=[0, 1, 2]) return qml.expval.PauliZ(0), qml.expval.PauliZ( 1), qml.expval.PauliZ(2)
def ansatz(x, y, z): qml.QubitStateVector(np.array([1, 0, 1, 1])/np.sqrt(3), wires=[0, 1]) qml.Rot(x, y, z, wires=0) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliY(1))
def circuit1(weights, x=0.3): qml.QubitStateVector(np.array([1, 0, 1, 1]) / np.sqrt(3), wires=[0, 1]) qml.Rot(weights[0], weights[1], x, wires=0) qml.CNOT(wires=[0, 1]) return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliY(1))