When I try to put an Ry gate into my circuit in cirq, I get an error saying that it only takes one argument.

import cirq
import numpy as np
q = cirq.LineQubit(0)
cirq.Circuit(cirq.Ry(np.pi / 2, q))
TypeError: Ry() takes 1 positional argument but 2 were given

1 Answer 1


cirq.Ry is a method that, given an angle, returns a gate. You then apply the gate to a qubit:


or, equivalently but a bit more confusingly:


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.