diff --git a/demonstrations/tutorial_kak_theorem.py b/demonstrations/tutorial_kak_theorem.py index 6819908acd..8ac894fe64 100644 --- a/demonstrations/tutorial_kak_theorem.py +++ b/demonstrations/tutorial_kak_theorem.py @@ -775,7 +775,7 @@ def theta_Y(x): P = qml.math.linalg.expm(qml.matrix(horizontal_x)) decomp = qml.ops.one_qubit_decomposition(P, 0, rotations="ZYZ") print(decomp) -angle_match = np.isclose((decomp[0].data[0] + decomp[-1].data[0])%(2*np.pi), 0.) +angle_match = np.isclose((decomp[0].data[0] + decomp[-1].data[0]) % (2 * np.pi), 0.0) print(f"First and last rotation angle match up to sign and shift by 2kπ: {angle_match}") ######################################################################