Skip to content

Commit 3379c6a

Browse files
authored
Fix r gate rotations. (#2683)
1 parent ce52061 commit 3379c6a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/Std/OpenQASM/Intrinsic.qs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,10 @@ operation ecr(qubit0 : Qubit, qubit1 : Qubit) : Unit is Adj + Ctl {
327327
/// Rotation θ around the cos(φ)x + sin(φ)y axis.
328328
/// `gate r(θ, φ) a {u3(θ, φ - π/2, -φ + π/2) a;}`
329329
operation r(theta : Angle, phi : Angle, qubit : Qubit) : Unit is Adj + Ctl {
330-
u3(theta, PI_OVER_4(), SubtractAngles(
330+
u3(theta, AddAngles(
331331
phi,
332332
NEG_PI_OVER_2()
333-
), qubit);
333+
), SubtractAngles(PI_OVER_2(), phi), qubit);
334334
}
335335

336336
/// A parametric 2-qubit `Z ⊗ X` interaction (rotation about ZX).

0 commit comments

Comments
 (0)