Skip to content

Commit

Permalink
Fix rzx files
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric-Arellano committed Oct 7, 2024
1 parent 502f7a4 commit baf3b93
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 67 deletions.
10 changes: 5 additions & 5 deletions qiskit/circuit/library/templates/rzx/rzx_cy.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ def rzx_cy(theta: ParameterValueType | None = None):
.. code-block:: text
┌──────────┐
q_0: ──■─────────────■─────────────────────────────────┤0 ├───────────
┌─┴─┐┌───────┐┌─┴─┐┌────────┐┌──────────┐┌───────┐│ RZX(-ϴ) │┌─────────┐
q_1: ┤ X ├┤ RY(ϴ) ├┤ X ├┤ RY(-ϴ) ├┤ RZ(-π/2) ├┤ RX(ϴ) ├┤1 ├┤ RZ(π/2) ├
└───┘└───────┘└───┘└────────┘└──────────┘└───────┘└──────────┘└─────────┘
┌──────────┐
q_0: ──■─────────────■─────────────────────────────────┤0 ├───────────
┌─┴─┐┌───────┐┌─┴─┐┌────────┐┌──────────┐┌───────┐│ RZX(-ϴ) │┌─────────┐
q_1: ┤ X ├┤ RY(ϴ) ├┤ X ├┤ RY(-ϴ) ├┤ RZ(-π/2) ├┤ RX(ϴ) ├┤1 ├┤ RZ(π/2) ├
└───┘└───────┘└───┘└────────┘└──────────┘└───────┘└──────────┘└─────────┘
"""
if theta is None:
theta = Parameter("ϴ")
Expand Down
22 changes: 11 additions & 11 deletions qiskit/circuit/library/templates/rzx/rzx_xz.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@

def rzx_xz(theta: ParameterValueType | None = None):
"""RZX-based template for CX - RXGate - CX.
.. code-block:: text
┌───┐ ┌───┐┌─────────┐┌─────────┐┌─────────┐┌──────────┐»
q_0: ┤ X ├─────────┤ X ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├┤0 ├»
└─┬─┘┌───────┐└─┬─┘└─────────┘└─────────┘└─────────┘│ RZX(-ϴ) │»
q_1: ──■──┤ RX(ϴ) ├──■───────────────────────────────────┤1 ├»
└───────┘ └──────────┘»
« ┌─────────┐┌─────────┐┌─────────┐
«q_0: ┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├
« └─────────┘└─────────┘└─────────┘
«q_1: ─────────────────────────────────
«
┌───┐ ┌───┐┌─────────┐┌─────────┐┌─────────┐┌──────────┐»
q_0: ┤ X ├─────────┤ X ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├┤0 ├»
└─┬─┘┌───────┐└─┬─┘└─────────┘└─────────┘└─────────┘│ RZX(-ϴ) │»
q_1: ──■──┤ RX(ϴ) ├──■───────────────────────────────────┤1 ├»
└───────┘ └──────────┘»
« ┌─────────┐┌─────────┐┌─────────┐
«q_0: ┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├
« └─────────┘└─────────┘└─────────┘
«q_1: ─────────────────────────────────
«
"""
if theta is None:
theta = Parameter("ϴ")
Expand Down
16 changes: 8 additions & 8 deletions qiskit/circuit/library/templates/rzx/rzx_yz.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

def rzx_yz(theta: ParameterValueType | None = None):
"""RZX-based template for CX - RYGate - CX.
.. code-block:: text
┌────────┐ ┌─────────┐┌─────────┐┌──────────┐
q_0: ──■──┤ RY(-ϴ) ├──■──┤ RX(π/2) ├┤0 ├┤ RX(-π/2) ├
┌─┴─┐└────────┘┌─┴─┐└─────────┘│ RZX(ϴ) │└──────────┘
q_1: ┤ X ├──────────┤ X ├───────────┤1 ├────────────
└───┘ └───┘ └─────────┘
.. code-block:: text
┌────────┐ ┌─────────┐┌─────────┐┌──────────┐
q_0: ──■──┤ RY(-ϴ) ├──■──┤ RX(π/2) ├┤0 ├┤ RX(-π/2) ├
┌─┴─┐└────────┘┌─┴─┐└─────────┘│ RZX(ϴ) │└──────────┘
q_1: ┤ X ├──────────┤ X ├───────────┤1 ├────────────
└───┘ └───┘ └─────────┘
"""
if theta is None:
theta = Parameter("ϴ")
Expand Down
34 changes: 17 additions & 17 deletions qiskit/circuit/library/templates/rzx/rzx_zz1.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,24 @@

def rzx_zz1(theta: ParameterValueType | None = None):
"""RZX-based template for CX - RZGate - CX.
.. code-block:: text
»
q_0: ──■────────────────────────────────────────────■───────────────────────»
┌─┴─┐┌───────┐┌────┐┌───────┐┌────┐┌────────┐┌─┴─┐┌────────┐┌─────────┐»
q_1: ┤ X ├┤ RZ(ϴ) ├┤ √X ├┤ RZ(π) ├┤ √X ├┤ RZ(3π) ├┤ X ├┤ RZ(-ϴ) ├┤ RZ(π/2) ├»
└───┘└───────┘└────┘└───────┘└────┘└────────┘└───┘└────────┘└─────────┘»
« ┌──────────┐ »
«q_0: ───────────────────────────────┤0 ├──────────────────────»
« ┌─────────┐┌─────────┐┌───────┐│ RZX(-ϴ) │┌─────────┐┌─────────┐»
«q_1: ┤ RX(π/2) ├┤ RZ(π/2) ├┤ RX(ϴ) ├┤1 ├┤ RZ(π/2) ├┤ RX(π/2) ├»
« └─────────┘└─────────┘└───────┘└──────────┘└─────────┘└─────────┘»
«
«q_0: ───────────
« ┌─────────┐
«q_1: ┤ RZ(π/2) ├
« └─────────┘
.. code-block:: text
»
q_0: ──■────────────────────────────────────────────■───────────────────────»
┌─┴─┐┌───────┐┌────┐┌───────┐┌────┐┌────────┐┌─┴─┐┌────────┐┌─────────┐»
q_1: ┤ X ├┤ RZ(ϴ) ├┤ √X ├┤ RZ(π) ├┤ √X ├┤ RZ(3π) ├┤ X ├┤ RZ(-ϴ) ├┤ RZ(π/2) ├»
└───┘└───────┘└────┘└───────┘└────┘└────────┘└───┘└────────┘└─────────┘»
« ┌──────────┐ »
«q_0: ───────────────────────────────┤0 ├──────────────────────»
« ┌─────────┐┌─────────┐┌───────┐│ RZX(-ϴ) │┌─────────┐┌─────────┐»
«q_1: ┤ RX(π/2) ├┤ RZ(π/2) ├┤ RX(ϴ) ├┤1 ├┤ RZ(π/2) ├┤ RX(π/2) ├»
« └─────────┘└─────────┘└───────┘└──────────┘└─────────┘└─────────┘»
«
«q_0: ───────────
« ┌─────────┐
«q_1: ┤ RZ(π/2) ├
« └─────────┘
"""
if theta is None:
theta = Parameter("ϴ")
Expand Down
26 changes: 13 additions & 13 deletions qiskit/circuit/library/templates/rzx/rzx_zz2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@

def rzx_zz2(theta: ParameterValueType | None = None):
"""RZX-based template for CX - RZGate - CX.
.. code-block:: text
»
q_0: ──■────────────■─────────────────────────────────────────────────────»
┌─┴─┐┌──────┐┌─┴─┐┌───────┐┌─────────┐┌─────────┐┌─────────┐┌───────┐»
q_1: ┤ X ├┤ P(ϴ) ├┤ X ├┤ P(-ϴ) ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├┤ RX(ϴ) ├»
└───┘└──────┘└───┘└───────┘└─────────┘└─────────┘└─────────┘└───────┘»
« ┌──────────┐
«q_0: ┤0 ├─────────────────────────────────
« │ RZX(-ϴ) │┌─────────┐┌─────────┐┌─────────┐
«q_1: ┤1 ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├
« └──────────┘└─────────┘└─────────┘└─────────┘
.. code-block:: text
»
q_0: ──■────────────■─────────────────────────────────────────────────────»
┌─┴─┐┌──────┐┌─┴─┐┌───────┐┌─────────┐┌─────────┐┌─────────┐┌───────┐»
q_1: ┤ X ├┤ P(ϴ) ├┤ X ├┤ P(-ϴ) ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├┤ RX(ϴ) ├»
└───┘└──────┘└───┘└───────┘└─────────┘└─────────┘└─────────┘└───────┘»
« ┌──────────┐
«q_0: ┤0 ├─────────────────────────────────
« │ RZX(-ϴ) │┌─────────┐┌─────────┐┌─────────┐
«q_1: ┤1 ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├
« └──────────┘└─────────┘└─────────┘└─────────┘
"""
if theta is None:
theta = Parameter("ϴ")
Expand Down
26 changes: 13 additions & 13 deletions qiskit/circuit/library/templates/rzx/rzx_zz3.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@

def rzx_zz3(theta: ParameterValueType | None = None):
"""RZX-based template for CX - RZGate - CX.
.. code-block:: text
»
q_0: ──■─────────────■──────────────────────────────────────────────────────»
┌─┴─┐┌───────┐┌─┴─┐┌────────┐┌─────────┐┌─────────┐┌─────────┐┌───────┐»
q_1: ┤ X ├┤ RZ(ϴ) ├┤ X ├┤ RZ(-ϴ) ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├┤ RX(ϴ) ├»
└───┘└───────┘└───┘└────────┘└─────────┘└─────────┘└─────────┘└───────┘»
« ┌──────────┐
«q_0: ┤0 ├─────────────────────────────────
« │ RZX(-ϴ) │┌─────────┐┌─────────┐┌─────────┐
«q_1: ┤1 ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├
« └──────────┘└─────────┘└─────────┘└─────────┘
.. code-block:: text
»
q_0: ──■─────────────■──────────────────────────────────────────────────────»
┌─┴─┐┌───────┐┌─┴─┐┌────────┐┌─────────┐┌─────────┐┌─────────┐┌───────┐»
q_1: ┤ X ├┤ RZ(ϴ) ├┤ X ├┤ RZ(-ϴ) ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├┤ RX(ϴ) ├»
└───┘└───────┘└───┘└────────┘└─────────┘└─────────┘└─────────┘└───────┘»
« ┌──────────┐
«q_0: ┤0 ├─────────────────────────────────
« │ RZX(-ϴ) │┌─────────┐┌─────────┐┌─────────┐
«q_1: ┤1 ├┤ RZ(π/2) ├┤ RX(π/2) ├┤ RZ(π/2) ├
« └──────────┘└─────────┘└─────────┘└─────────┘
"""
if theta is None:
theta = Parameter("ϴ")
Expand Down

0 comments on commit baf3b93

Please sign in to comment.