Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def circuit(w, x=None):
qml.RX(x[0], wires=[0])
qml.RX(x[1], wires=[1])
return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1))
def circuit(a):
qml.RX(a, wires=0)
return qml.var(qml.PauliZ(0))
def circuit(x):
qml.Rot(0.3, x, -0.2, wires=[0])
return qml.expval(qml.PauliZ(0))
def circuit(w, x=None):
qml.RX(x, wires=[0])
return qml.expval(qml.PauliZ(0))
def circuit():
return qml.sample(qml.PauliZ(0)), qml.sample(qml.PauliZ(1)), qml.sample(qml.PauliZ(2))
def circuit():
qml.BasisState(np.array([1, 0, 1]), wires=[0, 1, 2])
op(wires=[0, 1, 2])
return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliZ(1)), qml.expval(qml.PauliZ(2))
def circuit1(x):
qml.RX(x, wires=0)
qml.CRX(x, wires=[0, 1])
return qml.expval(qml.PauliZ(0))
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 circuit(phi=None):
# Encoding of 4 classical input values
for j in range(4):
qml.RY(np.pi * phi[j], wires=j)
# Random quantum circuit
RandomLayers(rand_params, wires=list(range(4)))
# Measurement producing 4 classical output values
return [qml.expval(qml.PauliZ(j)) for j in range(4)]
def circuit2(phi1, phi2):
qml.RX(phi1, wires=0)
qml.RY(phi2, wires=0)
return qml.expval(qml.PauliZ(0))