From 2a4c7f744156775af0173f2a4ba4c206c5328b93 Mon Sep 17 00:00:00 2001 From: michael <65613226+michaelontiveros@users.noreply.github.com> Date: Wed, 9 Nov 2022 16:11:19 -0700 Subject: [PATCH 1/2] fixed XPowGate matrix description Let t = 1. Then the XPowGate matrix should be a phase factor times the Pauli X-matrix, which means that the first coefficient should equal 0. As written, the first coefficient is equal to a phase factor times \cos(\pi t), which does not equal 0. --- cirq-core/cirq/ops/common_gates.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cirq-core/cirq/ops/common_gates.py b/cirq-core/cirq/ops/common_gates.py index a8131613942..9dfd43fc9ae 100644 --- a/cirq-core/cirq/ops/common_gates.py +++ b/cirq-core/cirq/ops/common_gates.py @@ -74,8 +74,8 @@ class XPowGate(eigen_gate.EigenGate): $$ e^{i \pi s t} \begin{bmatrix} - e^{i \pi t /2} \cos(\pi t) & -i e^{i \pi t /2} \sin(\pi t) \\ - -i e^{i \pi t /2} \sin(\pi t) & e^{i \pi t /2} \cos(\pi t) + e^{i \pi t /2} \cos(\pi t /2) & -i e^{i \pi t /2} \sin(\pi t /2) \\ + -i e^{i \pi t /2} \sin(\pi t /2) & e^{i \pi t /2} \cos(\pi t /2) \end{bmatrix} $$ From 084af174f8a761a90f7806373e79e31df9388430 Mon Sep 17 00:00:00 2001 From: michael <65613226+michaelontiveros@users.noreply.github.com> Date: Thu, 10 Nov 2022 15:06:41 -0700 Subject: [PATCH 2/2] combined and moved phase factors to the front --- cirq-core/cirq/ops/common_gates.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cirq-core/cirq/ops/common_gates.py b/cirq-core/cirq/ops/common_gates.py index 9dfd43fc9ae..7efc8139f70 100644 --- a/cirq-core/cirq/ops/common_gates.py +++ b/cirq-core/cirq/ops/common_gates.py @@ -72,10 +72,10 @@ class XPowGate(eigen_gate.EigenGate): The unitary matrix of `cirq.XPowGate(exponent=t, global_shift=s)` is: $$ - e^{i \pi s t} + e^{i \pi t (s + 1/2)} \begin{bmatrix} - e^{i \pi t /2} \cos(\pi t /2) & -i e^{i \pi t /2} \sin(\pi t /2) \\ - -i e^{i \pi t /2} \sin(\pi t /2) & e^{i \pi t /2} \cos(\pi t /2) + \cos(\pi t /2) & -i \sin(\pi t /2) \\ + -i \sin(\pi t /2) & \cos(\pi t /2) \end{bmatrix} $$