From d127e026182022edabae59ce5a2eb84dd48b0f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sekav=C4=8Dnik?= Date: Thu, 13 Jul 2023 17:53:13 +0200 Subject: [PATCH 1/2] Corrected CPHASE --- eqsn/gates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eqsn/gates.py b/eqsn/gates.py index b518029..079e332 100644 --- a/eqsn/gates.py +++ b/eqsn/gates.py @@ -247,7 +247,7 @@ def cphase_gate(self, applied_to_id, controlled_by_id): applied_to_id (String): Id of the Qubit on which the X gate is applied. controlled_by_id (String): Id of the Qubit which controls the gate. """ - x = np.array([[0, 1], [0, -1]], dtype=np.csingle) + x = np.array([[1, 0], [0, -1]], dtype=np.csingle) self.merge_qubits(applied_to_id, controlled_by_id) q = self.shared_dict.get_queues_for_ids([applied_to_id])[0] q.put([CONTROLLED_GATE, x, applied_to_id, controlled_by_id]) From 86516e75de1341a0debcf57f9626a4a856cb2839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sekav=C4=8Dnik?= Date: Thu, 13 Jul 2023 18:23:23 +0200 Subject: [PATCH 2/2] Updated the descriptino of the cphase method --- eqsn/gates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eqsn/gates.py b/eqsn/gates.py index 079e332..3b6d53e 100644 --- a/eqsn/gates.py +++ b/eqsn/gates.py @@ -244,7 +244,7 @@ def cphase_gate(self, applied_to_id, controlled_by_id): q_id1 and controlled by q_id2. Args: - applied_to_id (String): Id of the Qubit on which the X gate is applied. + applied_to_id (String): Id of the Qubit on which the Z gate is applied. controlled_by_id (String): Id of the Qubit which controls the gate. """ x = np.array([[1, 0], [0, -1]], dtype=np.csingle)