File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -82,13 +82,13 @@ def test_U_parameterized_gate():
8282 assert Umat .shape == (2 , 2 ), "Parameterized U gate should be 2x2."
8383
8484 # 2) Produce X up to global phase with U(π, -π/2, π/2)
85- U_x = Gates .U (theta = math .pi , phi = - math .pi / 2 , lam = math .pi / 2 )
85+ U_x = Gates .U (theta = math .pi , phi = - math .pi / 2 , lam = math .pi / 2 )
8686 X = Gates .X
8787
8888 # Compare up to a global phase
8989 # We'll pick a nonzero element to find the ratio
9090 ratio = U_x [0 , 1 ] / X [0 , 1 ] # e.g., compare top-right
9191 adjusted = U_x * np .conjugate (ratio )
92- assert np .allclose (adjusted , X , atol = 1e-8 ), (
93- "U(π, -π/2, π/2) not matching X up to a global phase."
94- )
92+ assert np .allclose (
93+ adjusted , X , atol = 1e-8
94+ ), "U(π, -π/2, π/2) not matching X up to a global phase."
You can’t perform that action at this time.
0 commit comments