Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@qml.qnode(gaussian_dev)
def circuit(*x):
"""Reference quantum function"""
qml.Displacement(a, 0, wires=[0])
op(*x, wires=wires)
return qml.expval(qml.X(0))
@qml.qnode(dev)
def circuit():
return qml.expval(qml.Identity(0))
@qml.qnode(dev_qpu)
def circuit_Zmi():
qml.RX(np.pi, wires=qubit)
return qml.expval(qml.PauliZ(qubit))
@qml.qnode(dev1)
def mean_photon_gaussian(mag_alpha, phase_alpha, phi):
qml.Displacement(mag_alpha, phase_alpha, wires=0)
qml.Rotation(phi, wires=0).inv()
return qml.expval(qml.NumberOperator(0))
@qml.qnode(dev)
def circuit1(x):
qml.RX(x, wires=0)
qml.CRX(x, wires=[0, 1])
return qml.expval(qml.PauliZ(0))
@qml.qnode(dev)
def circuit(params, A=None):
# repeatedly apply each layer in the circuit
for j in range(nr_layers):
layer(params, j)
# returns the expectation of the input matrix A on the first qubit
return qml.expval(qml.Hermitian(A, wires=0))
@qml.qnode(dev)
def circuit(weights, x=None):
"""The circuit of the variational classifier.
Args:
weights (array[float]): array of variables
x: single input vector
Returns:
expectation of Pauli-Z operator on Qubit 0
"""
statepreparation(x)
for W in weights:
layer(W)
@qml.qnode(dev)
def measure_A1B2():
bell_pair()
return qml.expval(A1 @ B2)
@qml.qnode(dev)
def circuit_Y(var):
ansatz(var)
return qml.expval(qml.PauliY(1))
@qml.qnode(dev1)
def circuit2(phi1, phi2):
qml.RX(phi1, wires=0)
qml.RY(phi2, wires=0)
return qml.expval(qml.PauliZ(0))