qiskit 2.0.2__cp39-abi3-macosx_11_0_arm64.whl → 2.1.0rc1__cp39-abi3-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qiskit/VERSION.txt +1 -1
- qiskit/__init__.py +19 -1
- qiskit/_accelerate.abi3.so +0 -0
- qiskit/circuit/__init__.py +13 -21
- qiskit/circuit/_add_control.py +57 -31
- qiskit/circuit/_classical_resource_map.py +4 -0
- qiskit/circuit/annotation.py +404 -0
- qiskit/circuit/classical/expr/__init__.py +1 -1
- qiskit/circuit/classical/expr/expr.py +104 -446
- qiskit/circuit/classical/expr/visitors.py +6 -0
- qiskit/circuit/classical/types/types.py +7 -130
- qiskit/circuit/controlflow/box.py +32 -7
- qiskit/circuit/delay.py +11 -9
- qiskit/circuit/library/arithmetic/adders/adder.py +5 -5
- qiskit/circuit/library/arithmetic/multipliers/multiplier.py +3 -3
- qiskit/circuit/library/arithmetic/piecewise_chebyshev.py +7 -3
- qiskit/circuit/library/arithmetic/piecewise_linear_pauli_rotations.py +23 -15
- qiskit/circuit/library/arithmetic/piecewise_polynomial_pauli_rotations.py +22 -14
- qiskit/circuit/library/arithmetic/quadratic_form.py +6 -0
- qiskit/circuit/library/arithmetic/weighted_adder.py +43 -24
- qiskit/circuit/library/basis_change/qft.py +2 -2
- qiskit/circuit/library/blueprintcircuit.py +6 -0
- qiskit/circuit/library/boolean_logic/inner_product.py +2 -2
- qiskit/circuit/library/boolean_logic/quantum_and.py +2 -2
- qiskit/circuit/library/boolean_logic/quantum_or.py +3 -3
- qiskit/circuit/library/boolean_logic/quantum_xor.py +2 -2
- qiskit/circuit/library/data_preparation/_z_feature_map.py +2 -2
- qiskit/circuit/library/data_preparation/_zz_feature_map.py +2 -2
- qiskit/circuit/library/data_preparation/pauli_feature_map.py +2 -2
- qiskit/circuit/library/fourier_checking.py +2 -2
- qiskit/circuit/library/generalized_gates/diagonal.py +5 -1
- qiskit/circuit/library/generalized_gates/gms.py +5 -1
- qiskit/circuit/library/generalized_gates/linear_function.py +2 -2
- qiskit/circuit/library/generalized_gates/permutation.py +5 -1
- qiskit/circuit/library/generalized_gates/uc.py +1 -1
- qiskit/circuit/library/generalized_gates/unitary.py +21 -2
- qiskit/circuit/library/graph_state.py +2 -2
- qiskit/circuit/library/grover_operator.py +2 -2
- qiskit/circuit/library/hidden_linear_function.py +2 -2
- qiskit/circuit/library/iqp.py +2 -2
- qiskit/circuit/library/n_local/efficient_su2.py +2 -2
- qiskit/circuit/library/n_local/evolved_operator_ansatz.py +1 -1
- qiskit/circuit/library/n_local/excitation_preserving.py +7 -9
- qiskit/circuit/library/n_local/n_local.py +4 -3
- qiskit/circuit/library/n_local/pauli_two_design.py +2 -2
- qiskit/circuit/library/n_local/real_amplitudes.py +2 -2
- qiskit/circuit/library/n_local/two_local.py +2 -2
- qiskit/circuit/library/overlap.py +2 -2
- qiskit/circuit/library/pauli_evolution.py +3 -2
- qiskit/circuit/library/phase_estimation.py +2 -2
- qiskit/circuit/library/standard_gates/dcx.py +11 -12
- qiskit/circuit/library/standard_gates/ecr.py +21 -24
- qiskit/circuit/library/standard_gates/equivalence_library.py +232 -96
- qiskit/circuit/library/standard_gates/global_phase.py +5 -6
- qiskit/circuit/library/standard_gates/h.py +22 -45
- qiskit/circuit/library/standard_gates/i.py +1 -1
- qiskit/circuit/library/standard_gates/iswap.py +13 -31
- qiskit/circuit/library/standard_gates/p.py +19 -26
- qiskit/circuit/library/standard_gates/r.py +11 -17
- qiskit/circuit/library/standard_gates/rx.py +21 -45
- qiskit/circuit/library/standard_gates/rxx.py +7 -22
- qiskit/circuit/library/standard_gates/ry.py +21 -39
- qiskit/circuit/library/standard_gates/ryy.py +13 -28
- qiskit/circuit/library/standard_gates/rz.py +18 -35
- qiskit/circuit/library/standard_gates/rzx.py +7 -22
- qiskit/circuit/library/standard_gates/rzz.py +7 -19
- qiskit/circuit/library/standard_gates/s.py +44 -39
- qiskit/circuit/library/standard_gates/swap.py +25 -38
- qiskit/circuit/library/standard_gates/sx.py +34 -41
- qiskit/circuit/library/standard_gates/t.py +18 -27
- qiskit/circuit/library/standard_gates/u.py +8 -24
- qiskit/circuit/library/standard_gates/u1.py +28 -52
- qiskit/circuit/library/standard_gates/u2.py +9 -9
- qiskit/circuit/library/standard_gates/u3.py +24 -40
- qiskit/circuit/library/standard_gates/x.py +190 -336
- qiskit/circuit/library/standard_gates/xx_minus_yy.py +12 -50
- qiskit/circuit/library/standard_gates/xx_plus_yy.py +13 -52
- qiskit/circuit/library/standard_gates/y.py +19 -23
- qiskit/circuit/library/standard_gates/z.py +31 -38
- qiskit/circuit/parameter.py +14 -5
- qiskit/circuit/parameterexpression.py +109 -75
- qiskit/circuit/quantumcircuit.py +168 -98
- qiskit/circuit/quantumcircuitdata.py +1 -0
- qiskit/circuit/random/__init__.py +37 -2
- qiskit/circuit/random/utils.py +445 -56
- qiskit/circuit/tools/pi_check.py +5 -13
- qiskit/compiler/transpiler.py +1 -1
- qiskit/converters/circuit_to_instruction.py +2 -2
- qiskit/dagcircuit/dagnode.py +8 -3
- qiskit/primitives/__init__.py +2 -2
- qiskit/primitives/base/base_estimator.py +2 -2
- qiskit/primitives/containers/data_bin.py +0 -3
- qiskit/primitives/containers/observables_array.py +192 -108
- qiskit/primitives/primitive_job.py +29 -10
- qiskit/providers/fake_provider/generic_backend_v2.py +2 -0
- qiskit/qasm3/__init__.py +106 -12
- qiskit/qasm3/ast.py +15 -1
- qiskit/qasm3/exporter.py +59 -36
- qiskit/qasm3/printer.py +12 -0
- qiskit/qpy/__init__.py +183 -7
- qiskit/qpy/binary_io/circuits.py +256 -24
- qiskit/qpy/binary_io/parse_sympy_repr.py +5 -0
- qiskit/qpy/binary_io/schedules.py +12 -32
- qiskit/qpy/binary_io/value.py +36 -18
- qiskit/qpy/common.py +11 -3
- qiskit/qpy/formats.py +17 -1
- qiskit/qpy/interface.py +52 -12
- qiskit/qpy/type_keys.py +7 -1
- qiskit/quantum_info/__init__.py +10 -0
- qiskit/quantum_info/operators/__init__.py +1 -0
- qiskit/quantum_info/operators/symplectic/__init__.py +1 -0
- qiskit/quantum_info/operators/symplectic/clifford_circuits.py +26 -0
- qiskit/quantum_info/operators/symplectic/pauli.py +2 -2
- qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +1 -1
- qiskit/result/sampled_expval.py +3 -1
- qiskit/synthesis/__init__.py +10 -0
- qiskit/synthesis/arithmetic/__init__.py +1 -1
- qiskit/synthesis/arithmetic/adders/__init__.py +1 -0
- qiskit/synthesis/arithmetic/adders/draper_qft_adder.py +6 -2
- qiskit/synthesis/arithmetic/adders/rv_ripple_carry_adder.py +156 -0
- qiskit/synthesis/discrete_basis/generate_basis_approximations.py +14 -126
- qiskit/synthesis/discrete_basis/solovay_kitaev.py +161 -121
- qiskit/synthesis/evolution/lie_trotter.py +10 -7
- qiskit/synthesis/evolution/product_formula.py +10 -7
- qiskit/synthesis/evolution/qdrift.py +10 -7
- qiskit/synthesis/evolution/suzuki_trotter.py +10 -7
- qiskit/synthesis/multi_controlled/__init__.py +4 -0
- qiskit/synthesis/multi_controlled/mcx_synthesis.py +402 -178
- qiskit/synthesis/multi_controlled/multi_control_rotation_gates.py +14 -15
- qiskit/synthesis/qft/qft_decompose_lnn.py +7 -25
- qiskit/synthesis/unitary/qsd.py +80 -9
- qiskit/transpiler/__init__.py +19 -8
- qiskit/transpiler/instruction_durations.py +2 -20
- qiskit/transpiler/passes/__init__.py +4 -2
- qiskit/transpiler/passes/layout/dense_layout.py +26 -6
- qiskit/transpiler/passes/layout/disjoint_utils.py +1 -166
- qiskit/transpiler/passes/layout/sabre_layout.py +22 -3
- qiskit/transpiler/passes/layout/sabre_pre_layout.py +1 -1
- qiskit/transpiler/passes/layout/vf2_layout.py +49 -13
- qiskit/transpiler/passes/layout/vf2_utils.py +13 -1
- qiskit/transpiler/passes/optimization/__init__.py +1 -1
- qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py +2 -1
- qiskit/transpiler/passes/optimization/optimize_clifford_t.py +68 -0
- qiskit/transpiler/passes/optimization/template_matching/template_substitution.py +3 -9
- qiskit/transpiler/passes/routing/sabre_swap.py +12 -2
- qiskit/transpiler/passes/routing/star_prerouting.py +106 -81
- qiskit/transpiler/passes/scheduling/__init__.py +1 -1
- qiskit/transpiler/passes/scheduling/alignments/check_durations.py +1 -1
- qiskit/transpiler/passes/scheduling/padding/__init__.py +1 -0
- qiskit/transpiler/passes/scheduling/padding/context_aware_dynamical_decoupling.py +876 -0
- qiskit/transpiler/passes/synthesis/__init__.py +1 -0
- qiskit/transpiler/passes/synthesis/clifford_unitary_synth_plugin.py +123 -0
- qiskit/transpiler/passes/synthesis/hls_plugins.py +472 -92
- qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py +27 -22
- qiskit/transpiler/passmanager_config.py +3 -0
- qiskit/transpiler/preset_passmanagers/builtin_plugins.py +149 -28
- qiskit/transpiler/preset_passmanagers/common.py +101 -0
- qiskit/transpiler/preset_passmanagers/generate_preset_pass_manager.py +6 -0
- qiskit/transpiler/preset_passmanagers/level3.py +2 -2
- qiskit/utils/optionals.py +6 -5
- qiskit/visualization/circuit/_utils.py +5 -3
- qiskit/visualization/circuit/latex.py +9 -2
- qiskit/visualization/circuit/matplotlib.py +26 -4
- qiskit/visualization/circuit/qcstyle.py +9 -157
- qiskit/visualization/dag/__init__.py +13 -0
- qiskit/visualization/dag/dagstyle.py +103 -0
- qiskit/visualization/dag/styles/__init__.py +13 -0
- qiskit/visualization/dag/styles/color.json +10 -0
- qiskit/visualization/dag/styles/plain.json +5 -0
- qiskit/visualization/dag_visualization.py +169 -98
- qiskit/visualization/style.py +223 -0
- {qiskit-2.0.2.dist-info → qiskit-2.1.0rc1.dist-info}/METADATA +14 -13
- {qiskit-2.0.2.dist-info → qiskit-2.1.0rc1.dist-info}/RECORD +177 -168
- {qiskit-2.0.2.dist-info → qiskit-2.1.0rc1.dist-info}/entry_points.txt +6 -0
- qiskit/synthesis/discrete_basis/commutator_decompose.py +0 -265
- qiskit/synthesis/discrete_basis/gate_sequence.py +0 -421
- {qiskit-2.0.2.dist-info → qiskit-2.1.0rc1.dist-info}/WHEEL +0 -0
- {qiskit-2.0.2.dist-info → qiskit-2.1.0rc1.dist-info}/licenses/LICENSE.txt +0 -0
- {qiskit-2.0.2.dist-info → qiskit-2.1.0rc1.dist-info}/top_level.txt +0 -0
@@ -115,6 +115,16 @@ def _cnot_rxx_decompose(plus_ry: bool = True, plus_rxx: bool = True):
|
|
115
115
|
|
116
116
|
# Import existing gate definitions
|
117
117
|
|
118
|
+
# HGate
|
119
|
+
#
|
120
|
+
# ┌───┐ ┌───────────┐
|
121
|
+
# q: ┤ H ├ ≡ q: ┤ U(0, 0,π) ├
|
122
|
+
# └───┘ └───────────┘
|
123
|
+
q = QuantumRegister(1, "q")
|
124
|
+
def_h = QuantumCircuit(q)
|
125
|
+
def_h.append(UGate(pi / 2, 0, pi), [q[0]], [])
|
126
|
+
_sel.add_equivalence(HGate(), def_h)
|
127
|
+
|
118
128
|
# HGate
|
119
129
|
#
|
120
130
|
# ┌───┐ ┌─────────┐
|
@@ -206,14 +216,14 @@ _sel.add_equivalence(CPhaseGate(theta), cphase_to_rzz)
|
|
206
216
|
|
207
217
|
# RGate
|
208
218
|
#
|
209
|
-
# ┌────────┐
|
210
|
-
# q: ┤ R(ϴ,φ) ├ ≡ q: ┤
|
211
|
-
# └────────┘
|
219
|
+
# ┌────────┐ ┌──────────────────────┐
|
220
|
+
# q: ┤ R(ϴ,φ) ├ ≡ q: ┤ U(ϴ,φ - π/2,π/2 - φ) ├
|
221
|
+
# └────────┘ └──────────────────────┘
|
212
222
|
q = QuantumRegister(1, "q")
|
213
223
|
theta = Parameter("theta")
|
214
224
|
phi = Parameter("phi")
|
215
225
|
def_r = QuantumCircuit(q)
|
216
|
-
def_r.append(
|
226
|
+
def_r.append(UGate(theta, phi - pi / 2, -phi + pi / 2), [q[0]])
|
217
227
|
_sel.add_equivalence(RGate(theta, phi), def_r)
|
218
228
|
|
219
229
|
# IGate
|
@@ -283,11 +293,11 @@ q = QuantumRegister(2, "q")
|
|
283
293
|
theta = Parameter("theta")
|
284
294
|
def_crx = QuantumCircuit(q)
|
285
295
|
for inst, qargs, cargs in [
|
286
|
-
(
|
296
|
+
(SGate(), [q[1]], []),
|
287
297
|
(CXGate(), [q[0], q[1]], []),
|
288
|
-
(
|
298
|
+
(UGate(-theta / 2, 0, 0), [q[1]], []),
|
289
299
|
(CXGate(), [q[0], q[1]], []),
|
290
|
-
(
|
300
|
+
(UGate(theta / 2, -pi / 2, 0), [q[1]], []),
|
291
301
|
]:
|
292
302
|
def_crx.append(inst, qargs, cargs)
|
293
303
|
_sel.add_equivalence(CRXGate(theta), def_crx)
|
@@ -524,6 +534,28 @@ for inst, qargs, cargs in [
|
|
524
534
|
def_ryy.append(inst, qargs, cargs)
|
525
535
|
_sel.add_equivalence(RYYGate(theta), def_ryy)
|
526
536
|
|
537
|
+
# RYYGate
|
538
|
+
#
|
539
|
+
# ┌─────────┐ ┌──────┐ ┌────┐
|
540
|
+
# q_0: ┤0 ├ q_0: ┤ √Xdg ├──■─────────────■──┤ √X ├
|
541
|
+
# │ Ryy(ϴ) │ ≡ ├──────┤┌─┴─┐┌───────┐┌─┴─┐├────┤
|
542
|
+
# q_1: ┤1 ├ q_1: ┤ √Xdg ├┤ X ├┤ Rz(ϴ) ├┤ X ├┤ √X ├
|
543
|
+
# └─────────┘ └──────┘└───┘└───────┘└───┘└────┘
|
544
|
+
q = QuantumRegister(2, "q")
|
545
|
+
theta = Parameter("theta")
|
546
|
+
def_ryy = QuantumCircuit(q)
|
547
|
+
for inst, qargs, cargs in [
|
548
|
+
(SXdgGate(), [q[0]], []),
|
549
|
+
(SXdgGate(), [q[1]], []),
|
550
|
+
(CXGate(), [q[0], q[1]], []),
|
551
|
+
(RZGate(theta), [q[1]], []),
|
552
|
+
(CXGate(), [q[0], q[1]], []),
|
553
|
+
(SXGate(), [q[0]], []),
|
554
|
+
(SXGate(), [q[1]], []),
|
555
|
+
]:
|
556
|
+
def_ryy.append(inst, qargs, cargs)
|
557
|
+
_sel.add_equivalence(RYYGate(theta), def_ryy)
|
558
|
+
|
527
559
|
# RYY to RZZ
|
528
560
|
q = QuantumRegister(2, "q")
|
529
561
|
theta = Parameter("theta")
|
@@ -554,13 +586,13 @@ _sel.add_equivalence(RYYGate(theta), ryy_to_rxx)
|
|
554
586
|
|
555
587
|
# RZGate
|
556
588
|
# global phase: -ϴ/2
|
557
|
-
# ┌───────┐
|
558
|
-
# q: ┤ Rz(ϴ) ├ ≡ q: ┤
|
559
|
-
# └───────┘
|
589
|
+
# ┌───────┐ ┌──────┐
|
590
|
+
# q: ┤ Rz(ϴ) ├ ≡ q: ┤ P(ϴ) ├
|
591
|
+
# └───────┘ └──────┘
|
560
592
|
q = QuantumRegister(1, "q")
|
561
593
|
theta = Parameter("theta")
|
562
594
|
def_rz = QuantumCircuit(q, global_phase=-theta / 2)
|
563
|
-
def_rz.append(
|
595
|
+
def_rz.append(PhaseGate(theta), [q[0]], [])
|
564
596
|
_sel.add_equivalence(RZGate(theta), def_rz)
|
565
597
|
|
566
598
|
# RZGate
|
@@ -789,51 +821,35 @@ _sel.add_equivalence(CXGate(), def_ecr_to_cx_cliff)
|
|
789
821
|
|
790
822
|
# SGate
|
791
823
|
#
|
792
|
-
# ┌───┐
|
793
|
-
# q: ┤ S ├ ≡ q: ┤
|
794
|
-
# └───┘
|
824
|
+
# ┌───┐ ┌────────┐
|
825
|
+
# q: ┤ S ├ ≡ q: ┤ P(π/2) ├
|
826
|
+
# └───┘ └────────┘
|
827
|
+
q = QuantumRegister(1, "q")
|
828
|
+
def_s = QuantumCircuit(q)
|
829
|
+
def_s.append(PhaseGate(pi / 2), [q[0]], [])
|
830
|
+
_sel.add_equivalence(SGate(), def_s)
|
831
|
+
|
832
|
+
# SGate
|
833
|
+
#
|
834
|
+
# ┌───┐┌───┐
|
835
|
+
# q: ┤ T ├┤ T ├
|
836
|
+
# └───┘└───┘
|
795
837
|
q = QuantumRegister(1, "q")
|
796
838
|
def_s = QuantumCircuit(q)
|
797
|
-
def_s.append(
|
839
|
+
def_s.append(TGate(), [q[0]], [])
|
840
|
+
def_s.append(TGate(), [q[0]], [])
|
798
841
|
_sel.add_equivalence(SGate(), def_s)
|
799
842
|
|
800
843
|
# SdgGate
|
801
844
|
#
|
802
|
-
# ┌─────┐
|
803
|
-
# q: ┤ Sdg ├ ≡ q: ┤
|
804
|
-
# └─────┘
|
845
|
+
# ┌─────┐ ┌─────────┐
|
846
|
+
# q: ┤ Sdg ├ ≡ q: ┤ P(-π/2) ├
|
847
|
+
# └─────┘ └─────────┘
|
805
848
|
q = QuantumRegister(1, "q")
|
806
849
|
def_sdg = QuantumCircuit(q)
|
807
|
-
def_sdg.append(
|
850
|
+
def_sdg.append(PhaseGate(-pi / 2), [q[0]], [])
|
808
851
|
_sel.add_equivalence(SdgGate(), def_sdg)
|
809
852
|
|
810
|
-
# CSGate
|
811
|
-
#
|
812
|
-
# q_0: ──■── q_0: ───────■────────
|
813
|
-
# ┌─┴─┐ ┌───┐┌─┴──┐┌───┐
|
814
|
-
# q_1: ┤ S ├ = q_1: ┤ H ├┤ Sx ├┤ H ├
|
815
|
-
# └───┘ └───┘└────┘└───┘
|
816
|
-
q = QuantumRegister(2, "q")
|
817
|
-
def_cs = QuantumCircuit(q)
|
818
|
-
def_cs.append(HGate(), [q[1]], [])
|
819
|
-
def_cs.append(CSXGate(), [q[0], q[1]], [])
|
820
|
-
def_cs.append(HGate(), [q[1]], [])
|
821
|
-
_sel.add_equivalence(CSGate(), def_cs)
|
822
|
-
|
823
|
-
# CSdgGate
|
824
|
-
#
|
825
|
-
# q_0: ───■─── q_0: ───────■────■────────
|
826
|
-
# ┌──┴──┐ ┌───┐┌─┴─┐┌─┴──┐┌───┐
|
827
|
-
# q_1: ┤ Sdg ├ = q_1: ┤ H ├┤ X ├┤ Sx ├┤ H ├
|
828
|
-
# └─────┘ └───┘└───┘└────┘└───┘
|
829
|
-
q = QuantumRegister(2, "q")
|
830
|
-
def_csdg = QuantumCircuit(q)
|
831
|
-
def_csdg.append(HGate(), [q[1]], [])
|
832
|
-
def_csdg.append(CXGate(), [q[0], q[1]], [])
|
833
|
-
def_csdg.append(CSXGate(), [q[0], q[1]], [])
|
834
|
-
def_csdg.append(HGate(), [q[1]], [])
|
835
|
-
_sel.add_equivalence(CSdgGate(), def_csdg)
|
836
|
-
|
837
853
|
# SdgGate
|
838
854
|
#
|
839
855
|
# ┌─────┐ ┌───┐┌───┐
|
@@ -877,6 +893,79 @@ for inst, qargs, cargs in [
|
|
877
893
|
def_sdg.append(inst, qargs, cargs)
|
878
894
|
_sel.add_equivalence(SdgGate(), def_sdg)
|
879
895
|
|
896
|
+
# SdgGate
|
897
|
+
#
|
898
|
+
# ┌─────┐┌─────┐
|
899
|
+
# q: ┤ Tdg ├┤ Tdg ├
|
900
|
+
# └─────┘└─────┘
|
901
|
+
q = QuantumRegister(1, "q")
|
902
|
+
def_sdg = QuantumCircuit(q)
|
903
|
+
for inst, qargs, cargs in [
|
904
|
+
(TdgGate(), [q[0]], []),
|
905
|
+
(TdgGate(), [q[0]], []),
|
906
|
+
]:
|
907
|
+
def_sdg.append(inst, qargs, cargs)
|
908
|
+
_sel.add_equivalence(SdgGate(), def_sdg)
|
909
|
+
|
910
|
+
# CSGate
|
911
|
+
#
|
912
|
+
# ┌───┐
|
913
|
+
# q_0: ──■── q_0: ┤ T ├──■───────────■──
|
914
|
+
# ┌─┴─┐ ├───┤┌─┴─┐┌─────┐┌─┴─┐
|
915
|
+
# q_1: ┤ S ├ = q_1: ┤ T ├┤ X ├┤ Tdg ├┤ X ├
|
916
|
+
# └───┘ └───┘└───┘└─────┘└───┘
|
917
|
+
q = QuantumRegister(2, "q")
|
918
|
+
def_cs = QuantumCircuit(q)
|
919
|
+
def_cs.append(TGate(), [q[0]], [])
|
920
|
+
def_cs.append(TGate(), [q[1]], [])
|
921
|
+
def_cs.append(CXGate(), [q[0], q[1]], [])
|
922
|
+
def_cs.append(TdgGate(), [q[1]], [])
|
923
|
+
def_cs.append(CXGate(), [q[0], q[1]], [])
|
924
|
+
_sel.add_equivalence(CSGate(), def_cs)
|
925
|
+
|
926
|
+
# CSGate
|
927
|
+
#
|
928
|
+
# q_0: ──■── q_0: ───────■────────
|
929
|
+
# ┌─┴─┐ ┌───┐┌─┴──┐┌───┐
|
930
|
+
# q_1: ┤ S ├ = q_1: ┤ H ├┤ Sx ├┤ H ├
|
931
|
+
# └───┘ └───┘└────┘└───┘
|
932
|
+
q = QuantumRegister(2, "q")
|
933
|
+
def_cs_csx = QuantumCircuit(q)
|
934
|
+
def_cs_csx.append(HGate(), [q[1]], [])
|
935
|
+
def_cs_csx.append(CSXGate(), [q[0], q[1]], [])
|
936
|
+
def_cs_csx.append(HGate(), [q[1]], [])
|
937
|
+
_sel.add_equivalence(CSGate(), def_cs_csx)
|
938
|
+
|
939
|
+
# CSdgGate
|
940
|
+
#
|
941
|
+
# ┌─────┐
|
942
|
+
# q_0: ───■─── q_0: ──■─────────■──┤ Tdg ├
|
943
|
+
# ┌──┴──┐ ┌─┴─┐┌───┐┌─┴─┐├─────┤
|
944
|
+
# q_1: ┤ Sdg ├ = q_1: ┤ X ├┤ T ├┤ X ├┤ Tdg ├
|
945
|
+
# └─────┘ └───┘└───┘└───┘└─────┘
|
946
|
+
q = QuantumRegister(2, "q")
|
947
|
+
def_csdg = QuantumCircuit(q)
|
948
|
+
def_csdg.append(CXGate(), [q[0], q[1]], [])
|
949
|
+
def_csdg.append(TGate(), [q[1]], [])
|
950
|
+
def_csdg.append(CXGate(), [q[0], q[1]], [])
|
951
|
+
def_csdg.append(TdgGate(), [q[0]], [])
|
952
|
+
def_csdg.append(TdgGate(), [q[1]], [])
|
953
|
+
_sel.add_equivalence(CSdgGate(), def_csdg)
|
954
|
+
|
955
|
+
# CSdgGate
|
956
|
+
#
|
957
|
+
# q_0: ───■─── q_0: ───────■────■────────
|
958
|
+
# ┌──┴──┐ ┌───┐┌─┴─┐┌─┴──┐┌───┐
|
959
|
+
# q_1: ┤ Sdg ├ = q_1: ┤ H ├┤ X ├┤ Sx ├┤ H ├
|
960
|
+
# └─────┘ └───┘└───┘└────┘└───┘
|
961
|
+
q = QuantumRegister(2, "q")
|
962
|
+
def_csdg_csx = QuantumCircuit(q)
|
963
|
+
def_csdg_csx.append(HGate(), [q[1]], [])
|
964
|
+
def_csdg_csx.append(CXGate(), [q[0], q[1]], [])
|
965
|
+
def_csdg_csx.append(CSXGate(), [q[0], q[1]], [])
|
966
|
+
def_csdg_csx.append(HGate(), [q[1]], [])
|
967
|
+
_sel.add_equivalence(CSdgGate(), def_csdg_csx)
|
968
|
+
|
880
969
|
# SwapGate
|
881
970
|
# ┌───┐
|
882
971
|
# q_0: ─X─ q_0: ──■──┤ X ├──■──
|
@@ -1033,15 +1122,15 @@ _sel.add_equivalence(SXdgGate(), sxdg_to_rx)
|
|
1033
1122
|
|
1034
1123
|
# CSXGate
|
1035
1124
|
#
|
1036
|
-
# q_0: ──■─── q_0:
|
1037
|
-
# ┌─┴──┐ ≡
|
1038
|
-
# q_1: ┤ Sx ├ q_1: ┤ H
|
1039
|
-
# └────┘
|
1125
|
+
# q_0: ──■─── q_0: ───────■───────
|
1126
|
+
# ┌─┴──┐ ≡ ┌───┐┌─┴─┐┌───┐
|
1127
|
+
# q_1: ┤ Sx ├ q_1: ┤ H ├┤ S ├┤ H ├
|
1128
|
+
# └────┘ └───┘└───┘└───┘
|
1040
1129
|
q = QuantumRegister(2, "q")
|
1041
1130
|
def_csx = QuantumCircuit(q)
|
1042
1131
|
for inst, qargs, cargs in [
|
1043
1132
|
(HGate(), [q[1]], []),
|
1044
|
-
(
|
1133
|
+
(CSGate(), [q[0], q[1]], []),
|
1045
1134
|
(HGate(), [q[1]], []),
|
1046
1135
|
]:
|
1047
1136
|
def_csx.append(inst, qargs, cargs)
|
@@ -1119,22 +1208,44 @@ _sel.add_equivalence(CSwapGate(), def_cswap)
|
|
1119
1208
|
|
1120
1209
|
# TGate
|
1121
1210
|
#
|
1122
|
-
# ┌───┐
|
1123
|
-
# q: ┤ T ├ ≡ q: ┤
|
1124
|
-
# └───┘
|
1211
|
+
# ┌───┐ ┌────────┐
|
1212
|
+
# q: ┤ T ├ ≡ q: ┤ P(π/4) ├
|
1213
|
+
# └───┘ └────────┘
|
1125
1214
|
q = QuantumRegister(1, "q")
|
1126
1215
|
def_t = QuantumCircuit(q)
|
1127
|
-
def_t.append(
|
1216
|
+
def_t.append(PhaseGate(pi / 4), [q[0]], [])
|
1217
|
+
_sel.add_equivalence(TGate(), def_t)
|
1218
|
+
|
1219
|
+
# TGate
|
1220
|
+
#
|
1221
|
+
# ┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐┌─────┐
|
1222
|
+
# q: ┤ Tdg ├┤ Tdg ├┤ Tdg ├┤ Tdg ├┤ Tdg ├┤ Tdg ├┤ Tdg ├
|
1223
|
+
# └─────┘└─────┘└─────┘└─────┘└─────┘└─────┘└─────┘
|
1224
|
+
q = QuantumRegister(1, "q")
|
1225
|
+
def_t = QuantumCircuit(q)
|
1226
|
+
for _ in range(7):
|
1227
|
+
def_t.append(TdgGate(), [q[0]], [])
|
1128
1228
|
_sel.add_equivalence(TGate(), def_t)
|
1129
1229
|
|
1130
1230
|
# TdgGate
|
1131
1231
|
#
|
1132
|
-
# ┌─────┐
|
1133
|
-
# q: ┤ Tdg ├ ≡ q: ┤
|
1134
|
-
# └─────┘
|
1232
|
+
# ┌─────┐ ┌─────────┐
|
1233
|
+
# q: ┤ Tdg ├ ≡ q: ┤ P(-π/4) ├
|
1234
|
+
# └─────┘ └─────────┘
|
1135
1235
|
q = QuantumRegister(1, "q")
|
1136
1236
|
def_tdg = QuantumCircuit(q)
|
1137
|
-
def_tdg.append(
|
1237
|
+
def_tdg.append(PhaseGate(-pi / 4), [q[0]], [])
|
1238
|
+
_sel.add_equivalence(TdgGate(), def_tdg)
|
1239
|
+
|
1240
|
+
# TdgGate
|
1241
|
+
#
|
1242
|
+
# ┌───┐┌───┐┌───┐┌───┐┌───┐┌───┐┌───┐
|
1243
|
+
# q: ┤ T ├┤ T ├┤ T ├┤ T ├┤ T ├┤ T ├┤ T ├
|
1244
|
+
# └───┘└───┘└───┘└───┘└───┘└───┘└───┘
|
1245
|
+
q = QuantumRegister(1, "q")
|
1246
|
+
def_tdg = QuantumCircuit(q)
|
1247
|
+
for _ in range(7):
|
1248
|
+
def_tdg.append(TGate(), [q[0]], [])
|
1138
1249
|
_sel.add_equivalence(TdgGate(), def_tdg)
|
1139
1250
|
|
1140
1251
|
# UGate
|
@@ -1226,34 +1337,34 @@ u1_to_rz.append(RZGate(theta), [q[0]], [])
|
|
1226
1337
|
_sel.add_equivalence(U1Gate(theta), u1_to_rz)
|
1227
1338
|
|
1228
1339
|
# CU1Gate
|
1229
|
-
#
|
1230
|
-
# q_0: ─■───── q_0: ┤
|
1231
|
-
# │U1(θ) ≡
|
1232
|
-
# q_1: ─■───── q_1:
|
1233
|
-
#
|
1340
|
+
# ┌────────┐
|
1341
|
+
# q_0: ─■───── q_0: ┤ P(θ/2) ├──■───────────────■────────────
|
1342
|
+
# │U1(θ) ≡ └────────┘┌─┴─┐┌─────────┐┌─┴─┐┌────────┐
|
1343
|
+
# q_1: ─■───── q_1: ──────────┤ X ├┤ P(-θ/2) ├┤ X ├┤ P(θ/2) ├
|
1344
|
+
# └───┘└─────────┘└───┘└────────┘
|
1234
1345
|
q = QuantumRegister(2, "q")
|
1235
1346
|
theta = Parameter("theta")
|
1236
1347
|
def_cu1 = QuantumCircuit(q)
|
1237
1348
|
for inst, qargs, cargs in [
|
1238
|
-
(
|
1349
|
+
(PhaseGate(theta / 2), [q[0]], []),
|
1239
1350
|
(CXGate(), [q[0], q[1]], []),
|
1240
|
-
(
|
1351
|
+
(PhaseGate(-theta / 2), [q[1]], []),
|
1241
1352
|
(CXGate(), [q[0], q[1]], []),
|
1242
|
-
(
|
1353
|
+
(PhaseGate(theta / 2), [q[1]], []),
|
1243
1354
|
]:
|
1244
1355
|
def_cu1.append(inst, qargs, cargs)
|
1245
1356
|
_sel.add_equivalence(CU1Gate(theta), def_cu1)
|
1246
1357
|
|
1247
1358
|
# U2Gate
|
1248
1359
|
#
|
1249
|
-
# ┌─────────┐
|
1250
|
-
# q: ┤ U2(ϕ,λ) ├ ≡ q: ┤
|
1251
|
-
# └─────────┘
|
1360
|
+
# ┌─────────┐ ┌────────────┐
|
1361
|
+
# q: ┤ U2(ϕ,λ) ├ ≡ q: ┤ U(π/2,ϕ,λ) ├
|
1362
|
+
# └─────────┘ └────────────┘
|
1252
1363
|
q = QuantumRegister(1, "q")
|
1253
1364
|
phi = Parameter("phi")
|
1254
1365
|
lam = Parameter("lam")
|
1255
1366
|
def_u2 = QuantumCircuit(q)
|
1256
|
-
def_u2.append(
|
1367
|
+
def_u2.append(UGate(pi / 2, phi, lam), [q[0]], [])
|
1257
1368
|
_sel.add_equivalence(U2Gate(phi, lam), def_u2)
|
1258
1369
|
|
1259
1370
|
# U2Gate
|
@@ -1301,28 +1412,28 @@ u3_to_u.u(theta, phi, lam, 0)
|
|
1301
1412
|
_sel.add_equivalence(U3Gate(theta, phi, lam), u3_to_u)
|
1302
1413
|
|
1303
1414
|
# CU3Gate
|
1304
|
-
#
|
1305
|
-
# q_0: ──────■────── q_0: ┤
|
1306
|
-
# ┌─────┴─────┐ ≡
|
1307
|
-
# q_1: ┤ U3(θ,ϕ,λ) ├ q_1: ┤
|
1308
|
-
# └───────────┘
|
1415
|
+
# ┌──────────────┐ »
|
1416
|
+
# q_0: ──────■────── q_0: ┤ P(λ/2 + ϕ/2) ├──■────────────────────────────■──»
|
1417
|
+
# ┌─────┴─────┐ ≡ ├──────────────┤┌─┴─┐┌──────────────────────┐┌─┴─┐»
|
1418
|
+
# q_1: ┤ U3(θ,ϕ,λ) ├ q_1: ┤ P(λ/2 - ϕ/2) ├┤ X ├┤ U(-θ/2,0,-λ/2 - ϕ/2) ├┤ X ├»
|
1419
|
+
# └───────────┘ └──────────────┘└───┘└──────────────────────┘└───┘»
|
1309
1420
|
# «
|
1310
|
-
# «q_0:
|
1311
|
-
# «
|
1312
|
-
# «q_1: ┤
|
1313
|
-
# «
|
1421
|
+
# «q_0: ──────────────
|
1422
|
+
# « ┌────────────┐
|
1423
|
+
# «q_1: ┤ P(θ/2,ϕ,0) ├
|
1424
|
+
# « └────────────┘
|
1314
1425
|
q = QuantumRegister(2, "q")
|
1315
1426
|
theta = Parameter("theta")
|
1316
1427
|
phi = Parameter("phi")
|
1317
1428
|
lam = Parameter("lam")
|
1318
1429
|
def_cu3 = QuantumCircuit(q)
|
1319
1430
|
for inst, qargs, cargs in [
|
1320
|
-
(
|
1321
|
-
(
|
1431
|
+
(PhaseGate((lam + phi) / 2), [q[0]], []),
|
1432
|
+
(PhaseGate((lam - phi) / 2), [q[1]], []),
|
1322
1433
|
(CXGate(), [q[0], q[1]], []),
|
1323
|
-
(
|
1434
|
+
(UGate(-theta / 2, 0, -(phi + lam) / 2), [q[1]], []),
|
1324
1435
|
(CXGate(), [q[0], q[1]], []),
|
1325
|
-
(
|
1436
|
+
(UGate(theta / 2, phi, 0), [q[1]], []),
|
1326
1437
|
]:
|
1327
1438
|
def_cu3.append(inst, qargs, cargs)
|
1328
1439
|
_sel.add_equivalence(CU3Gate(theta, phi, lam), def_cu3)
|
@@ -1337,12 +1448,12 @@ _sel.add_equivalence(CU3Gate(theta, phi, lam), cu3_to_cu)
|
|
1337
1448
|
|
1338
1449
|
# XGate
|
1339
1450
|
#
|
1340
|
-
# ┌───┐
|
1341
|
-
# q: ┤ X ├ ≡ q: ┤
|
1342
|
-
# └───┘
|
1451
|
+
# ┌───┐ ┌──────────┐
|
1452
|
+
# q: ┤ X ├ ≡ q: ┤ U(π,0,π) ├
|
1453
|
+
# └───┘ └──────────┘
|
1343
1454
|
q = QuantumRegister(1, "q")
|
1344
1455
|
def_x = QuantumCircuit(q)
|
1345
|
-
def_x.append(
|
1456
|
+
def_x.append(UGate(pi, 0, pi), [q[0]], [])
|
1346
1457
|
_sel.add_equivalence(XGate(), def_x)
|
1347
1458
|
|
1348
1459
|
# XGate
|
@@ -1543,12 +1654,12 @@ _sel.add_equivalence(CCXGate(), ccx_to_cx_csx)
|
|
1543
1654
|
|
1544
1655
|
# YGate
|
1545
1656
|
#
|
1546
|
-
# ┌───┐
|
1547
|
-
# q: ┤ Y ├ ≡ q: ┤
|
1548
|
-
# └───┘
|
1657
|
+
# ┌───┐ ┌──────────────┐
|
1658
|
+
# q: ┤ Y ├ ≡ q: ┤ U(π,π/2,π/2) ├
|
1659
|
+
# └───┘ └──────────────┘
|
1549
1660
|
q = QuantumRegister(1, "q")
|
1550
1661
|
def_y = QuantumCircuit(q)
|
1551
|
-
def_y.append(
|
1662
|
+
def_y.append(UGate(pi, pi / 2, pi / 2), [q[0]], [])
|
1552
1663
|
_sel.add_equivalence(YGate(), def_y)
|
1553
1664
|
|
1554
1665
|
# YGate
|
@@ -1617,12 +1728,12 @@ _sel.add_equivalence(CYGate(), def_cy)
|
|
1617
1728
|
|
1618
1729
|
# ZGate
|
1619
1730
|
#
|
1620
|
-
# ┌───┐
|
1621
|
-
# q: ┤ Z ├ ≡ q: ┤
|
1622
|
-
# └───┘
|
1731
|
+
# ┌───┐ ┌──────┐
|
1732
|
+
# q: ┤ Z ├ ≡ q: ┤ P(π) ├
|
1733
|
+
# └───┘ └──────┘
|
1623
1734
|
q = QuantumRegister(1, "q")
|
1624
1735
|
def_z = QuantumCircuit(q)
|
1625
|
-
def_z.append(
|
1736
|
+
def_z.append(PhaseGate(pi), [q[0]], [])
|
1626
1737
|
_sel.add_equivalence(ZGate(), def_z)
|
1627
1738
|
|
1628
1739
|
# ZGate
|
@@ -1764,6 +1875,31 @@ for instr, qargs, cargs in rules:
|
|
1764
1875
|
xxplusyy._append(instr, qargs, cargs)
|
1765
1876
|
_sel.add_equivalence(XXPlusYYGate(theta, beta), xxplusyy)
|
1766
1877
|
|
1878
|
+
# XXPlusYYGate
|
1879
|
+
# ┌───────────────┐
|
1880
|
+
# ┤0 ├
|
1881
|
+
# │ {XX+YY}(θ,β) │
|
1882
|
+
# ┤1 ├
|
1883
|
+
# └───────────────┘
|
1884
|
+
# ┌───────┐┌─────────────┐┌─────────────┐┌────────┐
|
1885
|
+
# ┤ Rz(β) ├┤0 ├┤0 ├┤ Rz(-β) ├
|
1886
|
+
# ≡ └───────┘│ Rxx(0.5*θ) ││ Ryy(0.5*θ) │└────────┘
|
1887
|
+
# ─────────┤1 ├┤1 ├──────────
|
1888
|
+
# └─────────────┘└─────────────┘
|
1889
|
+
q = QuantumRegister(2, "q")
|
1890
|
+
xxplusyy = QuantumCircuit(q)
|
1891
|
+
beta = Parameter("beta")
|
1892
|
+
theta = Parameter("theta")
|
1893
|
+
rules: list[tuple[Gate, list[Qubit], list[Clbit]]] = [
|
1894
|
+
(RZGate(beta), [q[0]], []),
|
1895
|
+
(RXXGate(0.5 * theta), [q[0], q[1]], []),
|
1896
|
+
(RYYGate(0.5 * theta), [q[0], q[1]], []),
|
1897
|
+
(RZGate(-beta), [q[0]], []),
|
1898
|
+
]
|
1899
|
+
for instr, qargs, cargs in rules:
|
1900
|
+
xxplusyy._append(instr, qargs, cargs)
|
1901
|
+
_sel.add_equivalence(XXPlusYYGate(theta, beta), xxplusyy)
|
1902
|
+
|
1767
1903
|
# XXMinusYYGate
|
1768
1904
|
# ┌───────────────┐
|
1769
1905
|
# ┤0 ├
|
@@ -35,7 +35,7 @@ class GlobalPhaseGate(Gate):
|
|
35
35
|
\end{pmatrix}
|
36
36
|
"""
|
37
37
|
|
38
|
-
_standard_gate = StandardGate.
|
38
|
+
_standard_gate = StandardGate.GlobalPhase
|
39
39
|
|
40
40
|
def __init__(self, phase: ParameterValueType, label: Optional[str] = None):
|
41
41
|
"""
|
@@ -47,12 +47,11 @@ class GlobalPhaseGate(Gate):
|
|
47
47
|
|
48
48
|
def _define(self):
|
49
49
|
# pylint: disable=cyclic-import
|
50
|
-
from qiskit.circuit import QuantumCircuit
|
50
|
+
from qiskit.circuit import QuantumCircuit
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
self.definition = qc
|
52
|
+
self.definition = QuantumCircuit._from_circuit_data(
|
53
|
+
StandardGate.GlobalPhase._get_definition(self.params), add_regs=True, name=self.name
|
54
|
+
)
|
56
55
|
|
57
56
|
def inverse(self, annotated: bool = False):
|
58
57
|
r"""Return inverse GlobalPhaseGate gate.
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
from __future__ import annotations
|
16
16
|
|
17
|
-
from math import sqrt
|
17
|
+
from math import sqrt
|
18
18
|
from typing import Optional, Union
|
19
19
|
import numpy
|
20
20
|
from qiskit.circuit.singleton import SingletonGate, SingletonControlledGate, stdlib_singleton_key
|
@@ -54,7 +54,7 @@ class HGate(SingletonGate):
|
|
54
54
|
\end{pmatrix}
|
55
55
|
"""
|
56
56
|
|
57
|
-
_standard_gate = StandardGate.
|
57
|
+
_standard_gate = StandardGate.H
|
58
58
|
|
59
59
|
def __init__(self, label: Optional[str] = None):
|
60
60
|
"""Create new H gate."""
|
@@ -63,20 +63,17 @@ class HGate(SingletonGate):
|
|
63
63
|
_singleton_lookup_key = stdlib_singleton_key()
|
64
64
|
|
65
65
|
def _define(self):
|
66
|
-
"""
|
67
|
-
gate h a { u2(0,pi) a; }
|
68
|
-
"""
|
66
|
+
"""Default definition"""
|
69
67
|
# pylint: disable=cyclic-import
|
70
|
-
from qiskit.circuit import QuantumCircuit
|
71
|
-
from .u2 import U2Gate
|
68
|
+
from qiskit.circuit import QuantumCircuit
|
72
69
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
for instr, qargs, cargs in rules:
|
77
|
-
qc._append(instr, qargs, cargs)
|
70
|
+
# ┌────────────┐
|
71
|
+
# q: ┤ U(π/2,0,π) ├
|
72
|
+
# └────────────┘
|
78
73
|
|
79
|
-
self.definition =
|
74
|
+
self.definition = QuantumCircuit._from_circuit_data(
|
75
|
+
StandardGate.H._get_definition(self.params), add_regs=True, name=self.name
|
76
|
+
)
|
80
77
|
|
81
78
|
def control(
|
82
79
|
self,
|
@@ -188,7 +185,7 @@ class CHGate(SingletonControlledGate):
|
|
188
185
|
\end{pmatrix}
|
189
186
|
"""
|
190
187
|
|
191
|
-
_standard_gate = StandardGate.
|
188
|
+
_standard_gate = StandardGate.CH
|
192
189
|
|
193
190
|
def __init__(
|
194
191
|
self,
|
@@ -212,38 +209,18 @@ class CHGate(SingletonControlledGate):
|
|
212
209
|
_singleton_lookup_key = stdlib_singleton_key(num_ctrl_qubits=1)
|
213
210
|
|
214
211
|
def _define(self):
|
215
|
-
"""
|
216
|
-
gate ch a,b {
|
217
|
-
s b;
|
218
|
-
h b;
|
219
|
-
t b;
|
220
|
-
cx a, b;
|
221
|
-
tdg b;
|
222
|
-
h b;
|
223
|
-
sdg b;
|
224
|
-
}
|
225
|
-
"""
|
212
|
+
"""Default definition"""
|
226
213
|
# pylint: disable=cyclic-import
|
227
|
-
from qiskit.circuit import QuantumCircuit
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
(
|
236
|
-
|
237
|
-
(TGate(), [q[1]], []),
|
238
|
-
(CXGate(), [q[0], q[1]], []),
|
239
|
-
(TdgGate(), [q[1]], []),
|
240
|
-
(HGate(), [q[1]], []),
|
241
|
-
(SdgGate(), [q[1]], []),
|
242
|
-
]
|
243
|
-
for instr, qargs, cargs in rules:
|
244
|
-
qc._append(instr, qargs, cargs)
|
245
|
-
|
246
|
-
self.definition = qc
|
214
|
+
from qiskit.circuit import QuantumCircuit
|
215
|
+
|
216
|
+
# q_0: ─────────────────■─────────────────────
|
217
|
+
# ┌───┐┌───┐┌───┐┌─┴─┐┌─────┐┌───┐┌─────┐
|
218
|
+
# q_1: ┤ S ├┤ H ├┤ T ├┤ X ├┤ Tdg ├┤ H ├┤ Sdg ├
|
219
|
+
# └───┘└───┘└───┘└───┘└─────┘└───┘└─────┘
|
220
|
+
|
221
|
+
self.definition = QuantumCircuit._from_circuit_data(
|
222
|
+
StandardGate.CH._get_definition(self.params), add_regs=True, name=self.name
|
223
|
+
)
|
247
224
|
|
248
225
|
def inverse(self, annotated: bool = False):
|
249
226
|
"""Return inverted CH gate (itself)."""
|