Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MCRX, MCRY and MCRZ gates to the circuit library #12289

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
56ab3c3
feat: move mcr methods
king-p3nguin Apr 21, 2024
321acd7
fix: put x.py back
king-p3nguin Apr 21, 2024
6bd272c
fix: fix test_mcsu2_real_diagonal
king-p3nguin Apr 21, 2024
3cb3f8d
fix import order
king-p3nguin Apr 21, 2024
8093d98
fix import
king-p3nguin Apr 21, 2024
0ee5ecf
fix import order
king-p3nguin Apr 21, 2024
34a72a7
fix import order
king-p3nguin Apr 21, 2024
8d84f5f
fix import order
king-p3nguin Apr 21, 2024
344f646
fix: fix test_gate_definitions
king-p3nguin Apr 21, 2024
dc785f9
fix: fix test_controlled_gate
king-p3nguin Apr 21, 2024
3c68d40
fix: rm ctrl_state from ry ctrl
king-p3nguin Apr 21, 2024
90c4947
fix tests
king-p3nguin Apr 21, 2024
66750fb
rm C3SXdgGate
king-p3nguin Apr 21, 2024
222dcf7
chore: add deprecation warning
king-p3nguin Apr 21, 2024
b8b00ae
chore: rm print
king-p3nguin Apr 21, 2024
3568f0e
lint: fix lint
king-p3nguin Apr 21, 2024
e6e998d
feat: use crx/y/z for num_ctrl=1
king-p3nguin Apr 21, 2024
1be418b
fix: fix annotated
king-p3nguin Apr 22, 2024
fddf2cd
Merge branch 'main' into pr-add-mcrgates-to-library
king-p3nguin Apr 22, 2024
6df53d6
fix: fix annotated
king-p3nguin Apr 22, 2024
75d6eb3
Merge branch 'main' into pr-add-mcrgates-to-library
king-p3nguin Apr 22, 2024
dbb880a
fix: fix qpy tests
king-p3nguin Apr 23, 2024
5d549b3
Merge branch 'main' into pr-add-mcrgates-to-library
king-p3nguin May 9, 2024
9e34d41
feat: reduce number of classes
king-p3nguin May 9, 2024
6db6a79
Merge branch 'Qiskit:main' into pr-add-mcrgates-to-library
king-p3nguin May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
61 changes: 36 additions & 25 deletions qiskit/circuit/library/standard_gates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,55 @@
Standard gates
"""

from .h import HGate, CHGate
from .dcx import DCXGate
from .ecr import ECRGate
from .global_phase import GlobalPhaseGate
from .h import CHGate, HGate
from .i import IGate
from .p import PhaseGate, CPhaseGate, MCPhaseGate
from .iswap import iSwapGate
from .p import CPhaseGate, MCPhaseGate, PhaseGate
from .r import RGate
from .rx import RXGate, CRXGate
from .rx import CRXGate, MCRXGate, RXGate
from .rxx import RXXGate
from .ry import RYGate, CRYGate
from .ry import CRYGate, MCRYGate, RYGate
from .ryy import RYYGate
from .rz import RZGate, CRZGate
from .rzz import RZZGate
from .rz import CRZGate, MCRZGate, RZGate
from .rzx import RZXGate
from .rzz import RZZGate
from .s import CSdgGate, CSGate, SdgGate, SGate
from .swap import CSwapGate, SwapGate
from .sx import CSXGate, SXdgGate, SXGate
from .t import TdgGate, TGate
from .u import CUGate, UGate
from .u1 import CU1Gate, MCU1Gate, U1Gate
from .u2 import U2Gate
from .u3 import CU3Gate, U3Gate
from .x import (
C3SXGate,
C3XGate,
C4XGate,
CCXGate,
CXGate,
MCXGate,
MCXGrayCode,
MCXRecursive,
MCXVChain,
RC3XGate,
RCCXGate,
XGate,
)
from .xx_minus_yy import XXMinusYYGate
from .xx_plus_yy import XXPlusYYGate
from .ecr import ECRGate
from .s import SGate, SdgGate, CSGate, CSdgGate
from .swap import SwapGate, CSwapGate
from .iswap import iSwapGate
from .sx import SXGate, SXdgGate, CSXGate
from .dcx import DCXGate
from .t import TGate, TdgGate
from .u import UGate, CUGate
from .u1 import U1Gate, CU1Gate, MCU1Gate
from .u2 import U2Gate
from .u3 import U3Gate, CU3Gate
from .x import XGate, CXGate, CCXGate, C3XGate, C3SXGate, C4XGate, RCCXGate, RC3XGate
from .x import MCXGate, MCXGrayCode, MCXRecursive, MCXVChain
from .y import YGate, CYGate
from .z import ZGate, CZGate, CCZGate
from .global_phase import GlobalPhaseGate
from .multi_control_rotation_gates import mcrx, mcry, mcrz
from .y import CYGate, YGate
from .z import CCZGate, CZGate, ZGate


def get_standard_gate_name_mapping():
"""Return a dictionary mapping the name of standard gates and instructions to an object for
that name."""
from qiskit.circuit.parameter import Parameter
from qiskit.circuit.measure import Measure
from qiskit.circuit.delay import Delay
from qiskit.circuit.measure import Measure
from qiskit.circuit.parameter import Parameter
from qiskit.circuit.reset import Reset

# Standard gates library mapping, multicontrolled gates not included since they're
Expand Down