From 68a1eca8014695ca20026334076368dc890f1f51 Mon Sep 17 00:00:00 2001 From: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> Date: Thu, 17 Oct 2024 05:51:26 -0400 Subject: [PATCH] Replace parsed-literal with code-block (#13257) * Replace parsed-literal with code-block * Manually set some code blocks to Python * Revert "Manually set some code blocks to Python" This reverts commit 7c5e4a1886ca2791ec864bdcb7a57a95f4dc5562. * Fix missing blank lines * Fix missing indentation and template functions not buildilng docs * Fix rzx files * Add missing whitespace to base_scheduler.py * Skip Pylint * Update qiskit/circuit/library/templates/rzx/rzx_zz2.py --------- Co-authored-by: Jake Lishman --- qiskit/circuit/library/__init__.py | 4 +- .../adders/cdkm_ripple_carry_adder.py | 4 +- .../arithmetic/adders/draper_qft_adder.py | 2 +- .../adders/vbe_ripple_carry_adder.py | 2 +- .../arithmetic/linear_pauli_rotations.py | 2 +- .../multipliers/hrs_cumulative_multiplier.py | 2 +- .../multipliers/rg_qft_multiplier.py | 2 +- .../library/arithmetic/weighted_adder.py | 2 +- .../library/boolean_logic/inner_product.py | 2 +- .../data_preparation/_z_feature_map.py | 2 +- .../data_preparation/_zz_feature_map.py | 11 ++--- .../data_preparation/pauli_feature_map.py | 8 ++-- .../library/generalized_gates/diagonal.py | 2 +- .../circuit/library/generalized_gates/gms.py | 2 +- .../circuit/library/generalized_gates/gr.py | 8 ++-- .../generalized_gates/linear_function.py | 2 +- .../circuit/library/generalized_gates/mcmt.py | 2 +- .../circuit/library/generalized_gates/rv.py | 2 +- qiskit/circuit/library/grover_operator.py | 2 +- .../circuit/library/n_local/efficient_su2.py | 2 +- qiskit/circuit/library/n_local/n_local.py | 2 +- .../library/n_local/pauli_two_design.py | 2 +- .../library/n_local/real_amplitudes.py | 3 +- qiskit/circuit/library/standard_gates/dcx.py | 3 +- qiskit/circuit/library/standard_gates/ecr.py | 4 +- qiskit/circuit/library/standard_gates/h.py | 7 ++-- qiskit/circuit/library/standard_gates/i.py | 3 +- .../circuit/library/standard_gates/iswap.py | 4 +- qiskit/circuit/library/standard_gates/p.py | 6 +-- qiskit/circuit/library/standard_gates/r.py | 2 +- qiskit/circuit/library/standard_gates/rx.py | 7 ++-- qiskit/circuit/library/standard_gates/rxx.py | 2 +- qiskit/circuit/library/standard_gates/ry.py | 7 ++-- qiskit/circuit/library/standard_gates/ryy.py | 2 +- qiskit/circuit/library/standard_gates/rz.py | 7 ++-- qiskit/circuit/library/standard_gates/rzx.py | 4 +- qiskit/circuit/library/standard_gates/rzz.py | 2 +- qiskit/circuit/library/standard_gates/s.py | 8 ++-- qiskit/circuit/library/standard_gates/swap.py | 6 +-- qiskit/circuit/library/standard_gates/sx.py | 7 ++-- qiskit/circuit/library/standard_gates/t.py | 4 +- qiskit/circuit/library/standard_gates/u.py | 7 ++-- qiskit/circuit/library/standard_gates/u1.py | 6 +-- qiskit/circuit/library/standard_gates/u2.py | 2 +- qiskit/circuit/library/standard_gates/u3.py | 7 ++-- qiskit/circuit/library/standard_gates/x.py | 12 +++--- .../library/standard_gates/xx_minus_yy.py | 4 +- .../library/standard_gates/xx_plus_yy.py | 4 +- qiskit/circuit/library/standard_gates/y.py | 7 ++-- qiskit/circuit/library/standard_gates/z.py | 6 +-- .../templates/clifford/clifford_2_1.py | 17 ++++---- .../templates/clifford/clifford_2_2.py | 19 +++++---- .../templates/clifford/clifford_2_3.py | 16 +++---- .../templates/clifford/clifford_2_4.py | 17 ++++---- .../templates/clifford/clifford_3_1.py | 17 ++++---- .../templates/clifford/clifford_4_1.py | 19 +++++---- .../templates/clifford/clifford_4_2.py | 19 +++++---- .../templates/clifford/clifford_4_3.py | 19 +++++---- .../templates/clifford/clifford_4_4.py | 19 +++++---- .../templates/clifford/clifford_5_1.py | 19 +++++---- .../templates/clifford/clifford_6_1.py | 19 +++++---- .../templates/clifford/clifford_6_2.py | 19 +++++---- .../templates/clifford/clifford_6_3.py | 19 +++++---- .../templates/clifford/clifford_6_4.py | 17 ++++---- .../templates/clifford/clifford_6_5.py | 19 +++++---- .../templates/clifford/clifford_8_1.py | 19 +++++---- .../templates/clifford/clifford_8_2.py | 19 +++++---- .../templates/clifford/clifford_8_3.py | 19 +++++---- .../templates/nct/template_nct_2a_1.py | 16 +++---- .../templates/nct/template_nct_2a_2.py | 18 ++++---- .../templates/nct/template_nct_2a_3.py | 22 +++++----- .../templates/nct/template_nct_4a_1.py | 30 ++++++------- .../templates/nct/template_nct_4a_2.py | 26 ++++++------ .../templates/nct/template_nct_4a_3.py | 22 +++++----- .../templates/nct/template_nct_4b_1.py | 26 ++++++------ .../templates/nct/template_nct_4b_2.py | 22 +++++----- .../templates/nct/template_nct_5a_1.py | 22 +++++----- .../templates/nct/template_nct_5a_2.py | 22 +++++----- .../templates/nct/template_nct_5a_3.py | 22 +++++----- .../templates/nct/template_nct_5a_4.py | 20 +++++---- .../templates/nct/template_nct_6a_1.py | 20 +++++---- .../templates/nct/template_nct_6a_2.py | 22 +++++----- .../templates/nct/template_nct_6a_3.py | 22 +++++----- .../templates/nct/template_nct_6a_4.py | 22 +++++----- .../templates/nct/template_nct_6b_1.py | 22 +++++----- .../templates/nct/template_nct_6b_2.py | 22 +++++----- .../templates/nct/template_nct_6c_1.py | 22 +++++----- .../templates/nct/template_nct_7a_1.py | 24 ++++++----- .../templates/nct/template_nct_7b_1.py | 24 ++++++----- .../templates/nct/template_nct_7c_1.py | 24 ++++++----- .../templates/nct/template_nct_7d_1.py | 24 ++++++----- .../templates/nct/template_nct_7e_1.py | 24 ++++++----- .../templates/nct/template_nct_9a_1.py | 24 ++++++----- .../templates/nct/template_nct_9c_1.py | 20 +++++---- .../templates/nct/template_nct_9c_10.py | 22 +++++----- .../templates/nct/template_nct_9c_11.py | 22 +++++----- .../templates/nct/template_nct_9c_12.py | 22 +++++----- .../templates/nct/template_nct_9c_2.py | 22 +++++----- .../templates/nct/template_nct_9c_3.py | 22 +++++----- .../templates/nct/template_nct_9c_4.py | 22 +++++----- .../templates/nct/template_nct_9c_5.py | 22 +++++----- .../templates/nct/template_nct_9c_6.py | 22 +++++----- .../templates/nct/template_nct_9c_7.py | 22 +++++----- .../templates/nct/template_nct_9c_8.py | 22 +++++----- .../templates/nct/template_nct_9c_9.py | 22 +++++----- .../templates/nct/template_nct_9d_1.py | 20 +++++---- .../templates/nct/template_nct_9d_10.py | 22 +++++----- .../templates/nct/template_nct_9d_2.py | 22 +++++----- .../templates/nct/template_nct_9d_3.py | 22 +++++----- .../templates/nct/template_nct_9d_4.py | 22 +++++----- .../templates/nct/template_nct_9d_5.py | 22 +++++----- .../templates/nct/template_nct_9d_6.py | 22 +++++----- .../templates/nct/template_nct_9d_7.py | 22 +++++----- .../templates/nct/template_nct_9d_8.py | 22 +++++----- .../templates/nct/template_nct_9d_9.py | 22 +++++----- .../circuit/library/templates/rzx/rzx_cy.py | 21 +++++----- .../circuit/library/templates/rzx/rzx_xz.py | 31 +++++++------- .../circuit/library/templates/rzx/rzx_yz.py | 22 +++++----- .../circuit/library/templates/rzx/rzx_zz1.py | 42 ++++++++++--------- .../circuit/library/templates/rzx/rzx_zz2.py | 31 +++++++------- .../circuit/library/templates/rzx/rzx_zz3.py | 32 +++++++------- qiskit/circuit/quantumcircuit.py | 32 +++++++------- qiskit/dagcircuit/dagdependency.py | 2 +- qiskit/dagcircuit/dagdependency_v2.py | 2 +- qiskit/passmanager/__init__.py | 4 +- qiskit/pulse/builder.py | 22 +++++----- qiskit/pulse/schedule.py | 8 ++-- qiskit/pulse/transforms/alignments.py | 4 +- .../operators/dihedral/dihedral.py | 2 +- .../operators/symplectic/clifford.py | 2 +- .../operators/symplectic/pauli_list.py | 8 ++-- .../operators/symplectic/sparse_pauli_op.py | 4 +- qiskit/quantum_info/states/densitymatrix.py | 10 ++--- qiskit/quantum_info/states/stabilizerstate.py | 2 +- qiskit/quantum_info/states/statevector.py | 10 ++--- .../clifford/clifford_decompose_layers.py | 3 +- qiskit/synthesis/evolution/product_formula.py | 4 +- .../stabilizer/stabilizer_decompose.py | 3 +- qiskit/synthesis/unitary/qsd.py | 3 +- qiskit/transpiler/__init__.py | 28 +++++++------ .../echo_rzx_weyl_decomposition.py | 4 +- .../template_substitution.py | 4 +- .../commuting_2q_gate_router.py | 2 +- .../swap_strategy.py | 2 +- .../scheduling/alignments/align_measures.py | 4 +- .../scheduling/alignments/reschedule.py | 4 +- .../passes/scheduling/base_scheduler.py | 22 +++++----- .../passes/scheduling/padding/pad_delay.py | 2 +- .../synthesis/solovay_kitaev_synthesis.py | 6 +-- .../passes/utils/merge_adjacent_barriers.py | 3 +- .../0.13/dag_compose-3847f210c6624f88.yaml | 2 +- .../0.14/0.14.0-release-19557dcd9d5af6e3.yaml | 2 +- ...anspiling_basis_none-b2f1abdb3c080eca.yaml | 9 ++-- ...-parameterexpression-5f140ba243ba126a.yaml | 2 +- ...pression_phaseoracle-1802be3016c83fa8.yaml | 6 +-- ...rap-library-circuits-9b7f7398f3fce8a8.yaml | 4 +- ...emplate-substitution-a1379cdbfcc10b5c.yaml | 2 +- ...ion-alignment-passes-ef0f20d4f89f95f3.yaml | 2 +- ...rd_layered_synthesis-1a6b1038458ae8c3.yaml | 3 +- ...e_order_restrictions-ffc0cfeacd7b8d4b.yaml | 2 +- .../notes/0.45/fix_9363-445db8fde1244e57.yaml | 2 +- test/python/compiler/test_transpiler.py | 4 +- test/python/dagcircuit/test_dagcircuit.py | 2 +- test/python/transpiler/test_sabre_swap.py | 2 +- .../transpiler/test_swap_strategy_router.py | 15 +++---- 165 files changed, 1089 insertions(+), 942 deletions(-) diff --git a/qiskit/circuit/library/__init__.py b/qiskit/circuit/library/__init__.py index a4203f63b738..73588a421ac7 100644 --- a/qiskit/circuit/library/__init__.py +++ b/qiskit/circuit/library/__init__.py @@ -56,7 +56,7 @@ print(gate.power(1/2).to_matrix()) # √X gate print(gate.control(1).to_matrix()) # CX (controlled X) gate -.. parsed-literal:: +.. code-block:: text [[0.+0.j 1.+0.j] [1.+0.j 0.+0.j]] @@ -160,7 +160,7 @@ diagonal = Diagonal([1, 1, 1, 1]) print(diagonal.num_qubits) -.. parsed-literal:: +.. code-block:: text 1 2 diff --git a/qiskit/circuit/library/arithmetic/adders/cdkm_ripple_carry_adder.py b/qiskit/circuit/library/arithmetic/adders/cdkm_ripple_carry_adder.py index a489685bc426..3e18791e1cb6 100644 --- a/qiskit/circuit/library/arithmetic/adders/cdkm_ripple_carry_adder.py +++ b/qiskit/circuit/library/arithmetic/adders/cdkm_ripple_carry_adder.py @@ -23,7 +23,7 @@ class CDKMRippleCarryAdder(Adder): As an example, a ripple-carry adder circuit that performs addition on two 3-qubit sized registers with a carry-in bit (``kind="full"``) is as follows: - .. parsed-literal:: + .. code-block:: text ┌──────┐ ┌──────┐ cin_0: ┤2 ├─────────────────────────────────────┤2 ├ @@ -54,7 +54,7 @@ class CDKMRippleCarryAdder(Adder): The circuit diagram for the fixed-point adder (``kind="fixed"``) on 3-qubit sized inputs is - .. parsed-literal:: + .. code-block:: text ┌──────┐┌──────┐ ┌──────┐┌──────┐ a_0: ┤0 ├┤2 ├────────────────┤2 ├┤0 ├ diff --git a/qiskit/circuit/library/arithmetic/adders/draper_qft_adder.py b/qiskit/circuit/library/arithmetic/adders/draper_qft_adder.py index 80671866bab1..c213b85c422f 100644 --- a/qiskit/circuit/library/arithmetic/adders/draper_qft_adder.py +++ b/qiskit/circuit/library/arithmetic/adders/draper_qft_adder.py @@ -31,7 +31,7 @@ class DraperQFTAdder(Adder): As an example, a non-fixed_point QFT adder circuit that performs addition on two 2-qubit sized registers is as follows: - .. parsed-literal:: + .. code-block:: text a_0: ─────────■──────■────────────────────────■──────────────── │ │ │ diff --git a/qiskit/circuit/library/arithmetic/adders/vbe_ripple_carry_adder.py b/qiskit/circuit/library/arithmetic/adders/vbe_ripple_carry_adder.py index 9c1eeb5b1b33..0279738cb94f 100644 --- a/qiskit/circuit/library/arithmetic/adders/vbe_ripple_carry_adder.py +++ b/qiskit/circuit/library/arithmetic/adders/vbe_ripple_carry_adder.py @@ -26,7 +26,7 @@ class VBERippleCarryAdder(Adder): As an example, a classical adder circuit that performs full addition (i.e. including a carry-in bit) on two 2-qubit sized registers is as follows: - .. parsed-literal:: + .. code-block:: text ┌────────┐ ┌───────────┐┌──────┐ cin_0: ┤0 ├───────────────────────┤0 ├┤0 ├ diff --git a/qiskit/circuit/library/arithmetic/linear_pauli_rotations.py b/qiskit/circuit/library/arithmetic/linear_pauli_rotations.py index bc80ef778616..6eea1b92233a 100644 --- a/qiskit/circuit/library/arithmetic/linear_pauli_rotations.py +++ b/qiskit/circuit/library/arithmetic/linear_pauli_rotations.py @@ -27,7 +27,7 @@ class LinearPauliRotations(FunctionalPauliRotations): For a register of state qubits :math:`|x\rangle`, a target qubit :math:`|0\rangle` and the basis ``'Y'`` this circuit acts as: - .. parsed-literal:: + .. code-block:: text q_0: ─────────────────────────■───────── ... ────────────────────── │ diff --git a/qiskit/circuit/library/arithmetic/multipliers/hrs_cumulative_multiplier.py b/qiskit/circuit/library/arithmetic/multipliers/hrs_cumulative_multiplier.py index 220f1b48f770..ba9ed8c89cdc 100644 --- a/qiskit/circuit/library/arithmetic/multipliers/hrs_cumulative_multiplier.py +++ b/qiskit/circuit/library/arithmetic/multipliers/hrs_cumulative_multiplier.py @@ -26,7 +26,7 @@ class HRSCumulativeMultiplier(Multiplier): the default adder is as follows (where ``Adder`` denotes the ``CDKMRippleCarryAdder``): - .. parsed-literal:: + .. code-block:: text a_0: ────■───────────────────────── │ diff --git a/qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py b/qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py index 0a6c08d9d784..4bd2799733f2 100644 --- a/qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py +++ b/qiskit/circuit/library/arithmetic/multipliers/rg_qft_multiplier.py @@ -33,7 +33,7 @@ class RGQFTMultiplier(Multiplier): As an example, a circuit that performs a modular QFT multiplication on two 2-qubit sized input registers with an output register of 2 qubits, is as follows: - .. parsed-literal:: + .. code-block:: text a_0: ────────────────────────────────────────■───────■──────■──────■──────────────── │ │ │ │ diff --git a/qiskit/circuit/library/arithmetic/weighted_adder.py b/qiskit/circuit/library/arithmetic/weighted_adder.py index 92c7cae7f9bc..83414684bf77 100644 --- a/qiskit/circuit/library/arithmetic/weighted_adder.py +++ b/qiskit/circuit/library/arithmetic/weighted_adder.py @@ -45,7 +45,7 @@ class WeightedAdder(BlueprintCircuit): For an example where the state of 4 qubits is added into a sum register, the circuit can be schematically drawn as - .. parsed-literal:: + .. code-block:: text ┌────────┐ state_0: ┤0 ├ | state_0 * weights[0] diff --git a/qiskit/circuit/library/boolean_logic/inner_product.py b/qiskit/circuit/library/boolean_logic/inner_product.py index 6efbc8a02913..dcaced069119 100644 --- a/qiskit/circuit/library/boolean_logic/inner_product.py +++ b/qiskit/circuit/library/boolean_logic/inner_product.py @@ -32,7 +32,7 @@ class InnerProduct(QuantumCircuit): where the inner product of the top and bottom registers is 1. Otherwise it keeps the input intact. - .. parsed-literal:: + .. code-block:: text q0_0: ─■────────── diff --git a/qiskit/circuit/library/data_preparation/_z_feature_map.py b/qiskit/circuit/library/data_preparation/_z_feature_map.py index 451776067114..22303f087684 100644 --- a/qiskit/circuit/library/data_preparation/_z_feature_map.py +++ b/qiskit/circuit/library/data_preparation/_z_feature_map.py @@ -24,7 +24,7 @@ class ZFeatureMap(PauliFeatureMap): On 3 qubits and with 2 repetitions the circuit is represented by: - .. parsed-literal:: + .. code-block:: text ┌───┐┌─────────────┐┌───┐┌─────────────┐ ┤ H ├┤ P(2.0*x[0]) ├┤ H ├┤ P(2.0*x[0]) ├ diff --git a/qiskit/circuit/library/data_preparation/_zz_feature_map.py b/qiskit/circuit/library/data_preparation/_zz_feature_map.py index a634f166c721..2414efc5fee3 100644 --- a/qiskit/circuit/library/data_preparation/_zz_feature_map.py +++ b/qiskit/circuit/library/data_preparation/_zz_feature_map.py @@ -23,7 +23,7 @@ class ZZFeatureMap(PauliFeatureMap): For 3 qubits and 1 repetition and linear entanglement the circuit is represented by: - .. parsed-literal:: + .. code-block:: text ┌───┐┌────────────────┐ ┤ H ├┤ P(2.0*φ(x[0])) ├──■───────────────────────────■─────────────────────────────────── @@ -44,7 +44,8 @@ class ZZFeatureMap(PauliFeatureMap): prep = ZZFeatureMap(2, reps=1) print(prep.decompose()) - .. parsed-literal:: + .. code-block:: text + ┌───┐┌─────────────┐ q_0: ┤ H ├┤ P(2.0*x[0]) ├──■──────────────────────────────────────■── ├───┤├─────────────┤┌─┴─┐┌────────────────────────────────┐┌─┴─┐ @@ -57,7 +58,7 @@ class ZZFeatureMap(PauliFeatureMap): classifier = ZZFeatureMap(3).compose(EfficientSU2(3)) classifier.num_parameters - .. parsed-literal:: + .. code-block:: text 27 @@ -65,7 +66,7 @@ class ZZFeatureMap(PauliFeatureMap): classifier.parameters # 'x' for the data preparation, 'θ' for the SU2 parameters - .. parsed-literal:: + .. code-block:: text ParameterView([ ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), @@ -88,7 +89,7 @@ class ZZFeatureMap(PauliFeatureMap): classifier.count_ops() - .. parsed-literal:: + .. code-block:: text OrderedDict([('ZZFeatureMap', 1), ('EfficientSU2', 1)]) diff --git a/qiskit/circuit/library/data_preparation/pauli_feature_map.py b/qiskit/circuit/library/data_preparation/pauli_feature_map.py index 75107ee5546f..8c04f37ca9b0 100644 --- a/qiskit/circuit/library/data_preparation/pauli_feature_map.py +++ b/qiskit/circuit/library/data_preparation/pauli_feature_map.py @@ -86,7 +86,7 @@ def pauli_feature_map( which will produce blocks of the form - .. parsed-literal:: + .. code-block:: text ┌───┐┌─────────────┐┌──────────┐ ┌───────────┐ ┤ H ├┤ P(2.0*x[0]) ├┤ RX(pi/2) ├──■──────────────────────────────────────■──┤ RX(-pi/2) ├ @@ -183,7 +183,7 @@ def z_feature_map( On 3 qubits and with 2 repetitions the circuit is represented by: - .. parsed-literal:: + .. code-block:: text ┌───┐┌─────────────┐┌───┐┌─────────────┐ ┤ H ├┤ P(2.0*x[0]) ├┤ H ├┤ P(2.0*x[0]) ├ @@ -262,7 +262,7 @@ def zz_feature_map( For 3 qubits and 1 repetition and linear entanglement the circuit is represented by: - .. parsed-literal:: + .. code-block:: text ┌───┐┌────────────────┐ ┤ H ├┤ P(2.0*φ(x[0])) ├──■───────────────────────────■─────────────────────────────────── @@ -353,7 +353,7 @@ class PauliFeatureMap(NLocal): which will produce blocks of the form - .. parsed-literal:: + .. code-block:: text ┌───┐┌─────────────┐┌──────────┐ ┌───────────┐ ┤ H ├┤ P(2.0*x[0]) ├┤ RX(pi/2) ├──■──────────────────────────────────────■──┤ RX(-pi/2) ├ diff --git a/qiskit/circuit/library/generalized_gates/diagonal.py b/qiskit/circuit/library/generalized_gates/diagonal.py index 5ea4bfa0e813..ba85157c4439 100644 --- a/qiskit/circuit/library/generalized_gates/diagonal.py +++ b/qiskit/circuit/library/generalized_gates/diagonal.py @@ -34,7 +34,7 @@ class Diagonal(QuantumCircuit): Circuit symbol: - .. parsed-literal:: + .. code-block:: text ┌───────────┐ q_0: ┤0 ├ diff --git a/qiskit/circuit/library/generalized_gates/gms.py b/qiskit/circuit/library/generalized_gates/gms.py index fccb332d438c..964a99d18b2b 100644 --- a/qiskit/circuit/library/generalized_gates/gms.py +++ b/qiskit/circuit/library/generalized_gates/gms.py @@ -29,7 +29,7 @@ class GMS(QuantumCircuit): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────────┐ q_0: ┤0 ├ diff --git a/qiskit/circuit/library/generalized_gates/gr.py b/qiskit/circuit/library/generalized_gates/gr.py index e79851db4779..3ababe25f3dd 100644 --- a/qiskit/circuit/library/generalized_gates/gr.py +++ b/qiskit/circuit/library/generalized_gates/gr.py @@ -21,7 +21,7 @@ class GR(QuantumCircuit): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌──────────┐ q_0: ┤0 ├ @@ -75,7 +75,7 @@ class GRX(GR): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌──────────┐ q_0: ┤0 ├ @@ -123,7 +123,7 @@ class GRY(GR): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌──────────┐ q_0: ┤0 ├ @@ -171,7 +171,7 @@ class GRZ(QuantumCircuit): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌──────────┐ q_0: ┤0 ├ diff --git a/qiskit/circuit/library/generalized_gates/linear_function.py b/qiskit/circuit/library/generalized_gates/linear_function.py index 519a306c357e..73b86bffb03a 100644 --- a/qiskit/circuit/library/generalized_gates/linear_function.py +++ b/qiskit/circuit/library/generalized_gates/linear_function.py @@ -37,7 +37,7 @@ class LinearFunction(Gate): **Example:** the circuit - .. parsed-literal:: + .. code-block:: text q_0: ──■── ┌─┴─┐ diff --git a/qiskit/circuit/library/generalized_gates/mcmt.py b/qiskit/circuit/library/generalized_gates/mcmt.py index aa70ef6015d3..496b391d38e8 100644 --- a/qiskit/circuit/library/generalized_gates/mcmt.py +++ b/qiskit/circuit/library/generalized_gates/mcmt.py @@ -29,7 +29,7 @@ class MCMT(QuantumCircuit): For example, the H gate controlled on 3 qubits and acting on 2 target qubit is represented as: - .. parsed-literal:: + .. code-block:: text ───■──── │ diff --git a/qiskit/circuit/library/generalized_gates/rv.py b/qiskit/circuit/library/generalized_gates/rv.py index 6853d00b0fba..58f49c533138 100644 --- a/qiskit/circuit/library/generalized_gates/rv.py +++ b/qiskit/circuit/library/generalized_gates/rv.py @@ -27,7 +27,7 @@ class RVGate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────────────────┐ q_0: ┤ RV(v_x,v_y,v_z) ├ diff --git a/qiskit/circuit/library/grover_operator.py b/qiskit/circuit/library/grover_operator.py index 9cf48e240839..d40deefdf679 100644 --- a/qiskit/circuit/library/grover_operator.py +++ b/qiskit/circuit/library/grover_operator.py @@ -61,7 +61,7 @@ class GroverOperator(QuantumCircuit): Note that you can easily construct a phase oracle from a bitflip oracle by sandwiching the controlled X gate on the result qubit by a X and H gate. For instance - .. parsed-literal:: + .. code-block:: text Bitflip oracle Phaseflip oracle q_0: ──■── q_0: ────────────■──────────── diff --git a/qiskit/circuit/library/n_local/efficient_su2.py b/qiskit/circuit/library/n_local/efficient_su2.py index e27fe407e188..69398dca1e90 100644 --- a/qiskit/circuit/library/n_local/efficient_su2.py +++ b/qiskit/circuit/library/n_local/efficient_su2.py @@ -39,7 +39,7 @@ class EfficientSU2(TwoLocal): On 3 qubits and using the Pauli :math:`Y` and :math:`Z` su2_gates as single qubit gates, the hardware efficient SU(2) circuit is represented by: - .. parsed-literal:: + .. code-block:: text ┌──────────┐┌──────────┐ ░ ░ ░ ┌───────────┐┌───────────┐ ┤ RY(θ[0]) ├┤ RZ(θ[3]) ├─░────────■───░─ ... ─░─┤ RY(θ[12]) ├┤ RZ(θ[15]) ├ diff --git a/qiskit/circuit/library/n_local/n_local.py b/qiskit/circuit/library/n_local/n_local.py index f948a458ad7b..9eb79d367f3b 100644 --- a/qiskit/circuit/library/n_local/n_local.py +++ b/qiskit/circuit/library/n_local/n_local.py @@ -54,7 +54,7 @@ class NLocal(BlueprintCircuit): For instance, a rotation block on 2 qubits and an entanglement block on 4 qubits using ``'linear'`` entanglement yields the following circuit. - .. parsed-literal:: + .. code-block:: text ┌──────┐ ░ ┌──────┐ ░ ┌──────┐ ┤0 ├─░─┤0 ├──────────────── ... ─░─┤0 ├ diff --git a/qiskit/circuit/library/n_local/pauli_two_design.py b/qiskit/circuit/library/n_local/pauli_two_design.py index 71b090d08848..8bb003f4f690 100644 --- a/qiskit/circuit/library/n_local/pauli_two_design.py +++ b/qiskit/circuit/library/n_local/pauli_two_design.py @@ -37,7 +37,7 @@ class PauliTwoDesign(TwoLocal): For instance, the circuit could look like this (but note that choosing a different seed yields different Pauli rotations). - .. parsed-literal:: + .. code-block:: text ┌─────────┐┌──────────┐ ░ ┌──────────┐ ░ ┌──────────┐ q_0: ┤ RY(π/4) ├┤ RZ(θ[0]) ├─■─────░─┤ RY(θ[4]) ├─■─────░──┤ RZ(θ[8]) ├ diff --git a/qiskit/circuit/library/n_local/real_amplitudes.py b/qiskit/circuit/library/n_local/real_amplitudes.py index 8f5ea188b1ba..2b18bac0eb3d 100644 --- a/qiskit/circuit/library/n_local/real_amplitudes.py +++ b/qiskit/circuit/library/n_local/real_amplitudes.py @@ -35,7 +35,8 @@ class RealAmplitudes(TwoLocal): For example a ``RealAmplitudes`` circuit with 2 repetitions on 3 qubits with ``'reverse_linear'`` entanglement is - .. parsed-literal:: + .. code-block:: text + ┌──────────┐ ░ ░ ┌──────────┐ ░ ░ ┌──────────┐ ┤ Ry(θ[0]) ├─░────────■───░─┤ Ry(θ[3]) ├─░────────■───░─┤ Ry(θ[6]) ├ ├──────────┤ ░ ┌─┴─┐ ░ ├──────────┤ ░ ┌─┴─┐ ░ ├──────────┤ diff --git a/qiskit/circuit/library/standard_gates/dcx.py b/qiskit/circuit/library/standard_gates/dcx.py index d83f2e2f9c7f..d8c890140c4d 100644 --- a/qiskit/circuit/library/standard_gates/dcx.py +++ b/qiskit/circuit/library/standard_gates/dcx.py @@ -28,7 +28,8 @@ class DCXGate(SingletonGate): Can be applied to a :class:`~qiskit.circuit.QuantumCircuit` with the :meth:`~qiskit.circuit.QuantumCircuit.dcx` method. - .. parsed-literal:: + .. code-block:: text + ┌───┐ q_0: ──■──┤ X ├ ┌─┴─┐└─┬─┘ diff --git a/qiskit/circuit/library/standard_gates/ecr.py b/qiskit/circuit/library/standard_gates/ecr.py index f00c02df538d..74df92431ee1 100644 --- a/qiskit/circuit/library/standard_gates/ecr.py +++ b/qiskit/circuit/library/standard_gates/ecr.py @@ -38,7 +38,7 @@ class ECRGate(SingletonGate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────────┐ ┌────────────┐┌────────┐┌─────────────┐ q_0: ┤0 ├ q_0: ┤0 ├┤ RX(pi) ├┤0 ├ @@ -66,7 +66,7 @@ class ECRGate(SingletonGate): Instead, if we apply it on (q_1, q_0), the matrix will be :math:`Z \otimes X`: - .. parsed-literal:: + .. code-block:: text ┌─────────┐ q_0: ┤1 ├ diff --git a/qiskit/circuit/library/standard_gates/h.py b/qiskit/circuit/library/standard_gates/h.py index 462ede2c93ae..03d5c5d928d4 100644 --- a/qiskit/circuit/library/standard_gates/h.py +++ b/qiskit/circuit/library/standard_gates/h.py @@ -38,7 +38,7 @@ class HGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ H ├ @@ -142,7 +142,7 @@ class CHGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──■── ┌─┴─┐ @@ -170,7 +170,8 @@ class CHGate(SingletonControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───┐ q_0: ┤ H ├ └─┬─┘ diff --git a/qiskit/circuit/library/standard_gates/i.py b/qiskit/circuit/library/standard_gates/i.py index 13a98ce0df8a..2e5696a281e4 100644 --- a/qiskit/circuit/library/standard_gates/i.py +++ b/qiskit/circuit/library/standard_gates/i.py @@ -40,7 +40,8 @@ class IGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text + ┌───┐ q_0: ┤ I ├ └───┘ diff --git a/qiskit/circuit/library/standard_gates/iswap.py b/qiskit/circuit/library/standard_gates/iswap.py index 8074990a3840..5e58b807ae2f 100644 --- a/qiskit/circuit/library/standard_gates/iswap.py +++ b/qiskit/circuit/library/standard_gates/iswap.py @@ -38,7 +38,7 @@ class iSwapGate(SingletonGate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ─⨂─ │ @@ -46,7 +46,7 @@ class iSwapGate(SingletonGate): **Reference Implementation:** - .. parsed-literal:: + .. code-block:: text ┌───┐┌───┐ ┌───┐ q_0: ┤ S ├┤ H ├──■──┤ X ├───── diff --git a/qiskit/circuit/library/standard_gates/p.py b/qiskit/circuit/library/standard_gates/p.py index edec8e6ed030..9f689e46ca2b 100644 --- a/qiskit/circuit/library/standard_gates/p.py +++ b/qiskit/circuit/library/standard_gates/p.py @@ -33,7 +33,7 @@ class PhaseGate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌──────┐ q_0: ┤ P(λ) ├ @@ -171,7 +171,7 @@ class CPhaseGate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ─■── @@ -318,7 +318,7 @@ class MCPhaseGate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ───■──── │ diff --git a/qiskit/circuit/library/standard_gates/r.py b/qiskit/circuit/library/standard_gates/r.py index 22c30e24bf6a..9d53a58b7003 100644 --- a/qiskit/circuit/library/standard_gates/r.py +++ b/qiskit/circuit/library/standard_gates/r.py @@ -31,7 +31,7 @@ class RGate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌──────┐ q_0: ┤ R(ϴ) ├ diff --git a/qiskit/circuit/library/standard_gates/rx.py b/qiskit/circuit/library/standard_gates/rx.py index 4b8c9e6b446a..cc8a72cd06dd 100644 --- a/qiskit/circuit/library/standard_gates/rx.py +++ b/qiskit/circuit/library/standard_gates/rx.py @@ -34,7 +34,7 @@ class RXGate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────┐ q_0: ┤ Rx(ϴ) ├ @@ -159,7 +159,7 @@ class CRXGate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ────■──── ┌───┴───┐ @@ -189,7 +189,8 @@ class CRXGate(ControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───────┐ q_0: ┤ Rx(ϴ) ├ └───┬───┘ diff --git a/qiskit/circuit/library/standard_gates/rxx.py b/qiskit/circuit/library/standard_gates/rxx.py index 887ea0d1540a..1ec132508880 100644 --- a/qiskit/circuit/library/standard_gates/rxx.py +++ b/qiskit/circuit/library/standard_gates/rxx.py @@ -33,7 +33,7 @@ class RXXGate(Gate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────────┐ q_0: ┤1 ├ diff --git a/qiskit/circuit/library/standard_gates/ry.py b/qiskit/circuit/library/standard_gates/ry.py index 614d4ef13a0f..6e6ba7142498 100644 --- a/qiskit/circuit/library/standard_gates/ry.py +++ b/qiskit/circuit/library/standard_gates/ry.py @@ -33,7 +33,7 @@ class RYGate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────┐ q_0: ┤ Ry(ϴ) ├ @@ -158,7 +158,7 @@ class CRYGate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ────■──── ┌───┴───┐ @@ -188,7 +188,8 @@ class CRYGate(ControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───────┐ q_0: ┤ Ry(ϴ) ├ └───┬───┘ diff --git a/qiskit/circuit/library/standard_gates/ryy.py b/qiskit/circuit/library/standard_gates/ryy.py index 94b40cd0aad8..025ff50b916c 100644 --- a/qiskit/circuit/library/standard_gates/ryy.py +++ b/qiskit/circuit/library/standard_gates/ryy.py @@ -33,7 +33,7 @@ class RYYGate(Gate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────────┐ q_0: ┤1 ├ diff --git a/qiskit/circuit/library/standard_gates/rz.py b/qiskit/circuit/library/standard_gates/rz.py index 3abef37b7534..c1b16e1d99e4 100644 --- a/qiskit/circuit/library/standard_gates/rz.py +++ b/qiskit/circuit/library/standard_gates/rz.py @@ -34,7 +34,7 @@ class RZGate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────┐ q_0: ┤ Rz(λ) ├ @@ -174,7 +174,7 @@ class CRZGate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ────■──── ┌───┴───┐ @@ -202,7 +202,8 @@ class CRZGate(ControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───────┐ q_0: ┤ Rz(λ) ├ └───┬───┘ diff --git a/qiskit/circuit/library/standard_gates/rzx.py b/qiskit/circuit/library/standard_gates/rzx.py index 7c44caae0fa8..1a2903270dce 100644 --- a/qiskit/circuit/library/standard_gates/rzx.py +++ b/qiskit/circuit/library/standard_gates/rzx.py @@ -35,7 +35,7 @@ class RZXGate(Gate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────────┐ q_0: ┤0 ├ @@ -65,7 +65,7 @@ class RZXGate(Gate): Instead, if we apply it on (q_1, q_0), the matrix will be :math:`Z \otimes X`: - .. parsed-literal:: + .. code-block:: text ┌─────────┐ q_0: ┤1 ├ diff --git a/qiskit/circuit/library/standard_gates/rzz.py b/qiskit/circuit/library/standard_gates/rzz.py index ca3e6d2db2da..d68049fb8a3b 100644 --- a/qiskit/circuit/library/standard_gates/rzz.py +++ b/qiskit/circuit/library/standard_gates/rzz.py @@ -32,7 +32,7 @@ class RZZGate(Gate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ───■──── │zz(θ) diff --git a/qiskit/circuit/library/standard_gates/s.py b/qiskit/circuit/library/standard_gates/s.py index e859de4b5013..6a6aa576e8d1 100644 --- a/qiskit/circuit/library/standard_gates/s.py +++ b/qiskit/circuit/library/standard_gates/s.py @@ -51,7 +51,7 @@ class SGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ S ├ @@ -163,7 +163,7 @@ class SdgGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────┐ q_0: ┤ Sdg ├ @@ -262,7 +262,7 @@ class CSGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──■── ┌─┴─┐ @@ -350,7 +350,7 @@ class CSdgGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ───■─── ┌──┴──┐ diff --git a/qiskit/circuit/library/standard_gates/swap.py b/qiskit/circuit/library/standard_gates/swap.py index 84ef3046746d..54a2472a3473 100644 --- a/qiskit/circuit/library/standard_gates/swap.py +++ b/qiskit/circuit/library/standard_gates/swap.py @@ -36,7 +36,7 @@ class SwapGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ─X─ │ @@ -150,7 +150,7 @@ class CSwapGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ─■─ │ @@ -185,7 +185,7 @@ class CSwapGate(SingletonControlledGate): which in our case would be q_2. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text q_0: ─X─ │ diff --git a/qiskit/circuit/library/standard_gates/sx.py b/qiskit/circuit/library/standard_gates/sx.py index ec1f57a83bd3..647016211c73 100644 --- a/qiskit/circuit/library/standard_gates/sx.py +++ b/qiskit/circuit/library/standard_gates/sx.py @@ -44,7 +44,7 @@ class SXGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌────┐ q_0: ┤ √X ├ @@ -220,7 +220,7 @@ class CSXGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──■── ┌─┴──┐ @@ -249,7 +249,8 @@ class CSXGate(SingletonControlledGate): which in our case would be `q_1`. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌────┐ q_0: ┤ √X ├ └─┬──┘ diff --git a/qiskit/circuit/library/standard_gates/t.py b/qiskit/circuit/library/standard_gates/t.py index e4301168ac53..5407d7ad5c72 100644 --- a/qiskit/circuit/library/standard_gates/t.py +++ b/qiskit/circuit/library/standard_gates/t.py @@ -47,7 +47,7 @@ class TGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ T ├ @@ -124,7 +124,7 @@ class TdgGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────┐ q_0: ┤ Tdg ├ diff --git a/qiskit/circuit/library/standard_gates/u.py b/qiskit/circuit/library/standard_gates/u.py index c15205790bd8..45e540d65ca3 100644 --- a/qiskit/circuit/library/standard_gates/u.py +++ b/qiskit/circuit/library/standard_gates/u.py @@ -35,7 +35,7 @@ class UGate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌──────────┐ q_0: ┤ U(ϴ,φ,λ) ├ @@ -218,7 +218,7 @@ class CUGate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──────■────── ┌─────┴──────┐ @@ -251,7 +251,8 @@ class CUGate(ControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌────────────┐ q_0: ┤ U(ϴ,φ,λ,γ) ├ └─────┬──────┘ diff --git a/qiskit/circuit/library/standard_gates/u1.py b/qiskit/circuit/library/standard_gates/u1.py index ec8dc6a4f2dc..e1657bdee8cc 100644 --- a/qiskit/circuit/library/standard_gates/u1.py +++ b/qiskit/circuit/library/standard_gates/u1.py @@ -46,7 +46,7 @@ class U1Gate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────┐ q_0: ┤ U1(λ) ├ @@ -198,7 +198,7 @@ class CU1Gate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ─■── @@ -376,7 +376,7 @@ class MCU1Gate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ────■──── │ diff --git a/qiskit/circuit/library/standard_gates/u2.py b/qiskit/circuit/library/standard_gates/u2.py index e39df591b53e..343b936e13ee 100644 --- a/qiskit/circuit/library/standard_gates/u2.py +++ b/qiskit/circuit/library/standard_gates/u2.py @@ -43,7 +43,7 @@ class U2Gate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌─────────┐ q_0: ┤ U2(φ,λ) ├ diff --git a/qiskit/circuit/library/standard_gates/u3.py b/qiskit/circuit/library/standard_gates/u3.py index ff4871b5c91d..4a67e9c5530d 100644 --- a/qiskit/circuit/library/standard_gates/u3.py +++ b/qiskit/circuit/library/standard_gates/u3.py @@ -43,7 +43,7 @@ class U3Gate(Gate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────────┐ q_0: ┤ U3(ϴ,φ,λ) ├ @@ -208,7 +208,7 @@ class CU3Gate(ControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──────■────── ┌─────┴─────┐ @@ -239,7 +239,8 @@ class CU3Gate(ControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───────────┐ q_0: ┤ U3(ϴ,φ,λ) ├ └─────┬─────┘ diff --git a/qiskit/circuit/library/standard_gates/x.py b/qiskit/circuit/library/standard_gates/x.py index f24c76c65d91..c9b39257320d 100644 --- a/qiskit/circuit/library/standard_gates/x.py +++ b/qiskit/circuit/library/standard_gates/x.py @@ -44,7 +44,7 @@ class XGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ X ├ @@ -163,7 +163,7 @@ class CXGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──■── ┌─┴─┐ @@ -191,7 +191,8 @@ class CXGate(SingletonControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───┐ q_0: ┤ X ├ └─┬─┘ @@ -310,7 +311,7 @@ class CCXGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──■── │ @@ -344,7 +345,8 @@ class CCXGate(SingletonControlledGate): which in our case would be q_2 and q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───┐ q_0: ┤ X ├ └─┬─┘ diff --git a/qiskit/circuit/library/standard_gates/xx_minus_yy.py b/qiskit/circuit/library/standard_gates/xx_minus_yy.py index 2fac02fd154d..9e6be64f6570 100644 --- a/qiskit/circuit/library/standard_gates/xx_minus_yy.py +++ b/qiskit/circuit/library/standard_gates/xx_minus_yy.py @@ -41,7 +41,7 @@ class XXMinusYYGate(Gate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────────────┐ q_0: ┤0 ├ @@ -73,7 +73,7 @@ class XXMinusYYGate(Gate): phase is added on q_0. If :math:`\beta` is set to its default value of :math:`0`, the gate is equivalent in big and little endian. - .. parsed-literal:: + .. code-block:: text ┌───────────────┐ q_0: ┤1 ├ diff --git a/qiskit/circuit/library/standard_gates/xx_plus_yy.py b/qiskit/circuit/library/standard_gates/xx_plus_yy.py index e0528a1f1792..6d5b80a71272 100644 --- a/qiskit/circuit/library/standard_gates/xx_plus_yy.py +++ b/qiskit/circuit/library/standard_gates/xx_plus_yy.py @@ -35,7 +35,7 @@ class XXPlusYYGate(Gate): **Circuit Symbol:** - .. parsed-literal:: + .. code-block:: text ┌───────────────┐ q_0: ┤0 ├ @@ -67,7 +67,7 @@ class XXPlusYYGate(Gate): phase is added on q_1. If :math:`\beta` is set to its default value of :math:`0`, the gate is equivalent in big and little endian. - .. parsed-literal:: + .. code-block:: text ┌───────────────┐ q_0: ┤1 ├ diff --git a/qiskit/circuit/library/standard_gates/y.py b/qiskit/circuit/library/standard_gates/y.py index 99d37ee08bd3..9de6f67f1a77 100644 --- a/qiskit/circuit/library/standard_gates/y.py +++ b/qiskit/circuit/library/standard_gates/y.py @@ -42,7 +42,7 @@ class YGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ Y ├ @@ -152,7 +152,7 @@ class CYGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ──■── ┌─┴─┐ @@ -181,7 +181,8 @@ class CYGate(SingletonControlledGate): which in our case would be q_1. Thus a textbook matrix for this gate will be: - .. parsed-literal:: + .. code-block:: text + ┌───┐ q_0: ┤ Y ├ └─┬─┘ diff --git a/qiskit/circuit/library/standard_gates/z.py b/qiskit/circuit/library/standard_gates/z.py index dd83c3833d62..990efddc9a56 100644 --- a/qiskit/circuit/library/standard_gates/z.py +++ b/qiskit/circuit/library/standard_gates/z.py @@ -45,7 +45,7 @@ class ZGate(SingletonGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ Z ├ @@ -161,7 +161,7 @@ class CZGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ─■─ │ @@ -257,7 +257,7 @@ class CCZGate(SingletonControlledGate): **Circuit symbol:** - .. parsed-literal:: + .. code-block:: text q_0: ─■─ │ diff --git a/qiskit/circuit/library/templates/clifford/clifford_2_1.py b/qiskit/circuit/library/templates/clifford/clifford_2_1.py index 872a9996fcbd..86a173d31f71 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_2_1.py +++ b/qiskit/circuit/library/templates/clifford/clifford_2_1.py @@ -10,20 +10,21 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 2_1: -.. parsed-literal:: - - q_0: ─■──■─ - │ │ - q_1: ─■──■─ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_2_1(): """ + Clifford template 2_1: + + .. code-block:: text + + q_0: ─■──■─ + │ │ + q_1: ─■──■─ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_2_2.py b/qiskit/circuit/library/templates/clifford/clifford_2_2.py index d3d6205386a0..35297ec2ca39 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_2_2.py +++ b/qiskit/circuit/library/templates/clifford/clifford_2_2.py @@ -10,21 +10,22 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 2_2: -.. parsed-literal:: - - q_0: ──■────■── - ┌─┴─┐┌─┴─┐ - q_1: ┤ X ├┤ X ├ - └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_2_2(): """ + Clifford template 2_2: + + .. code-block:: text + + q_0: ──■────■── + ┌─┴─┐┌─┴─┐ + q_1: ┤ X ├┤ X ├ + └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_2_3.py b/qiskit/circuit/library/templates/clifford/clifford_2_3.py index 336d985e93ad..9b72481be418 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_2_3.py +++ b/qiskit/circuit/library/templates/clifford/clifford_2_3.py @@ -10,19 +10,21 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 2_3: -.. parsed-literal:: - ┌───┐┌───┐ - q_0: ┤ H ├┤ H ├ - └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_2_3(): """ + Clifford template 2_3: + + .. code-block:: text + + ┌───┐┌───┐ + q_0: ┤ H ├┤ H ├ + └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_2_4.py b/qiskit/circuit/library/templates/clifford/clifford_2_4.py index 3f132878d038..0b7a64f848ee 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_2_4.py +++ b/qiskit/circuit/library/templates/clifford/clifford_2_4.py @@ -10,20 +10,21 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 2_4: -.. parsed-literal:: - - q_0: ─X──X─ - │ │ - q_1: ─X──X─ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_2_4(): """ + Clifford template 2_4: + + .. code-block:: text + + q_0: ─X──X─ + │ │ + q_1: ─X──X─ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_3_1.py b/qiskit/circuit/library/templates/clifford/clifford_3_1.py index b45007b27431..6c23b8b5c4eb 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_3_1.py +++ b/qiskit/circuit/library/templates/clifford/clifford_3_1.py @@ -10,20 +10,21 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 3_1: -.. parsed-literal:: - - ┌───┐┌───┐┌───┐ - q_0: ┤ S ├┤ S ├┤ Z ├ - └───┘└───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_3_1(): """ + Clifford template 3_1: + + .. code-block:: text + + ┌───┐┌───┐┌───┐ + q_0: ┤ S ├┤ S ├┤ Z ├ + └───┘└───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_4_1.py b/qiskit/circuit/library/templates/clifford/clifford_4_1.py index d031b0f49168..7ebea32debe2 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_4_1.py +++ b/qiskit/circuit/library/templates/clifford/clifford_4_1.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 4_1: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_4_1(): + """ + Clifford template 4_1: + + .. code-block:: text ┌───┐ q_0: ──■──┤ X ├──■───X─ ┌─┴─┐└─┬─┘┌─┴─┐ │ q_1: ┤ X ├──■──┤ X ├─X─ └───┘ └───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_4_1(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_4_2.py b/qiskit/circuit/library/templates/clifford/clifford_4_2.py index a9d98f251b2f..37e83def4d9f 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_4_2.py +++ b/qiskit/circuit/library/templates/clifford/clifford_4_2.py @@ -10,21 +10,22 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 4_2: -.. parsed-literal:: - - q_0: ───────■────────■─ - ┌───┐┌─┴─┐┌───┐ │ - q_1: ┤ H ├┤ X ├┤ H ├─■─ - └───┘└───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_4_2(): """ + Clifford template 4_2: + + .. code-block:: text + + q_0: ───────■────────■─ + ┌───┐┌─┴─┐┌───┐ │ + q_1: ┤ H ├┤ X ├┤ H ├─■─ + └───┘└───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_4_3.py b/qiskit/circuit/library/templates/clifford/clifford_4_3.py index 13371c33786b..2c3b6c23f9d1 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_4_3.py +++ b/qiskit/circuit/library/templates/clifford/clifford_4_3.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 4_3: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_4_3(): + """ + Clifford template 4_3: + + .. code-block:: text ┌───┐ ┌─────┐ q_0: ┤ S ├──■──┤ SDG ├──■── └───┘┌─┴─┐└─────┘┌─┴─┐ q_1: ─────┤ X ├───────┤ X ├ └───┘ └───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_4_3(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_4_4.py b/qiskit/circuit/library/templates/clifford/clifford_4_4.py index 1611e00000df..707cc0cbe698 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_4_4.py +++ b/qiskit/circuit/library/templates/clifford/clifford_4_4.py @@ -10,21 +10,22 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 4_4: -.. parsed-literal:: - - ┌───┐ ┌─────┐ - q_0: ┤ S ├─■─┤ SDG ├─■─ - └───┘ │ └─────┘ │ - q_1: ──────■─────────■─ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_4_4(): """ + Clifford template 4_4: + + .. code-block:: text + + ┌───┐ ┌─────┐ + q_0: ┤ S ├─■─┤ SDG ├─■─ + └───┘ │ └─────┘ │ + q_1: ──────■─────────■─ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_5_1.py b/qiskit/circuit/library/templates/clifford/clifford_5_1.py index ccbd15fac1d4..9641a333a137 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_5_1.py +++ b/qiskit/circuit/library/templates/clifford/clifford_5_1.py @@ -10,9 +10,16 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 5_1: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_5_1(): + """ + Clifford template 5_1: + + .. code-block:: text q_0: ──■─────────■─────────■── ┌─┴─┐ ┌─┴─┐ │ @@ -20,13 +27,7 @@ └───┘┌─┴─┐└───┘┌─┴─┐┌─┴─┐ q_2: ─────┤ X ├─────┤ X ├┤ X ├ └───┘ └───┘└───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_5_1(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_6_1.py b/qiskit/circuit/library/templates/clifford/clifford_6_1.py index 3d796b2e2383..ab8227c2d125 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_6_1.py +++ b/qiskit/circuit/library/templates/clifford/clifford_6_1.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 6_1: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_6_1(): + """ + Clifford template 6_1: + + .. code-block:: text ┌───┐ ┌───┐┌───┐ q_0: ┤ H ├──■──┤ H ├┤ X ├ ├───┤┌─┴─┐├───┤└─┬─┘ q_1: ┤ H ├┤ X ├┤ H ├──■── └───┘└───┘└───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_6_1(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_6_2.py b/qiskit/circuit/library/templates/clifford/clifford_6_2.py index b447932c4b37..bd7569663de4 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_6_2.py +++ b/qiskit/circuit/library/templates/clifford/clifford_6_2.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 6_2: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_6_2(): + """ + Clifford template 6_2: + + .. code-block:: text ┌───┐ q_0: ┤ S ├──■───────────■───■─ ├───┤┌─┴─┐┌─────┐┌─┴─┐ │ q_1: ┤ S ├┤ X ├┤ SDG ├┤ X ├─■─ └───┘└───┘└─────┘└───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_6_2(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_6_3.py b/qiskit/circuit/library/templates/clifford/clifford_6_3.py index 3387b7ca5236..7d3da6bdc63d 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_6_3.py +++ b/qiskit/circuit/library/templates/clifford/clifford_6_3.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 6_3: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_6_3(): + """ + Clifford template 6_3: + + .. code-block:: text ┌───┐ ┌───┐ q_0: ─X──■─┤ H ├──■──┤ X ├───── │ │ └───┘┌─┴─┐└─┬─┘┌───┐ q_1: ─X──■──────┤ X ├──■──┤ H ├ └───┘ └───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_6_3(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_6_4.py b/qiskit/circuit/library/templates/clifford/clifford_6_4.py index f45b31498aaa..cd8199a2adcb 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_6_4.py +++ b/qiskit/circuit/library/templates/clifford/clifford_6_4.py @@ -10,20 +10,21 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 6_4: -.. parsed-literal:: - - ┌───┐┌───┐┌───┐┌───┐┌───┐┌───┐ - q_0: ┤ S ├┤ H ├┤ S ├┤ H ├┤ S ├┤ H ├ - └───┘└───┘└───┘└───┘└───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_6_4(): """ + Clifford template 6_4: + + .. code-block:: text + + ┌───┐┌───┐┌───┐┌───┐┌───┐┌───┐ + q_0: ┤ S ├┤ H ├┤ S ├┤ H ├┤ S ├┤ H ├ + └───┘└───┘└───┘└───┘└───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_6_5.py b/qiskit/circuit/library/templates/clifford/clifford_6_5.py index b340e1e10a5e..45b6a028975e 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_6_5.py +++ b/qiskit/circuit/library/templates/clifford/clifford_6_5.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 6_5: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_6_5(): + """ + Clifford template 6_5: + + .. code-block:: text ┌───┐ q_0: ─■───■───┤ S ├───■─────── │ ┌─┴─┐┌┴───┴┐┌─┴─┐┌───┐ q_1: ─■─┤ X ├┤ SDG ├┤ X ├┤ S ├ └───┘└─────┘└───┘└───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_6_5(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_8_1.py b/qiskit/circuit/library/templates/clifford/clifford_8_1.py index d2a6e8391da2..5112e811d4a0 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_8_1.py +++ b/qiskit/circuit/library/templates/clifford/clifford_8_1.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 8_1: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_8_1(): + """ + Clifford template 8_1: + + .. code-block:: text ┌───┐ ┌───┐ ┌───┐┌─────┐ q_0: ──■───────┤ X ├─┤ S ├─┤ X ├┤ SDG ├ ┌─┴─┐┌───┐└─┬─┘┌┴───┴┐└─┬─┘└┬───┬┘ q_1: ┤ X ├┤ H ├──■──┤ SDG ├──■───┤ H ├─ └───┘└───┘ └─────┘ └───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_8_1(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_8_2.py b/qiskit/circuit/library/templates/clifford/clifford_8_2.py index 1fd162b7ac70..75e178e39b06 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_8_2.py +++ b/qiskit/circuit/library/templates/clifford/clifford_8_2.py @@ -10,22 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 8_2: -.. parsed-literal:: +# pylint: disable=missing-module-docstring + +from qiskit.circuit.quantumcircuit import QuantumCircuit + + +def clifford_8_2(): + """ + Clifford template 8_2: + + .. code-block:: text ┌───┐ q_0: ──■─────────■───┤ S ├───■──────────── ┌─┴─┐┌───┐┌─┴─┐┌┴───┴┐┌─┴─┐┌───┐┌───┐ q_1: ┤ X ├┤ H ├┤ X ├┤ SDG ├┤ X ├┤ S ├┤ H ├ └───┘└───┘└───┘└─────┘└───┘└───┘└───┘ -""" - -from qiskit.circuit.quantumcircuit import QuantumCircuit - -def clifford_8_2(): - """ Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/clifford/clifford_8_3.py b/qiskit/circuit/library/templates/clifford/clifford_8_3.py index ccc7ca0d91b8..e9e49b6741ff 100644 --- a/qiskit/circuit/library/templates/clifford/clifford_8_3.py +++ b/qiskit/circuit/library/templates/clifford/clifford_8_3.py @@ -10,21 +10,22 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Clifford template 8_3: -.. parsed-literal:: - - q_0: ─────────────────■───────────────────────■── - ┌───┐┌───┐┌───┐┌─┴─┐┌─────┐┌───┐┌─────┐┌─┴─┐ - q_1: ┤ S ├┤ H ├┤ S ├┤ X ├┤ SDG ├┤ H ├┤ SDG ├┤ X ├ - └───┘└───┘└───┘└───┘└─────┘└───┘└─────┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def clifford_8_3(): """ + Clifford template 8_3: + + .. code-block:: text + + q_0: ─────────────────■───────────────────────■── + ┌───┐┌───┐┌───┐┌─┴─┐┌─────┐┌───┐┌─────┐┌─┴─┐ + q_1: ┤ S ├┤ H ├┤ S ├┤ X ├┤ SDG ├┤ H ├┤ SDG ├┤ X ├ + └───┘└───┘└───┘└───┘└─────┘└───┘└─────┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_2a_1.py b/qiskit/circuit/library/templates/nct/template_nct_2a_1.py index fbe7a215de26..5b31617e6427 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_2a_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_2a_1.py @@ -10,19 +10,21 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 2a_1: -.. parsed-literal:: - ┌───┐┌───┐ - q_0: ┤ X ├┤ X ├ - └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_2a_1(): """ + Template 2a_1: + + .. code-block:: text + + ┌───┐┌───┐ + q_0: ┤ X ├┤ X ├ + └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_2a_2.py b/qiskit/circuit/library/templates/nct/template_nct_2a_2.py index b3f777f6a7ec..855e8a947ec6 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_2a_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_2a_2.py @@ -10,20 +10,22 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 2a_2: -.. parsed-literal:: - q_0: ──■────■── - ┌─┴─┐┌─┴─┐ - q_1: ┤ X ├┤ X ├ - └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_2a_2(): """ + Template 2a_2: + + .. code-block:: text + + q_0: ──■────■── + ┌─┴─┐┌─┴─┐ + q_1: ┤ X ├┤ X ├ + └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_2a_3.py b/qiskit/circuit/library/templates/nct/template_nct_2a_3.py index 660c1c6951d3..dc1be8859548 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_2a_3.py +++ b/qiskit/circuit/library/templates/nct/template_nct_2a_3.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 2a_3: -.. parsed-literal:: - q_0: ──■────■── - │ │ - q_1: ──■────■── - ┌─┴─┐┌─┴─┐ - q_2: ┤ X ├┤ X ├ - └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_2a_3(): """ + Template 2a_3: + + .. code-block:: text + + q_0: ──■────■── + │ │ + q_1: ──■────■── + ┌─┴─┐┌─┴─┐ + q_2: ┤ X ├┤ X ├ + └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_4a_1.py b/qiskit/circuit/library/templates/nct/template_nct_4a_1.py index 3bee757658dc..6c5e2d0e6a46 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_4a_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_4a_1.py @@ -10,26 +10,28 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 4a_1: -.. parsed-literal:: - q_0: ───────■─────────■── - │ │ - q_1: ──■────┼────■────┼── - │ │ │ │ - q_2: ──■────■────■────■── - │ ┌─┴─┐ │ ┌─┴─┐ - q_3: ──┼──┤ X ├──┼──┤ X ├ - ┌─┴─┐└───┘┌─┴─┐└───┘ - q_4: ┤ X ├─────┤ X ├───── - └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_4a_1(): """ + Template 4a_1: + + .. code-block:: text + + q_0: ───────■─────────■── + │ │ + q_1: ──■────┼────■────┼── + │ │ │ │ + q_2: ──■────■────■────■── + │ ┌─┴─┐ │ ┌─┴─┐ + q_3: ──┼──┤ X ├──┼──┤ X ├ + ┌─┴─┐└───┘┌─┴─┐└───┘ + q_4: ┤ X ├─────┤ X ├───── + └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_4a_2.py b/qiskit/circuit/library/templates/nct/template_nct_4a_2.py index 3adf540a47ec..21ee7549d734 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_4a_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_4a_2.py @@ -10,24 +10,26 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 4a_2: -.. parsed-literal:: - q_0: ──■─────────■─────── - │ │ - q_1: ──■────■────■────■── - │ ┌─┴─┐ │ ┌─┴─┐ - q_2: ──┼──┤ X ├──┼──┤ X ├ - ┌─┴─┐└───┘┌─┴─┐└───┘ - q_3: ┤ X ├─────┤ X ├───── - └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_4a_2(): """ + Template 4a_2: + + .. code-block:: text + + q_0: ──■─────────■─────── + │ │ + q_1: ──■────■────■────■── + │ ┌─┴─┐ │ ┌─┴─┐ + q_2: ──┼──┤ X ├──┼──┤ X ├ + ┌─┴─┐└───┘┌─┴─┐└───┘ + q_3: ┤ X ├─────┤ X ├───── + └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_4a_3.py b/qiskit/circuit/library/templates/nct/template_nct_4a_3.py index bd4615137856..6ce0e55acab8 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_4a_3.py +++ b/qiskit/circuit/library/templates/nct/template_nct_4a_3.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 4a_3: -.. parsed-literal:: - q_0: ──■────■────■────■── - │ ┌─┴─┐ │ ┌─┴─┐ - q_1: ──┼──┤ X ├──┼──┤ X ├ - ┌─┴─┐└───┘┌─┴─┐└───┘ - q_2: ┤ X ├─────┤ X ├───── - └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_4a_3(): """ + Template 4a_3: + + .. code-block:: text + + q_0: ──■────■────■────■── + │ ┌─┴─┐ │ ┌─┴─┐ + q_1: ──┼──┤ X ├──┼──┤ X ├ + ┌─┴─┐└───┘┌─┴─┐└───┘ + q_2: ┤ X ├─────┤ X ├───── + └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_4b_1.py b/qiskit/circuit/library/templates/nct/template_nct_4b_1.py index 8507716c55f9..a49fec5a12d5 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_4b_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_4b_1.py @@ -10,24 +10,26 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 4b_1: -.. parsed-literal:: - q_0: ───────■─────────■── - │ │ - q_1: ──■────┼────■────┼── - │ │ │ │ - q_2: ──■────■────■────■── - ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐ - q_3: ┤ X ├┤ X ├┤ X ├┤ X ├ - └───┘└───┘└───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_4b_1(): """ + Template 4b_1: + + .. code-block:: text + + q_0: ───────■─────────■── + │ │ + q_1: ──■────┼────■────┼── + │ │ │ │ + q_2: ──■────■────■────■── + ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐ + q_3: ┤ X ├┤ X ├┤ X ├┤ X ├ + └───┘└───┘└───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_4b_2.py b/qiskit/circuit/library/templates/nct/template_nct_4b_2.py index 839897bcd274..e22057fdeec6 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_4b_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_4b_2.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 4b_2: -.. parsed-literal:: - q_0: ──■─────────■─────── - │ │ - q_1: ──■────■────■────■── - ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐ - q_2: ┤ X ├┤ X ├┤ X ├┤ X ├ - └───┘└───┘└───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_4b_2(): """ + Template 4b_2: + + .. code-block:: text + + q_0: ──■─────────■─────── + │ │ + q_1: ──■────■────■────■── + ┌─┴─┐┌─┴─┐┌─┴─┐┌─┴─┐ + q_2: ┤ X ├┤ X ├┤ X ├┤ X ├ + └───┘└───┘└───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_5a_1.py b/qiskit/circuit/library/templates/nct/template_nct_5a_1.py index eaafc48f32ce..af9c2af9ae82 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_5a_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_5a_1.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 5a_1: -.. parsed-literal:: - q_0: ──■────■────■────■────■── - │ ┌─┴─┐ │ ┌─┴─┐ │ - q_1: ──■──┤ X ├──■──┤ X ├──┼── - ┌─┴─┐└───┘┌─┴─┐└───┘┌─┴─┐ - q_2: ┤ X ├─────┤ X ├─────┤ X ├ - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_5a_1(): """ + Template 5a_1: + + .. code-block:: text + + q_0: ──■────■────■────■────■── + │ ┌─┴─┐ │ ┌─┴─┐ │ + q_1: ──■──┤ X ├──■──┤ X ├──┼── + ┌─┴─┐└───┘┌─┴─┐└───┘┌─┴─┐ + q_2: ┤ X ├─────┤ X ├─────┤ X ├ + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_5a_2.py b/qiskit/circuit/library/templates/nct/template_nct_5a_2.py index 054e60f7005d..85a2df31aca1 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_5a_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_5a_2.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 5a_2: -.. parsed-literal:: - q_0: ──■─────────■─────────■── - │ ┌───┐ │ ┌───┐ │ - q_1: ──■──┤ X ├──■──┤ X ├──┼── - ┌─┴─┐└───┘┌─┴─┐└───┘┌─┴─┐ - q_2: ┤ X ├─────┤ X ├─────┤ X ├ - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_5a_2(): """ + Template 5a_2: + + .. code-block:: text + + q_0: ──■─────────■─────────■── + │ ┌───┐ │ ┌───┐ │ + q_1: ──■──┤ X ├──■──┤ X ├──┼── + ┌─┴─┐└───┘┌─┴─┐└───┘┌─┴─┐ + q_2: ┤ X ├─────┤ X ├─────┤ X ├ + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_5a_3.py b/qiskit/circuit/library/templates/nct/template_nct_5a_3.py index 78d7d7626217..bf80745db07a 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_5a_3.py +++ b/qiskit/circuit/library/templates/nct/template_nct_5a_3.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 5a_3: -.. parsed-literal:: - q_0: ───────■─────────■────■── - ┌─┴─┐ ┌─┴─┐ │ - q_1: ──■──┤ X ├──■──┤ X ├──┼── - ┌─┴─┐└───┘┌─┴─┐└───┘┌─┴─┐ - q_2: ┤ X ├─────┤ X ├─────┤ X ├ - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_5a_3(): """ + Template 5a_3: + + .. code-block:: text + + q_0: ───────■─────────■────■── + ┌─┴─┐ ┌─┴─┐ │ + q_1: ──■──┤ X ├──■──┤ X ├──┼── + ┌─┴─┐└───┘┌─┴─┐└───┘┌─┴─┐ + q_2: ┤ X ├─────┤ X ├─────┤ X ├ + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_5a_4.py b/qiskit/circuit/library/templates/nct/template_nct_5a_4.py index a8652e6b94c0..7b4f8031c09f 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_5a_4.py +++ b/qiskit/circuit/library/templates/nct/template_nct_5a_4.py @@ -10,21 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 5a_4: -.. parsed-literal:: - ┌───┐ ┌───┐ - q_0: ──■──┤ X ├──■──┤ X ├ - ┌─┴─┐└───┘┌─┴─┐├───┤ - q_1: ┤ X ├─────┤ X ├┤ X ├ - └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_5a_4(): """ + Template 5a_4: + + .. code-block:: text + + ┌───┐ ┌───┐ + q_0: ──■──┤ X ├──■──┤ X ├ + ┌─┴─┐└───┘┌─┴─┐├───┤ + q_1: ┤ X ├─────┤ X ├┤ X ├ + └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_6a_1.py b/qiskit/circuit/library/templates/nct/template_nct_6a_1.py index 0fb69125a1dd..475f7615e37c 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_6a_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_6a_1.py @@ -10,21 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 6a_1: -.. parsed-literal:: - ┌───┐ ┌───┐ ┌───┐ - q_0: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ - ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ - q_1: ┤ X ├──■──┤ X ├──■──┤ X ├──■── - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_6a_1(): """ + Template 6a_1: + + .. code-block:: text + + ┌───┐ ┌───┐ ┌───┐ + q_0: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ + ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ + q_1: ┤ X ├──■──┤ X ├──■──┤ X ├──■── + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_6a_2.py b/qiskit/circuit/library/templates/nct/template_nct_6a_2.py index b104f7bba95f..8cce9733e962 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_6a_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_6a_2.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 6a_2: -.. parsed-literal:: - q_0: ──■────■────■────■────■────■── - │ ┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ - q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ - ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ - q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_6a_2(): """ + Template 6a_2: + + .. code-block:: text + + q_0: ──■────■────■────■────■────■── + │ ┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ + q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ + ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ + q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_6a_3.py b/qiskit/circuit/library/templates/nct/template_nct_6a_3.py index 477e7eee1217..1ff589c8f14e 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_6a_3.py +++ b/qiskit/circuit/library/templates/nct/template_nct_6a_3.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 6a_3: -.. parsed-literal:: - q_0: ───────■─────────■────■────■── - ┌─┴─┐ ┌─┴─┐ │ ┌─┴─┐ - q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ - ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ - q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_6a_3(): """ + Template 6a_3: + + .. code-block:: text + + q_0: ───────■─────────■────■────■── + ┌─┴─┐ ┌─┴─┐ │ ┌─┴─┐ + q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ + ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ + q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_6a_4.py b/qiskit/circuit/library/templates/nct/template_nct_6a_4.py index 909b014cdad5..87b0f9aa4a50 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_6a_4.py +++ b/qiskit/circuit/library/templates/nct/template_nct_6a_4.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 6a_4: -.. parsed-literal:: - q_0: ───────■──────────────■─────── - ┌─┴─┐ ┌───┐ │ ┌───┐ - q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ - ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ - q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_6a_4(): """ + Template 6a_4: + + .. code-block:: text + + q_0: ───────■──────────────■─────── + ┌─┴─┐ ┌───┐ │ ┌───┐ + q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ + ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ + q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_6b_1.py b/qiskit/circuit/library/templates/nct/template_nct_6b_1.py index 63aa5a22c687..880133f6cca4 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_6b_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_6b_1.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 6b_1: -.. parsed-literal:: - q_0: ──■─────────■────■─────────■── - │ ┌─┴─┐ │ ┌─┴─┐ - q_1: ──■────■──┤ X ├──■────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_6b_1(): """ + Template 6b_1: + + .. code-block:: text + + q_0: ──■─────────■────■─────────■── + │ ┌─┴─┐ │ ┌─┴─┐ + q_1: ──■────■──┤ X ├──■────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_6b_2.py b/qiskit/circuit/library/templates/nct/template_nct_6b_2.py index f7a44e14f233..b86854c868b3 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_6b_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_6b_2.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 6b_2: -.. parsed-literal:: - q_0: ───────■────■─────────■────■── - │ ┌─┴─┐ │ ┌─┴─┐ - q_1: ──■────■──┤ X ├──■────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_6b_2(): """ + Template 6b_2: + + .. code-block:: text + + q_0: ───────■────■─────────■────■── + │ ┌─┴─┐ │ ┌─┴─┐ + q_1: ──■────■──┤ X ├──■────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_6c_1.py b/qiskit/circuit/library/templates/nct/template_nct_6c_1.py index f05f6448011e..4a09ddd02aa3 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_6c_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_6c_1.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 6c_1: -.. parsed-literal:: - q_0: ──■─────────■─────────■────■── - │ ┌───┐ │ ┌───┐ │ ┌─┴─┐ - q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ - ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ - q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── - └───┘ └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_6c_1(): """ + Template 6c_1: + + .. code-block:: text + + q_0: ──■─────────■─────────■────■── + │ ┌───┐ │ ┌───┐ │ ┌─┴─┐ + q_1: ──■──┤ X ├──■──┤ X ├──■──┤ X ├ + ┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐└─┬─┘ + q_2: ┤ X ├──■──┤ X ├──■──┤ X ├──■── + └───┘ └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_7a_1.py b/qiskit/circuit/library/templates/nct/template_nct_7a_1.py index 8832099dd430..ace6c0a18cc7 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_7a_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_7a_1.py @@ -10,23 +10,25 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 7a_1: -.. parsed-literal:: - ┌───┐ ┌───┐ - q_0: ┤ X ├──■─────────■────■──┤ X ├──■── - └─┬─┘┌─┴─┐ │ ┌─┴─┐└─┬─┘ │ - q_1: ──■──┤ X ├──■────■──┤ X ├──■────■── - └───┘┌─┴─┐┌─┴─┐└───┘ ┌─┴─┐ - q_2: ──────────┤ X ├┤ X ├──────────┤ X ├ - └───┘└───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_7a_1(): """ + Template 7a_1: + + .. code-block:: text + + ┌───┐ ┌───┐ + q_0: ┤ X ├──■─────────■────■──┤ X ├──■── + └─┬─┘┌─┴─┐ │ ┌─┴─┐└─┬─┘ │ + q_1: ──■──┤ X ├──■────■──┤ X ├──■────■── + └───┘┌─┴─┐┌─┴─┐└───┘ ┌─┴─┐ + q_2: ──────────┤ X ├┤ X ├──────────┤ X ├ + └───┘└───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_7b_1.py b/qiskit/circuit/library/templates/nct/template_nct_7b_1.py index c69661ad92c8..82374eb84178 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_7b_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_7b_1.py @@ -10,23 +10,25 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 7b_1: -.. parsed-literal:: - ┌───┐ ┌───┐ - q_0: ┤ X ├──■─────────■────■──┤ X ├──■── - └───┘┌─┴─┐ │ ┌─┴─┐└───┘ │ - q_1: ─────┤ X ├──■────■──┤ X ├───────■── - └───┘┌─┴─┐┌─┴─┐└───┘ ┌─┴─┐ - q_2: ──────────┤ X ├┤ X ├──────────┤ X ├ - └───┘└───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_7b_1(): """ + Template 7b_1: + + .. code-block:: text + + ┌───┐ ┌───┐ + q_0: ┤ X ├──■─────────■────■──┤ X ├──■── + └───┘┌─┴─┐ │ ┌─┴─┐└───┘ │ + q_1: ─────┤ X ├──■────■──┤ X ├───────■── + └───┘┌─┴─┐┌─┴─┐└───┘ ┌─┴─┐ + q_2: ──────────┤ X ├┤ X ├──────────┤ X ├ + └───┘└───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_7c_1.py b/qiskit/circuit/library/templates/nct/template_nct_7c_1.py index b72ce8a48539..096949673c7e 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_7c_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_7c_1.py @@ -10,23 +10,25 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 7c_1: -.. parsed-literal:: - ┌───┐ ┌───┐ - q_0: ┤ X ├──■─────────■────■──┤ X ├──■── - └───┘┌─┴─┐ │ ┌─┴─┐└───┘ │ - q_1: ─────┤ X ├──■────■──┤ X ├───────■── - └─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ ┌─┴─┐ - q_2: ───────■──┤ X ├┤ X ├──■───────┤ X ├ - └───┘└───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_7c_1(): """ + Template 7c_1: + + .. code-block:: text + + ┌───┐ ┌───┐ + q_0: ┤ X ├──■─────────■────■──┤ X ├──■── + └───┘┌─┴─┐ │ ┌─┴─┐└───┘ │ + q_1: ─────┤ X ├──■────■──┤ X ├───────■── + └─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ ┌─┴─┐ + q_2: ───────■──┤ X ├┤ X ├──■───────┤ X ├ + └───┘└───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_7d_1.py b/qiskit/circuit/library/templates/nct/template_nct_7d_1.py index 5d7401a764cc..ebaadf56d2fe 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_7d_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_7d_1.py @@ -10,23 +10,25 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 7d_1: -.. parsed-literal:: - ┌───┐ ┌───┐ - q_0: ┤ X ├──■─────────■────■──┤ X ├──■── - └─┬─┘┌─┴─┐ │ ┌─┴─┐└─┬─┘ │ - q_1: ──■──┤ X ├──■────■──┤ X ├──■────■── - └─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ ┌─┴─┐ - q_2: ───────■──┤ X ├┤ X ├──■───────┤ X ├ - └───┘└───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_7d_1(): """ + Template 7d_1: + + .. code-block:: text + + ┌───┐ ┌───┐ + q_0: ┤ X ├──■─────────■────■──┤ X ├──■── + └─┬─┘┌─┴─┐ │ ┌─┴─┐└─┬─┘ │ + q_1: ──■──┤ X ├──■────■──┤ X ├──■────■── + └─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ ┌─┴─┐ + q_2: ───────■──┤ X ├┤ X ├──■───────┤ X ├ + └───┘└───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_7e_1.py b/qiskit/circuit/library/templates/nct/template_nct_7e_1.py index 1a952064c437..548de4b99812 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_7e_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_7e_1.py @@ -10,23 +10,25 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 7e_1: -.. parsed-literal:: - ┌───┐ ┌───┐ - q_0: ┤ X ├──■─────────■────■──┤ X ├──■── - └───┘┌─┴─┐ │ ┌─┴─┐└───┘ │ - q_1: ─────┤ X ├───────┼──┤ X ├───────┼── - └─┬─┘┌───┐┌─┴─┐└─┬─┘ ┌─┴─┐ - q_2: ───────■──┤ X ├┤ X ├──■───────┤ X ├ - └───┘└───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_7e_1(): """ + Template 7e_1: + + .. code-block:: text + + ┌───┐ ┌───┐ + q_0: ┤ X ├──■─────────■────■──┤ X ├──■── + └───┘┌─┴─┐ │ ┌─┴─┐└───┘ │ + q_1: ─────┤ X ├───────┼──┤ X ├───────┼── + └─┬─┘┌───┐┌─┴─┐└─┬─┘ ┌─┴─┐ + q_2: ───────■──┤ X ├┤ X ├──■───────┤ X ├ + └───┘└───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9a_1.py b/qiskit/circuit/library/templates/nct/template_nct_9a_1.py index 991660c0dd20..b2c70f3e3ad5 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9a_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9a_1.py @@ -10,23 +10,25 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9a_1: -.. parsed-literal:: - ┌───┐ ┌───┐ ┌───┐ - q_0: ┤ X ├──■──┤ X ├──■────■──┤ X ├──■── - └─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐ - q_1: ──■──┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├ - └─┬─┘ │ ├───┤└─┬─┘┌───┐└─┬─┘ - q_2: ───────■────■──┤ X ├──■──┤ X ├──■── - └───┘ └───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9a_1(): """ + Template 9a_1: + + .. code-block:: text + + ┌───┐ ┌───┐ ┌───┐ + q_0: ┤ X ├──■──┤ X ├──■────■──┤ X ├──■── + └─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐ + q_1: ──■──┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├ + └─┬─┘ │ ├───┤└─┬─┘┌───┐└─┬─┘ + q_2: ───────■────■──┤ X ├──■──┤ X ├──■── + └───┘ └───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_1.py b/qiskit/circuit/library/templates/nct/template_nct_9c_1.py index 14c5d0cac2eb..551198a8cd45 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_1.py @@ -10,21 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_1: -.. parsed-literal:: - ┌───┐ ┌───┐┌───┐ ┌───┐ ┌───┐ - q_0: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ - q_1: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_1(): """ + Template 9c_1: + + .. code-block:: text + + ┌───┐ ┌───┐┌───┐ ┌───┐ ┌───┐ + q_0: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ + q_1: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_10.py b/qiskit/circuit/library/templates/nct/template_nct_9c_10.py index e246d04aa33f..2fccc5659634 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_10.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_10.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_10: -.. parsed-literal:: - q_0: ──■─────────■────■────■────■─────────■────■── - ┌─┴─┐ ┌─┴─┐┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_10(): """ + Template 9c_10: + + .. code-block:: text + + q_0: ──■─────────■────■────■────■─────────■────■── + ┌─┴─┐ ┌─┴─┐┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_11.py b/qiskit/circuit/library/templates/nct/template_nct_9c_11.py index 820e2c65d6ae..aa1f4b86507e 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_11.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_11.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_11: -.. parsed-literal:: - q_0: ───────■────■─────────■────■────■────■────■── - ┌───┐ │ ┌─┴─┐┌───┐ │ ┌─┴─┐ │ │ ┌─┴─┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_11(): """ + Template 9c_11: + + .. code-block:: text + + q_0: ───────■────■─────────■────■────■────■────■── + ┌───┐ │ ┌─┴─┐┌───┐ │ ┌─┴─┐ │ │ ┌─┴─┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_12.py b/qiskit/circuit/library/templates/nct/template_nct_9c_12.py index 1dceb279fc3a..ed709d5be567 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_12.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_12.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_12: -.. parsed-literal:: - q_0: ──■────■────■────■────■────■────■────■────■── - ┌─┴─┐ │ ┌─┴─┐┌─┴─┐ │ ┌─┴─┐ │ │ ┌─┴─┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_12(): """ + Template 9c_12: + + .. code-block:: text + + q_0: ──■────■────■────■────■────■────■────■────■── + ┌─┴─┐ │ ┌─┴─┐┌─┴─┐ │ ┌─┴─┐ │ │ ┌─┴─┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_2.py b/qiskit/circuit/library/templates/nct/template_nct_9c_2.py index 54db3f1abc4e..11d26a0f45de 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_2.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_2: -.. parsed-literal:: - q_0: ───────■────■──────────────■────■─────────■── - ┌───┐ │ ┌─┴─┐┌───┐ ┌─┴─┐ │ ┌─┴─┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_2(): """ + Template 9c_2: + + .. code-block:: text + + q_0: ───────■────■──────────────■────■─────────■── + ┌───┐ │ ┌─┴─┐┌───┐ ┌─┴─┐ │ ┌─┴─┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_3.py b/qiskit/circuit/library/templates/nct/template_nct_9c_3.py index c0058c522db1..bfb14b9a8c98 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_3.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_3.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_3: -.. parsed-literal:: - q_0: ───────■────────────────────────■──────────── - ┌───┐ │ ┌───┐┌───┐ ┌───┐ │ ┌───┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_3(): """ + Template 9c_3: + + .. code-block:: text + + q_0: ───────■────────────────────────■──────────── + ┌───┐ │ ┌───┐┌───┐ ┌───┐ │ ┌───┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_4.py b/qiskit/circuit/library/templates/nct/template_nct_9c_4.py index e551aa324db2..04987ab89708 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_4.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_4.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_4: -.. parsed-literal:: - q_0: ──■────■─────────■──────────────■──────────── - ┌─┴─┐ │ ┌───┐┌─┴─┐ ┌───┐ │ ┌───┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_4(): """ + Template 9c_4: + + .. code-block:: text + + q_0: ──■────■─────────■──────────────■──────────── + ┌─┴─┐ │ ┌───┐┌─┴─┐ ┌───┐ │ ┌───┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_5.py b/qiskit/circuit/library/templates/nct/template_nct_9c_5.py index 81fe2d52aba1..07768dc42a64 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_5.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_5.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_5: -.. parsed-literal:: - q_0: ────────────■─────────■──────────────■─────── - ┌───┐ ┌─┴─┐┌───┐ │ ┌───┐ │ ┌───┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_5(): """ + Template 9c_5: + + .. code-block:: text + + q_0: ────────────■─────────■──────────────■─────── + ┌───┐ ┌─┴─┐┌───┐ │ ┌───┐ │ ┌───┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_6.py b/qiskit/circuit/library/templates/nct/template_nct_9c_6.py index 8d13df5a69ea..909eaeb92579 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_6.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_6.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_6: -.. parsed-literal:: - q_0: ───────■────■─────────■─────────■────■─────── - ┌───┐ │ ┌─┴─┐┌───┐ │ ┌───┐ │ │ ┌───┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_6(): """ + Template 9c_6: + + .. code-block:: text + + q_0: ───────■────■─────────■─────────■────■─────── + ┌───┐ │ ┌─┴─┐┌───┐ │ ┌───┐ │ │ ┌───┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_7.py b/qiskit/circuit/library/templates/nct/template_nct_9c_7.py index b9f87f69effb..7c2f7864960c 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_7.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_7.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_7: -.. parsed-literal:: - q_0: ──■────■────■────■────■─────────■────■─────── - ┌─┴─┐ │ ┌─┴─┐┌─┴─┐ │ ┌───┐ │ │ ┌───┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_7(): """ + Template 9c_7: + + .. code-block:: text + + q_0: ──■────■────■────■────■─────────■────■─────── + ┌─┴─┐ │ ┌─┴─┐┌─┴─┐ │ ┌───┐ │ │ ┌───┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├──┼──┤ X ├──■────┼──┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_8.py b/qiskit/circuit/library/templates/nct/template_nct_9c_8.py index 5aef004288d5..b575a053e096 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_8.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_8.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_8: -.. parsed-literal:: - q_0: ──■─────────■────■─────────■──────────────■── - ┌─┴─┐ ┌─┴─┐┌─┴─┐ ┌─┴─┐ ┌─┴─┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_8(): """ + Template 9c_8: + + .. code-block:: text + + q_0: ──■─────────■────■─────────■──────────────■── + ┌─┴─┐ ┌─┴─┐┌─┴─┐ ┌─┴─┐ ┌─┴─┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9c_9.py b/qiskit/circuit/library/templates/nct/template_nct_9c_9.py index a342f521bbe4..bbeb235d6890 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9c_9.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9c_9.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9c_9: -.. parsed-literal:: - q_0: ──■────■────■────■─────────■────■─────────■── - ┌─┴─┐ │ ┌─┴─┐┌─┴─┐ ┌─┴─┐ │ ┌─┴─┐ - q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ - └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ - q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── - └───┘ └───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9c_9(): """ + Template 9c_9: + + .. code-block:: text + + q_0: ──■────■────■────■─────────■────■─────────■── + ┌─┴─┐ │ ┌─┴─┐┌─┴─┐ ┌─┴─┐ │ ┌─┴─┐ + q_1: ┤ X ├──■──┤ X ├┤ X ├─────┤ X ├──■───────┤ X ├ + └─┬─┘┌─┴─┐└───┘└─┬─┘┌───┐└─┬─┘┌─┴─┐┌───┐└─┬─┘ + q_2: ──■──┤ X ├───────■──┤ X ├──■──┤ X ├┤ X ├──■── + └───┘ └───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_1.py b/qiskit/circuit/library/templates/nct/template_nct_9d_1.py index 8a41397341f5..3e123fd25139 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_1.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_1.py @@ -10,21 +10,23 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_1: -.. parsed-literal:: - ┌───┐ ┌───┐ ┌───┐ - q_0: ──■───────┤ X ├───────■──┤ X ├───────■──┤ X ├ - ┌─┴─┐┌───┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ - q_1: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_1(): """ + Template 9d_1: + + .. code-block:: text + + ┌───┐ ┌───┐ ┌───┐ + q_0: ──■───────┤ X ├───────■──┤ X ├───────■──┤ X ├ + ┌─┴─┐┌───┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ + q_1: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_10.py b/qiskit/circuit/library/templates/nct/template_nct_9d_10.py index 863a0f77c3ea..2cd285f3bc8c 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_10.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_10.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_10: -.. parsed-literal:: - q_0: ──■────■────■────■────■────■────■────■────■── - │ │ ┌─┴─┐ │ │ ┌─┴─┐ │ │ ┌─┴─┐ - q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_10(): """ + Template 9d_10: + + .. code-block:: text + + q_0: ──■────■────■────■────■────■────■────■────■── + │ │ ┌─┴─┐ │ │ ┌─┴─┐ │ │ ┌─┴─┐ + q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_2.py b/qiskit/circuit/library/templates/nct/template_nct_9d_2.py index 26bbd63f5b42..b4f259002b69 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_2.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_2.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_2: -.. parsed-literal:: - q_0: ──■────■────■──────────────■──────────────■── - │ │ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ - q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_2(): """ + Template 9d_2: + + .. code-block:: text + + q_0: ──■────■────■──────────────■──────────────■── + │ │ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ + q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_3.py b/qiskit/circuit/library/templates/nct/template_nct_9d_3.py index acb64fa5b934..1fa4f0a5d649 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_3.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_3.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_3: -.. parsed-literal:: - q_0: ──■────■───────────────────■───────────────── - │ │ ┌───┐ ┌─┴─┐ ┌───┐ - q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_3(): """ + Template 9d_3: + + .. code-block:: text + + q_0: ──■────■───────────────────■───────────────── + │ │ ┌───┐ ┌─┴─┐ ┌───┐ + q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_4.py b/qiskit/circuit/library/templates/nct/template_nct_9d_4.py index 7a485fba6d9c..c0ec10ccf102 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_4.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_4.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_4: -.. parsed-literal:: - q_0: ───────■─────────■──────────────■──────────── - │ ┌───┐ │ ┌───┐ │ ┌───┐ - q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_4(): """ + Template 9d_4: + + .. code-block:: text + + q_0: ───────■─────────■──────────────■──────────── + │ ┌───┐ │ ┌───┐ │ ┌───┐ + q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_5.py b/qiskit/circuit/library/templates/nct/template_nct_9d_5.py index 4cf1b96dfd2d..531df1cf5380 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_5.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_5.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_5: -.. parsed-literal:: - q_0: ──■────■─────────■─────────■────■──────────── - │ │ ┌───┐ │ ┌─┴─┐ │ ┌───┐ - q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_5(): """ + Template 9d_5: + + .. code-block:: text + + q_0: ──■────■─────────■─────────■────■──────────── + │ │ ┌───┐ │ ┌─┴─┐ │ ┌───┐ + q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_6.py b/qiskit/circuit/library/templates/nct/template_nct_9d_6.py index bfedf9a63117..bc9cc45f0985 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_6.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_6.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_6: -.. parsed-literal:: - q_0: ──■────■──────────────■────■─────────■─────── - │ │ ┌───┐ │ ┌─┴─┐ │ ┌───┐ - q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_6(): """ + Template 9d_6: + + .. code-block:: text + + q_0: ──■────■──────────────■────■─────────■─────── + │ │ ┌───┐ │ ┌─┴─┐ │ ┌───┐ + q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_7.py b/qiskit/circuit/library/templates/nct/template_nct_9d_7.py index c88a4dfca732..36eee6e5535c 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_7.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_7.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_7: -.. parsed-literal:: - q_0: ──■────■─────────■────■────■────■────■─────── - │ │ ┌───┐ │ │ ┌─┴─┐ │ │ ┌───┐ - q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_7(): """ + Template 9d_7: + + .. code-block:: text + + q_0: ──■────■─────────■────■────■────■────■─────── + │ │ ┌───┐ │ │ ┌─┴─┐ │ │ ┌───┐ + q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_8.py b/qiskit/circuit/library/templates/nct/template_nct_9d_8.py index 083b3f6471c7..5b891ebb7867 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_8.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_8.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_8: -.. parsed-literal:: - q_0: ──■────■────■────■─────────■────■─────────■── - │ │ ┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ - q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_8(): """ + Template 9d_8: + + .. code-block:: text + + q_0: ──■────■────■────■─────────■────■─────────■── + │ │ ┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ + q_1: ──■────┼──┤ X ├──┼────■──┤ X ├──┼────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘┌─┴─┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/nct/template_nct_9d_9.py b/qiskit/circuit/library/templates/nct/template_nct_9d_9.py index f2523e7c1370..617e26d66d50 100644 --- a/qiskit/circuit/library/templates/nct/template_nct_9d_9.py +++ b/qiskit/circuit/library/templates/nct/template_nct_9d_9.py @@ -10,22 +10,24 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -Template 9d_9: -.. parsed-literal:: - q_0: ──■────■────■─────────■────■─────────■────■── - │ │ ┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ - q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ - ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ - q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── - └───┘└───┘ └───┘└───┘ └───┘└───┘ -""" +# pylint: disable=missing-module-docstring from qiskit.circuit.quantumcircuit import QuantumCircuit def template_nct_9d_9(): """ + Template 9d_9: + + .. code-block:: text + + q_0: ──■────■────■─────────■────■─────────■────■── + │ │ ┌─┴─┐ │ ┌─┴─┐ │ ┌─┴─┐ + q_1: ──■────┼──┤ X ├───────■──┤ X ├───────■──┤ X ├ + ┌─┴─┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘┌───┐┌─┴─┐└─┬─┘ + q_2: ┤ X ├┤ X ├──■──┤ X ├┤ X ├──■──┤ X ├┤ X ├──■── + └───┘└───┘ └───┘└───┘ └───┘└───┘ + Returns: QuantumCircuit: template as a quantum circuit. """ diff --git a/qiskit/circuit/library/templates/rzx/rzx_cy.py b/qiskit/circuit/library/templates/rzx/rzx_cy.py index 6f1caf6116b3..1a9877c33f2a 100644 --- a/qiskit/circuit/library/templates/rzx/rzx_cy.py +++ b/qiskit/circuit/library/templates/rzx/rzx_cy.py @@ -10,15 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -RZX based template for CX - RYGate - CX -.. parsed-literal:: - ┌──────────┐ -q_0: ──■─────────────■─────────────────────────────────┤0 ├─────────── - ┌─┴─┐┌───────┐┌─┴─┐┌────────┐┌──────────┐┌───────┐│ RZX(-ϴ) │┌─────────┐ -q_1: ┤ X ├┤ RY(ϴ) ├┤ X ├┤ RY(-ϴ) ├┤ RZ(-π/2) ├┤ RX(ϴ) ├┤1 ├┤ RZ(π/2) ├ - └───┘└───────┘└───┘└────────┘└──────────┘└───────┘└──────────┘└─────────┘ -""" +# pylint: disable=missing-module-docstring from __future__ import annotations @@ -29,7 +21,16 @@ def rzx_cy(theta: ParameterValueType | None = None): - """Template for CX - RYGate - CX.""" + """RZX-based template for CX - RYGate - CX. + + .. code-block:: text + + ┌──────────┐ + q_0: ──■─────────────■─────────────────────────────────┤0 ├─────────── + ┌─┴─┐┌───────┐┌─┴─┐┌────────┐┌──────────┐┌───────┐│ RZX(-ϴ) │┌─────────┐ + q_1: ┤ X ├┤ RY(ϴ) ├┤ X ├┤ RY(-ϴ) ├┤ RZ(-π/2) ├┤ RX(ϴ) ├┤1 ├┤ RZ(π/2) ├ + └───┘└───────┘└───┘└────────┘└──────────┘└───────┘└──────────┘└─────────┘ + """ if theta is None: theta = Parameter("ϴ") diff --git a/qiskit/circuit/library/templates/rzx/rzx_xz.py b/qiskit/circuit/library/templates/rzx/rzx_xz.py index 5be019c17efe..bf0525c19df8 100644 --- a/qiskit/circuit/library/templates/rzx/rzx_xz.py +++ b/qiskit/circuit/library/templates/rzx/rzx_xz.py @@ -10,20 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -RZX based template for CX - RXGate - CX -.. parsed-literal:: - ┌───┐ ┌───┐┌─────────┐┌─────────┐┌─────────┐┌──────────┐» -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: ───────────────────────────────── -« -""" +# pylint: disable=missing-module-docstring from __future__ import annotations @@ -34,7 +21,21 @@ def rzx_xz(theta: ParameterValueType | None = None): - """Template for CX - RXGate - CX.""" + """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: ───────────────────────────────── + « + """ if theta is None: theta = Parameter("ϴ") diff --git a/qiskit/circuit/library/templates/rzx/rzx_yz.py b/qiskit/circuit/library/templates/rzx/rzx_yz.py index 552ad0e2daf9..f3e1a97e14cc 100644 --- a/qiskit/circuit/library/templates/rzx/rzx_yz.py +++ b/qiskit/circuit/library/templates/rzx/rzx_yz.py @@ -10,15 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -RZX based template for CX - RYGate - CX -.. parsed-literal:: - ┌────────┐ ┌─────────┐┌─────────┐┌──────────┐ -q_0: ──■──┤ RY(-ϴ) ├──■──┤ RX(π/2) ├┤0 ├┤ RX(-π/2) ├ - ┌─┴─┐└────────┘┌─┴─┐└─────────┘│ RZX(ϴ) │└──────────┘ -q_1: ┤ X ├──────────┤ X ├───────────┤1 ├──────────── - └───┘ └───┘ └─────────┘ -""" +# pylint: disable=missing-module-docstring + from __future__ import annotations import numpy as np @@ -28,7 +21,16 @@ def rzx_yz(theta: ParameterValueType | None = None): - """Template for CX - RYGate - CX.""" + """RZX-based template for CX - RYGate - CX. + + .. code-block:: text + + ┌────────┐ ┌─────────┐┌─────────┐┌──────────┐ + q_0: ──■──┤ RY(-ϴ) ├──■──┤ RX(π/2) ├┤0 ├┤ RX(-π/2) ├ + ┌─┴─┐└────────┘┌─┴─┐└─────────┘│ RZX(ϴ) │└──────────┘ + q_1: ┤ X ├──────────┤ X ├───────────┤1 ├──────────── + └───┘ └───┘ └─────────┘ + """ if theta is None: theta = Parameter("ϴ") diff --git a/qiskit/circuit/library/templates/rzx/rzx_zz1.py b/qiskit/circuit/library/templates/rzx/rzx_zz1.py index 628af513eaff..3a0c7fbdfd1a 100644 --- a/qiskit/circuit/library/templates/rzx/rzx_zz1.py +++ b/qiskit/circuit/library/templates/rzx/rzx_zz1.py @@ -10,25 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -RZX based template for CX - phase - CX -.. parsed-literal:: - » -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) ├ -« └─────────┘ -""" +# pylint: disable=missing-module-docstring + from __future__ import annotations import numpy as np @@ -38,7 +21,26 @@ def rzx_zz1(theta: ParameterValueType | None = None): - """Template for CX - RZGate - CX.""" + """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) ├ + « └─────────┘ + """ if theta is None: theta = Parameter("ϴ") diff --git a/qiskit/circuit/library/templates/rzx/rzx_zz2.py b/qiskit/circuit/library/templates/rzx/rzx_zz2.py index 334f25fffe9f..a406e1c3da3d 100644 --- a/qiskit/circuit/library/templates/rzx/rzx_zz2.py +++ b/qiskit/circuit/library/templates/rzx/rzx_zz2.py @@ -10,20 +10,7 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -RZX based template for CX - PhaseGate - CX -.. parsed-literal:: - » -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) ├ -« └──────────┘└─────────┘└─────────┘└─────────┘ -""" +# pylint: disable=missing-module-docstring from __future__ import annotations @@ -34,7 +21,21 @@ def rzx_zz2(theta: ParameterValueType | None = None): - """Template for CX - RZGate - CX.""" + """RZX-based template for CX - PhaseGate - 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) ├ + « └──────────┘└─────────┘└─────────┘└─────────┘ + """ if theta is None: theta = Parameter("ϴ") diff --git a/qiskit/circuit/library/templates/rzx/rzx_zz3.py b/qiskit/circuit/library/templates/rzx/rzx_zz3.py index 83c8e1d66425..4867f913c6be 100644 --- a/qiskit/circuit/library/templates/rzx/rzx_zz3.py +++ b/qiskit/circuit/library/templates/rzx/rzx_zz3.py @@ -10,20 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -""" -RZX based template for CX - RZGate - CX -.. parsed-literal:: - » -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) ├ -« └──────────┘└─────────┘└─────────┘└─────────┘ -""" +# pylint: disable=missing-module-docstring + from __future__ import annotations import numpy as np @@ -33,7 +21,21 @@ def rzx_zz3(theta: ParameterValueType | None = None): - """Template for CX - RZGate - CX.""" + """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) ├ + « └──────────┘└─────────┘└─────────┘└─────────┘ + """ if theta is None: theta = Parameter("ϴ") diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py index 1c132eb0a7e4..164dca16c00b 100644 --- a/qiskit/circuit/quantumcircuit.py +++ b/qiskit/circuit/quantumcircuit.py @@ -876,7 +876,7 @@ class QuantumCircuit: qc.count_ops() - .. parsed-literal:: + .. code-block:: text OrderedDict([('cx', 8), ('h', 5), ('x', 3), ('swap', 3)]) @@ -1512,7 +1512,7 @@ def reverse_ops(self) -> "QuantumCircuit": input: - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ H ├─────■────── @@ -1522,7 +1522,7 @@ def reverse_ops(self) -> "QuantumCircuit": output: - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ─────■──────┤ H ├ @@ -1556,7 +1556,7 @@ def reverse_bits(self) -> "QuantumCircuit": input: - .. parsed-literal:: + .. code-block:: text ┌───┐ a_0: ┤ H ├──■───────────────── @@ -1572,7 +1572,7 @@ def reverse_bits(self) -> "QuantumCircuit": output: - .. parsed-literal:: + .. code-block:: text ┌───┐ b_0: ────────────────────┤ X ├ @@ -1626,7 +1626,7 @@ def inverse(self, annotated: bool = False) -> "QuantumCircuit": input: - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ┤ H ├─────■────── @@ -1636,7 +1636,7 @@ def inverse(self, annotated: bool = False) -> "QuantumCircuit": output: - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ──────■──────┤ H ├ @@ -1878,7 +1878,7 @@ def compose( >>> lhs.compose(rhs, qubits=[3, 2], inplace=True) - .. parsed-literal:: + .. code-block:: text ┌───┐ ┌─────┐ ┌───┐ lqr_1_0: ───┤ H ├─── rqr_0: ──■──┤ Tdg ├ lqr_1_0: ───┤ H ├─────────────── @@ -2129,7 +2129,7 @@ def tensor(self, other: "QuantumCircuit", inplace: bool = False) -> Optional["Qu `the docs `__ for more information. - .. parsed-literal:: + .. code-block:: text ┌────────┐ ┌─────┐ ┌─────┐ q_0: ┤ bottom ├ ⊗ q_0: ┤ top ├ = q_0: ─┤ top ├── @@ -3874,7 +3874,7 @@ def measure(self, qubit: QubitSpecifier, cbit: ClbitSpecifier) -> InstructionSet circuit.draw() - .. parsed-literal:: + .. code-block:: text ┌───┐┌─┐ q: ┤ H ├┤M├ @@ -5702,7 +5702,7 @@ def prepare_state( output: - .. parsed-literal:: + .. code-block:: text ┌─────────────────────────────────────┐ q_0: ┤ State Preparation(0.70711,-0.70711) ├ @@ -5725,7 +5725,7 @@ def prepare_state( output: - .. parsed-literal:: + .. code-block:: text ┌─────────────────────────┐ q_0: ┤0 ├ @@ -5746,7 +5746,7 @@ def prepare_state( output: - .. parsed-literal:: + .. code-block:: text ┌───────────────────────────────────────────┐ q_0: ┤0 ├ @@ -5817,7 +5817,7 @@ class to prepare the qubits in a specified state. output: - .. parsed-literal:: + .. code-block:: text ┌──────────────────────────────┐ q_0: ┤ Initialize(0.70711,-0.70711) ├ @@ -5840,7 +5840,7 @@ class to prepare the qubits in a specified state. output: - .. parsed-literal:: + .. code-block:: text ┌──────────────────┐ q_0: ┤0 ├ @@ -5861,7 +5861,7 @@ class to prepare the qubits in a specified state. output: - .. parsed-literal:: + .. code-block:: text ┌────────────────────────────────────┐ q_0: ┤0 ├ diff --git a/qiskit/dagcircuit/dagdependency.py b/qiskit/dagcircuit/dagdependency.py index 63b91f920631..7f0b1a5801d4 100644 --- a/qiskit/dagcircuit/dagdependency.py +++ b/qiskit/dagcircuit/dagdependency.py @@ -71,7 +71,7 @@ class DAGDependency: Bell circuit with no measurement. - .. parsed-literal:: + .. code-block:: text ┌───┐ qr_0: ┤ H ├──■── diff --git a/qiskit/dagcircuit/dagdependency_v2.py b/qiskit/dagcircuit/dagdependency_v2.py index e50c47b24f90..0bfdd53d40c4 100644 --- a/qiskit/dagcircuit/dagdependency_v2.py +++ b/qiskit/dagcircuit/dagdependency_v2.py @@ -56,7 +56,7 @@ class _DAGDependencyV2: Bell circuit with no measurement. - .. parsed-literal:: + .. code-block:: text ┌───┐ qr_0: ┤ H ├──■── diff --git a/qiskit/passmanager/__init__.py b/qiskit/passmanager/__init__.py index ce90335cc118..9c1ea0577b7b 100644 --- a/qiskit/passmanager/__init__.py +++ b/qiskit/passmanager/__init__.py @@ -133,7 +133,7 @@ def run(self, passmanager_ir: str): Output: -.. parsed-literal:: +.. code-block:: text [12346789, 464, 36784] @@ -178,7 +178,7 @@ def digit_condition(property_set): Output: -.. parsed-literal:: +.. code-block:: text [12346789, 45654, 36784] diff --git a/qiskit/pulse/builder.py b/qiskit/pulse/builder.py index 0c8391dc99ba..09d06cb5242d 100644 --- a/qiskit/pulse/builder.py +++ b/qiskit/pulse/builder.py @@ -257,7 +257,7 @@ d0 = pulse.drive_channel(0) print(d0) -.. parsed-literal:: +.. code-block:: text DriveChannel(0) @@ -362,7 +362,7 @@ mem_slot = pulse.measure(0) print(mem_slot) -.. parsed-literal:: +.. code-block:: text MemorySlot(0) @@ -396,7 +396,7 @@ print('There are {} seconds in {} samples.'.format( seconds, pulse.seconds_to_samples(1e-6))) -.. parsed-literal:: +.. code-block:: text Number of qubits in backend: 1 There are 160 samples in 3.5555555555555554e-08 seconds @@ -889,7 +889,7 @@ def append_instruction(instruction: instructions.Instruction): print(pulse_prog.instructions) - .. parsed-literal:: + .. code-block:: text ((0, Delay(10, DriveChannel(0))),) """ @@ -911,7 +911,7 @@ def num_qubits() -> int: with pulse.build(backend): print(pulse.num_qubits()) - .. parsed-literal:: + .. code-block:: text 2 @@ -968,7 +968,7 @@ def qubit_channels(qubit: int) -> set[chans.Channel]: with pulse.build(backend): print(pulse.qubit_channels(0)) - .. parsed-literal:: + .. code-block:: text {MeasureChannel(0), ControlChannel(0), DriveChannel(0), AcquireChannel(0), ControlChannel(1)} @@ -1743,7 +1743,7 @@ def call( print(pulse_prog) - .. parsed-literal:: + .. code-block:: text ScheduleBlock( ScheduleBlock( @@ -1764,7 +1764,7 @@ def call( print(pulse_prog.references) - .. parsed-literal:: + .. code-block:: text ReferenceManager: - ('block0', '634b3b50bd684e26a673af1fbd2d6c81'): ScheduleBlock(Play(Gaussian(... @@ -1784,7 +1784,7 @@ def call( print(pulse_prog) - .. parsed-literal:: + .. code-block:: text ScheduleBlock( ScheduleBlock( @@ -1824,7 +1824,7 @@ def call( print(pulse_prog) - .. parsed-literal:: + .. code-block:: text ScheduleBlock( ScheduleBlock( @@ -1848,7 +1848,7 @@ def call( print(pulse_prog) - .. parsed-literal:: + .. code-block:: text ScheduleBlock( Call( diff --git a/qiskit/pulse/schedule.py b/qiskit/pulse/schedule.py index 7ec234cffa78..c8d5a3510fb1 100644 --- a/qiskit/pulse/schedule.py +++ b/qiskit/pulse/schedule.py @@ -902,7 +902,7 @@ class ScheduleBlock: sched_outer.assign_references({("grand_child",): sched_inner}) print(sched_outer.parameters) - .. parsed-literal:: + .. code-block:: text {Parameter(amp1), Parameter(amp2)} @@ -916,7 +916,7 @@ class ScheduleBlock: print(sched_outer.references) - .. parsed-literal:: + .. code-block:: text ReferenceManager: - ('grand_child',): ScheduleBlock(Play(Constant(duration=100, amp=amp1,... @@ -935,7 +935,7 @@ class ScheduleBlock: print(main.parameters) - .. parsed-literal:: + .. code-block:: text {Parameter(amp1), Parameter(amp2), Parameter(amp3} @@ -948,7 +948,7 @@ class ScheduleBlock: print(main.references) - .. parsed-literal:: + .. code-block:: text ReferenceManager: - ('child',): ScheduleBlock(ScheduleBlock(ScheduleBlock(Play(Con... diff --git a/qiskit/pulse/transforms/alignments.py b/qiskit/pulse/transforms/alignments.py index e608b1b636d0..bc0df39efeab 100644 --- a/qiskit/pulse/transforms/alignments.py +++ b/qiskit/pulse/transforms/alignments.py @@ -53,7 +53,7 @@ def is_sequential(self) -> bool: When the context has two pulses in different channels, a sequential context subtype intends to return following scheduling outcome. - .. parsed-literal:: + .. code-block:: text ┌────────┐ D0: ┤ pulse1 ├──────────── @@ -63,7 +63,7 @@ def is_sequential(self) -> bool: On the other hand, parallel context with ``is_sequential=False`` returns - .. parsed-literal:: + .. code-block:: text ┌────────┐ D0: ┤ pulse1 ├ diff --git a/qiskit/quantum_info/operators/dihedral/dihedral.py b/qiskit/quantum_info/operators/dihedral/dihedral.py index bcd9f6b094ae..8389061495f6 100644 --- a/qiskit/quantum_info/operators/dihedral/dihedral.py +++ b/qiskit/quantum_info/operators/dihedral/dihedral.py @@ -62,7 +62,7 @@ class CNOTDihedral(BaseOperator, AdjointMixin): # Print the CNOTDihedral element print(elem) - .. parsed-literal:: + .. code-block:: text phase polynomial = 0 + 3*x_0 + 3*x_1 + 2*x_0*x_1 diff --git a/qiskit/quantum_info/operators/symplectic/clifford.py b/qiskit/quantum_info/operators/symplectic/clifford.py index 435120dd531b..4064e0e3704d 100644 --- a/qiskit/quantum_info/operators/symplectic/clifford.py +++ b/qiskit/quantum_info/operators/symplectic/clifford.py @@ -92,7 +92,7 @@ class Clifford(BaseOperator, AdjointMixin, Operation): # Print the Clifford stabilizer rows print(cliff.to_labels(mode="S")) - .. parsed-literal:: + .. code-block:: text Clifford: Stabilizer = ['+XX', '+ZZ'], Destabilizer = ['+IZ', '+XI'] ['+IZ', '+XI'] diff --git a/qiskit/quantum_info/operators/symplectic/pauli_list.py b/qiskit/quantum_info/operators/symplectic/pauli_list.py index 2b6e5a8774cb..02f9a78052b7 100644 --- a/qiskit/quantum_info/operators/symplectic/pauli_list.py +++ b/qiskit/quantum_info/operators/symplectic/pauli_list.py @@ -80,7 +80,7 @@ class PauliList(BasePauli, LinearMixin, GroupMixin): pauli_list = PauliList.from_symplectic(z, x, phase) print("4. ", pauli_list) - .. parsed-literal:: + .. code-block:: text 1. ['II', 'ZI', '-iYY'] 2. ['iXI'] @@ -100,7 +100,7 @@ class PauliList(BasePauli, LinearMixin, GroupMixin): print("List: ", repr(pauli_list[[0, 2]])) print("Slice: ", repr(pauli_list[0:2])) - .. parsed-literal:: + .. code-block:: text Integer: Pauli('ZZ') List: PauliList(['XX', 'IZ']) @@ -568,7 +568,7 @@ def sort(self, weight: bool = False, phase: bool = False) -> PauliList: print('Weight sorted') print(srt) - .. parsed-literal:: + .. code-block:: text Initial Ordering ['YX', 'ZZ', 'XZ', 'YI', 'YZ', 'II', 'XX', 'XI', 'XY', 'YY', 'IX', 'IZ', @@ -603,7 +603,7 @@ def unique(self, return_index: bool = False, return_counts: bool = False) -> Pau unique = pt.unique() print(unique) - .. parsed-literal:: + .. code-block:: text ['X', 'Y', '-X', 'I', 'Z', 'iZ'] diff --git a/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py b/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py index 5699944788be..8bf7b3848c46 100644 --- a/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py +++ b/qiskit/quantum_info/operators/symplectic/sparse_pauli_op.py @@ -560,7 +560,7 @@ def argsort(self, weight: bool = False): print('Weight sorted') print(srt) - .. parsed-literal:: + .. code-block:: text Initial Ordering SparsePauliOp(['XX', 'XX', 'XX', 'YI', 'II', 'XZ', 'XY', 'XI'], @@ -629,7 +629,7 @@ def sort(self, weight: bool = False): print('Weight sorted') print(srt) - .. parsed-literal:: + .. code-block:: text Initial Ordering SparsePauliOp(['XX', 'XX', 'XX', 'YI', 'II', 'XZ', 'XY', 'XI'], diff --git a/qiskit/quantum_info/states/densitymatrix.py b/qiskit/quantum_info/states/densitymatrix.py index 7826e3f22fec..33fb937780a9 100644 --- a/qiskit/quantum_info/states/densitymatrix.py +++ b/qiskit/quantum_info/states/densitymatrix.py @@ -461,7 +461,7 @@ def probabilities( probs_qubit_1 = rho.probabilities([1]) print('Qubit-1 probs: {}'.format(probs_qubit_1)) - .. parsed-literal:: + .. code-block:: text probs: [0.5 0. 0.5 0. ] Qubit-0 probs: [1. 0.] @@ -485,7 +485,7 @@ def probabilities( probs_swapped = rho.probabilities([1, 0]) print('Swapped probs: {}'.format(probs_swapped)) - .. parsed-literal:: + .. code-block:: text probs: [0.5 0. 0.5 0. ] Swapped probs: [0.5 0.5 0. 0. ] @@ -654,7 +654,7 @@ def to_dict(self, decimals: None | int = None) -> dict: rho = DensityMatrix.from_label('-0') print(rho.to_dict()) - .. parsed-literal:: + .. code-block:: text { '00|00': (0.4999999999999999+0j), @@ -679,7 +679,7 @@ def to_dict(self, decimals: None | int = None) -> dict: rho = DensityMatrix(mat, dims=(3, 3)) print(rho.to_dict()) - .. parsed-literal:: + .. code-block:: text {'00|00': (0.25+0j), '10|10': (0.25+0j), '20|20': (0.25+0j), '22|22': (0.25+0j)} @@ -698,7 +698,7 @@ def to_dict(self, decimals: None | int = None) -> dict: rho = DensityMatrix(mat, dims=(2, 10)) print(rho.to_dict()) - .. parsed-literal:: + .. code-block:: text {'00|00': (0.5+0j), '91|91': (0.5+0j)} """ diff --git a/qiskit/quantum_info/states/stabilizerstate.py b/qiskit/quantum_info/states/stabilizerstate.py index 16abb67f2237..4da5808ebfa2 100644 --- a/qiskit/quantum_info/states/stabilizerstate.py +++ b/qiskit/quantum_info/states/stabilizerstate.py @@ -54,7 +54,7 @@ class StabilizerState(QuantumState): # Calculate expectation value of the StabilizerState print (stab.expectation_value(Pauli('ZZ'))) - .. parsed-literal:: + .. code-block:: text StabilizerState(StabilizerTable: ['+XX', '+ZZ']) {'00': 0.5, '11': 0.5} diff --git a/qiskit/quantum_info/states/statevector.py b/qiskit/quantum_info/states/statevector.py index 7fa14eaac9da..901ce95af424 100644 --- a/qiskit/quantum_info/states/statevector.py +++ b/qiskit/quantum_info/states/statevector.py @@ -554,7 +554,7 @@ def probabilities( probs_qubit_1 = psi.probabilities([1]) print('Qubit-1 probs: {}'.format(probs_qubit_1)) - .. parsed-literal:: + .. code-block:: text probs: [0.5 0. 0.5 0. ] Qubit-0 probs: [1. 0.] @@ -578,7 +578,7 @@ def probabilities( probs_swapped = psi.probabilities([1, 0]) print('Swapped probs: {}'.format(probs_swapped)) - .. parsed-literal:: + .. code-block:: text probs: [0.5 0. 0.5 0. ] Swapped probs: [0.5 0.5 0. 0. ] @@ -794,7 +794,7 @@ def to_dict(self, decimals: None | int = None) -> dict: psi = Statevector.from_label('-0') print(psi.to_dict()) - .. parsed-literal:: + .. code-block:: text {'00': (0.7071067811865475+0j), '10': (-0.7071067811865475+0j)} @@ -812,7 +812,7 @@ def to_dict(self, decimals: None | int = None) -> dict: psi = Statevector(vec, dims=(3, 3)) print(psi.to_dict()) - .. parsed-literal:: + .. code-block:: text {'00': (0.7071067811865475+0j), '22': (0.7071067811865475+0j)} @@ -831,7 +831,7 @@ def to_dict(self, decimals: None | int = None) -> dict: psi = Statevector(vec, dims=(2, 10)) print(psi.to_dict()) - .. parsed-literal:: + .. code-block:: text {'00': (0.7071067811865475+0j), '91': (0.7071067811865475+0j)} diff --git a/qiskit/synthesis/clifford/clifford_decompose_layers.py b/qiskit/synthesis/clifford/clifford_decompose_layers.py index 8b745823dc10..e4d71b66a1b1 100644 --- a/qiskit/synthesis/clifford/clifford_decompose_layers.py +++ b/qiskit/synthesis/clifford/clifford_decompose_layers.py @@ -77,7 +77,8 @@ def synth_clifford_layers( For example, a 5-qubit Clifford circuit is decomposed into the following layers: - .. parsed-literal:: + .. code-block:: text + ┌─────┐┌─────┐┌────────┐┌─────┐┌─────┐┌─────┐┌─────┐┌────────┐ q_0: ┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├ │ ││ ││ ││ ││ ││ ││ ││ │ diff --git a/qiskit/synthesis/evolution/product_formula.py b/qiskit/synthesis/evolution/product_formula.py index df38a2a541ab..28bbc5711bf8 100644 --- a/qiskit/synthesis/evolution/product_formula.py +++ b/qiskit/synthesis/evolution/product_formula.py @@ -292,7 +292,7 @@ def cnot_chain(pauli: Pauli) -> QuantumCircuit: For example, for the Pauli with the label 'XYZIX'. - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ──────────┤ X ├ @@ -337,7 +337,7 @@ def cnot_fountain(pauli: Pauli) -> QuantumCircuit: For example, for the Pauli with the label 'XYZIX'. - .. parsed-literal:: + .. code-block:: text ┌───┐┌───┐┌───┐ q_0: ┤ X ├┤ X ├┤ X ├ diff --git a/qiskit/synthesis/stabilizer/stabilizer_decompose.py b/qiskit/synthesis/stabilizer/stabilizer_decompose.py index ef324bc3cad1..f5498bd3bb61 100644 --- a/qiskit/synthesis/stabilizer/stabilizer_decompose.py +++ b/qiskit/synthesis/stabilizer/stabilizer_decompose.py @@ -46,7 +46,8 @@ def synth_stabilizer_layers( For example, a 5-qubit stabilizer state is decomposed into the following layers: - .. parsed-literal:: + .. code-block:: text + ┌─────┐┌─────┐┌─────┐┌─────┐┌────────┐ q_0: ┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├ │ ││ ││ ││ ││ │ diff --git a/qiskit/synthesis/unitary/qsd.py b/qiskit/synthesis/unitary/qsd.py index 41a1fb77356c..12e8fc0f9f7a 100644 --- a/qiskit/synthesis/unitary/qsd.py +++ b/qiskit/synthesis/unitary/qsd.py @@ -47,7 +47,8 @@ def qs_decomposition( This decomposition is described in Shende et al. [1]. - .. parsed-literal:: + .. code-block:: text + ┌───┐ ┌───┐ ┌───┐ ┌───┐ ─┤ ├─ ───────┤ Rz├─────┤ Ry├─────┤ Rz├───── │ │ ≃ ┌───┐└─┬─┘┌───┐└─┬─┘┌───┐└─┬─┘┌───┐ diff --git a/qiskit/transpiler/__init__.py b/qiskit/transpiler/__init__.py index 954b8045d6b5..1b3a3841e94f 100644 --- a/qiskit/transpiler/__init__.py +++ b/qiskit/transpiler/__init__.py @@ -258,7 +258,7 @@ ) print(target) -.. parsed-literal:: +.. code-block:: text Target Number of qubits: 3 @@ -583,7 +583,7 @@ print('Original depth:', qc.depth(), 'Decomposed Depth:', qc_basis.depth()) -.. parsed-literal:: +.. code-block:: text Original depth: 4 Decomposed Depth: 10 @@ -603,7 +603,7 @@ print(backend.operation_names) - .. parsed-literal:: + .. code-block:: text ['id', 'rz', 'sx', 'x', 'cx', 'measure', 'delay'] @@ -1022,7 +1022,7 @@ conditioned on the same register could commute, i.e. read-access to the classical register doesn't change its state. -.. parsed-literal:: +.. code-block:: text qc = QuantumCircuit(2, 1) qc.delay(100, 0) @@ -1033,7 +1033,7 @@ DAG circuit. Accordingly, the `asap`-scheduled circuit will become -.. parsed-literal:: +.. code-block:: text ┌────────────────┐ ┌───┐ q_0: ┤ Delay(100[dt]) ├───┤ X ├────────────── @@ -1060,7 +1060,7 @@ A sequence from t0 to t1 of the measure instruction interval could be modeled as follows: -.. parsed-literal:: +.. code-block:: text Q ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ B ░░▒▒▒▒▒▒▒▒░░░░░░░░░ @@ -1075,7 +1075,7 @@ The lack of precision representing the physical model may induce edge cases in the scheduling: -.. parsed-literal:: +.. code-block:: text ┌───┐ q_0: ───┤ X ├────── @@ -1094,7 +1094,7 @@ simultaneously operated. If one tries to `alap`-schedule this circuit, it may return following circuit: -.. parsed-literal:: +.. code-block:: text ┌────────────────┐ ┌───┐ q_0: ┤ Delay(500[dt]) ├───┤ X ├────── @@ -1110,7 +1110,7 @@ scheduled view. This behavior can be understood by considering the control flow model described above, -.. parsed-literal:: +.. code-block:: text : Quantum Circuit, first-measure 0 ░░░░░░░░░░░░▒▒▒▒▒▒░ @@ -1142,7 +1142,7 @@ Due to default latencies, the `alap`-scheduled circuit of above example may become -.. parsed-literal:: +.. code-block:: text ┌───┐ q_0: ───┤ X ├────── @@ -1156,7 +1156,8 @@ instructions, such as separately scheduling qubits and classical registers, the insertion of the delay yields an unnecessarily longer total execution time. -.. parsed-literal:: +.. code-block:: text + : Quantum Circuit, first-XGate 0 ░▒▒▒░░░░░░░░░░░░░░░ 1 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ @@ -1173,7 +1174,7 @@ If a finite conditional latency value is provided, for example, 30 dt, the circuit is scheduled as follows: -.. parsed-literal:: +.. code-block:: text ┌───────────────┐ ┌───┐ q_0: ┤ Delay(30[dt]) ├───┤ X ├────── @@ -1185,7 +1186,8 @@ with the timing model: -.. parsed-literal:: +.. code-block:: text + : Quantum Circuit, first-xgate 0 ░░▒▒▒░░░░░░░░░░░░░░░ 1 ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ diff --git a/qiskit/transpiler/passes/optimization/echo_rzx_weyl_decomposition.py b/qiskit/transpiler/passes/optimization/echo_rzx_weyl_decomposition.py index 482891a5ca41..4b96c9c86dfb 100644 --- a/qiskit/transpiler/passes/optimization/echo_rzx_weyl_decomposition.py +++ b/qiskit/transpiler/passes/optimization/echo_rzx_weyl_decomposition.py @@ -62,7 +62,7 @@ def _is_native(self, qubit_pair: Tuple) -> bool: def _echo_rzx_dag(theta): """Return the following circuit - .. parsed-literal:: + .. code-block:: text ┌───────────────┐┌───┐┌────────────────┐┌───┐ q_0: ┤0 ├┤ X ├┤0 ├┤ X ├ @@ -83,7 +83,7 @@ def _echo_rzx_dag(theta): def _reverse_echo_rzx_dag(theta): """Return the following circuit - .. parsed-literal:: + .. code-block:: text ┌───┐┌───────────────┐ ┌────────────────┐┌───┐ q_0: ┤ H ├┤1 ├─────┤1 ├┤ H ├───── diff --git a/qiskit/transpiler/passes/optimization/template_matching/template_substitution.py b/qiskit/transpiler/passes/optimization/template_matching/template_substitution.py index 44689894176a..f24538398cc0 100644 --- a/qiskit/transpiler/passes/optimization/template_matching/template_substitution.py +++ b/qiskit/transpiler/passes/optimization/template_matching/template_substitution.py @@ -450,7 +450,7 @@ def _attempt_bind(self, template_sublist, circuit_sublist): template_sublist and circuit_sublist match up to the assignment of the parameters. For example the template - .. parsed-literal:: + .. code-block:: text ┌───────────┐ ┌────────┐ q_0: ┤ P(-1.0*β) ├──■────────────■──┤0 ├ @@ -460,7 +460,7 @@ def _attempt_bind(self, template_sublist, circuit_sublist): should only maximally match once in the circuit - .. parsed-literal:: + .. code-block:: text ┌───────┐ q_0: ┤ P(-2) ├──■────────────■──────────────────────────── diff --git a/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py b/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py index ce47981ad2a6..b1e976f91f74 100644 --- a/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py +++ b/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/commuting_2q_gate_router.py @@ -41,7 +41,7 @@ class Commuting2qGateRouter(TransformationPass): qubit :class:`.PauliEvolutionGate` to qubits 0, 1, 3, and 4 of the five qubit device with the coupling map - .. parsed-literal:: + .. code-block:: text 0 -- 1 -- 2 | diff --git a/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/swap_strategy.py b/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/swap_strategy.py index 825c298dd304..97cd2c680d39 100644 --- a/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/swap_strategy.py +++ b/qiskit/transpiler/passes/routing/commuting_2q_gate_routing/swap_strategy.py @@ -30,7 +30,7 @@ class SwapStrategy: parallel. This means that a qubit can only be present once in a swap layer. For example, the following swap layers represent the optimal swap strategy for a line with five qubits - .. parsed-literal:: + .. code-block:: text ( ((0, 1), (2, 3)), # Swap layer no. 1 diff --git a/qiskit/transpiler/passes/scheduling/alignments/align_measures.py b/qiskit/transpiler/passes/scheduling/alignments/align_measures.py index adbf5d89dd25..5327d8b2a5ec 100644 --- a/qiskit/transpiler/passes/scheduling/alignments/align_measures.py +++ b/qiskit/transpiler/passes/scheduling/alignments/align_measures.py @@ -63,7 +63,7 @@ class AlignMeasures(TransformationPass): Examples: We assume executing the following circuit on a backend with ``alignment=16``. - .. parsed-literal:: + .. code-block:: text ┌───┐┌────────────────┐┌─┐ q_0: ┤ X ├┤ Delay(100[dt]) ├┤M├ @@ -74,7 +74,7 @@ class AlignMeasures(TransformationPass): Note that delay of 100 dt induces a misalignment of 4 dt at the measurement. This pass appends an extra 12 dt time shift to the input circuit. - .. parsed-literal:: + .. code-block:: text ┌───┐┌────────────────┐┌─┐ q_0: ┤ X ├┤ Delay(112[dt]) ├┤M├ diff --git a/qiskit/transpiler/passes/scheduling/alignments/reschedule.py b/qiskit/transpiler/passes/scheduling/alignments/reschedule.py index 416a92e10390..368ad458f173 100644 --- a/qiskit/transpiler/passes/scheduling/alignments/reschedule.py +++ b/qiskit/transpiler/passes/scheduling/alignments/reschedule.py @@ -35,7 +35,7 @@ class ConstrainedReschedule(AnalysisPass): We assume executing the following circuit on a backend with 16 dt of acquire alignment. - .. parsed-literal:: + .. code-block:: text ┌───┐┌────────────────┐┌─┐ q_0: ┤ X ├┤ Delay(100[dt]) ├┤M├ @@ -46,7 +46,7 @@ class ConstrainedReschedule(AnalysisPass): Note that delay of 100 dt induces a misalignment of 4 dt at the measurement. This pass appends an extra 12 dt time shift to the input circuit. - .. parsed-literal:: + .. code-block:: text ┌───┐┌────────────────┐┌─┐ q_0: ┤ X ├┤ Delay(112[dt]) ├┤M├ diff --git a/qiskit/transpiler/passes/scheduling/base_scheduler.py b/qiskit/transpiler/passes/scheduling/base_scheduler.py index fe6d0e16cb76..74256b33d351 100644 --- a/qiskit/transpiler/passes/scheduling/base_scheduler.py +++ b/qiskit/transpiler/passes/scheduling/base_scheduler.py @@ -42,7 +42,7 @@ class BaseSchedulerTransform(TransformationPass): conditioned on the same register are commute, i.e. read-access to the classical register doesn't change its state. - .. parsed-literal:: + .. code-block:: text qc = QuantumCircuit(2, 1) qc.delay(100, 0) @@ -52,7 +52,7 @@ class BaseSchedulerTransform(TransformationPass): The scheduler SHOULD comply with above topological ordering policy of the DAG circuit. Accordingly, the `asap`-scheduled circuit will become - .. parsed-literal:: + .. code-block:: text ┌────────────────┐ ┌───┐ q_0: ┤ Delay(100[dt]) ├───┤ X ├────────────── @@ -76,7 +76,7 @@ class BaseSchedulerTransform(TransformationPass): is moved to the classical register (C). The sequence from t0 to t1 of the measure instruction interval might be modeled as follows: - .. parsed-literal:: + .. code-block:: text Q ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ B ░░▒▒▒▒▒▒▒▒░░░░░░░░░ @@ -90,7 +90,7 @@ class BaseSchedulerTransform(TransformationPass): This precise model may induce weird edge case. - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ───┤ X ├────── @@ -107,7 +107,7 @@ class BaseSchedulerTransform(TransformationPass): is unchanged during the stimulus, thus two nodes are simultaneously operated. If one `alap`-schedule this circuit, it may return following circuit. - .. parsed-literal:: + .. code-block:: text ┌────────────────┐ ┌───┐ q_0: ┤ Delay(500[dt]) ├───┤ X ├────── @@ -122,7 +122,7 @@ class BaseSchedulerTransform(TransformationPass): It looks like the topological ordering between the nodes are flipped in the scheduled view. This behavior can be understood by considering the control flow model described above, - .. parsed-literal:: + .. code-block:: text : Quantum Circuit, first-measure 0 ░░░░░░░░░░░░▒▒▒▒▒▒░ @@ -154,7 +154,7 @@ class BaseSchedulerTransform(TransformationPass): In this case, ``Measure`` instruction immediately locks the register C. Under this configuration, the `alap`-scheduled circuit of above example may become - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ───┤ X ├────── @@ -168,7 +168,8 @@ class BaseSchedulerTransform(TransformationPass): it may separately schedule qubit and classical register, insertion of the delay yields unnecessary longer total execution time. - .. parsed-literal:: + .. code-block:: text + : Quantum Circuit, first-xgate 0 ░▒▒▒░░░░░░░░░░░░░░░ 1 ░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ @@ -185,7 +186,7 @@ class BaseSchedulerTransform(TransformationPass): If finite conditional latency is provided, for example, 30 dt, the circuit is scheduled as follows. - .. parsed-literal:: + .. code-block:: text ┌───────────────┐ ┌───┐ q_0: ┤ Delay(30[dt]) ├───┤ X ├────── @@ -197,7 +198,8 @@ class BaseSchedulerTransform(TransformationPass): with the timing model: - .. parsed-literal:: + .. code-block:: text + : Quantum Circuit, first-xgate 0 ░░▒▒▒░░░░░░░░░░░░░░░ 1 ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░ diff --git a/qiskit/transpiler/passes/scheduling/padding/pad_delay.py b/qiskit/transpiler/passes/scheduling/padding/pad_delay.py index 482183b68cbd..b61b5ae5c83e 100644 --- a/qiskit/transpiler/passes/scheduling/padding/pad_delay.py +++ b/qiskit/transpiler/passes/scheduling/padding/pad_delay.py @@ -39,7 +39,7 @@ class PadDelay(BasePadding): The ASAP-scheduled circuit output may become - .. parsed-literal:: + .. code-block:: text ┌────────────────┐ q_0: ┤ Delay(160[dt]) ├──■── diff --git a/qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py b/qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py index c3c51353d03f..ab15e7978938 100644 --- a/qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py +++ b/qiskit/transpiler/passes/synthesis/solovay_kitaev_synthesis.py @@ -52,7 +52,7 @@ class SolovayKitaev(TransformationPass): For example, the following circuit - .. parsed-literal:: + .. code-block:: text ┌─────────┐ q_0: ┤ RX(0.8) ├ @@ -60,7 +60,7 @@ class SolovayKitaev(TransformationPass): can be decomposed into - .. parsed-literal:: + .. code-block:: text global phase: 7π/8 ┌───┐┌───┐┌───┐ @@ -95,7 +95,7 @@ class SolovayKitaev(TransformationPass): print("Error:", np.linalg.norm(Operator(circuit).data - Operator(discretized).data)) - .. parsed-literal:: + .. code-block:: text Original circuit: ┌─────────┐ diff --git a/qiskit/transpiler/passes/utils/merge_adjacent_barriers.py b/qiskit/transpiler/passes/utils/merge_adjacent_barriers.py index acb748bb6f95..2cbba547c7fc 100644 --- a/qiskit/transpiler/passes/utils/merge_adjacent_barriers.py +++ b/qiskit/transpiler/passes/utils/merge_adjacent_barriers.py @@ -40,7 +40,8 @@ class MergeAdjacentBarriers(TransformationPass): i.e, - .. parsed-literal:: + .. code-block:: text + ░ ░ ░ ░ q_0: ─░──░─ q_0: ─░──░─ ░ ░ ░ ░ diff --git a/releasenotes/notes/0.13/dag_compose-3847f210c6624f88.yaml b/releasenotes/notes/0.13/dag_compose-3847f210c6624f88.yaml index cacd302c6714..edea19669f37 100644 --- a/releasenotes/notes/0.13/dag_compose-3847f210c6624f88.yaml +++ b/releasenotes/notes/0.13/dag_compose-3847f210c6624f88.yaml @@ -12,7 +12,7 @@ features: right_clbit0: self.left_clbit1, right_clbit1: self.left_clbit0}) - .. parsed-literal:: + .. code-block:: text ┌───┐ ┌─────┐┌─┐ lqr_1_0: ───┤ H ├─── rqr_0: ──■──┤ Tdg ├┤M├ diff --git a/releasenotes/notes/0.14/0.14.0-release-19557dcd9d5af6e3.yaml b/releasenotes/notes/0.14/0.14.0-release-19557dcd9d5af6e3.yaml index fbe0e38c0b30..7286937ecad5 100644 --- a/releasenotes/notes/0.14/0.14.0-release-19557dcd9d5af6e3.yaml +++ b/releasenotes/notes/0.14/0.14.0-release-19557dcd9d5af6e3.yaml @@ -51,7 +51,7 @@ prelude: | >>> lhs.compose(rhs, qubits=[3, 2], inplace=True) - .. parsed-literal:: + .. code-block:: text ┌───┐ ┌─────┐ ┌───┐ lqr_1_0: ───┤ H ├─── rqr_0: ──■──┤ Tdg ├ lqr_1_0: ───┤ H ├─────────────── diff --git a/releasenotes/notes/0.14/transpiling_basis_none-b2f1abdb3c080eca.yaml b/releasenotes/notes/0.14/transpiling_basis_none-b2f1abdb3c080eca.yaml index 765c92c7dead..19721de5c271 100644 --- a/releasenotes/notes/0.14/transpiling_basis_none-b2f1abdb3c080eca.yaml +++ b/releasenotes/notes/0.14/transpiling_basis_none-b2f1abdb3c080eca.yaml @@ -26,9 +26,10 @@ fixes: result = transpile(circuit, basis_gates=None, optimization_level=3) result.draw() - .. parsed-literal:: - ┌───┐┌─────────────┐┌───┐┌─────────────────┐ - q_0: ┤ H ├┤ U2(0.1,0.3) ├┤ H ├┤ U3(0.1,0.2,0.3) ├ - └───┘└─────────────┘└───┘└─────────────────┘ + .. code-block:: text + + ┌───┐┌─────────────┐┌───┐┌─────────────────┐ + q_0: ┤ H ├┤ U2(0.1,0.3) ├┤ H ├┤ U3(0.1,0.2,0.3) ├ + └───┘└─────────────┘└───┘└─────────────────┘ Fixes `#3017 `_ diff --git a/releasenotes/notes/0.15/support-substituting-parameterexpression-5f140ba243ba126a.yaml b/releasenotes/notes/0.15/support-substituting-parameterexpression-5f140ba243ba126a.yaml index f48392390769..e87ca00e4661 100644 --- a/releasenotes/notes/0.15/support-substituting-parameterexpression-5f140ba243ba126a.yaml +++ b/releasenotes/notes/0.15/support-substituting-parameterexpression-5f140ba243ba126a.yaml @@ -19,7 +19,7 @@ features: x = Parameter('x') source.assign_parameters({p: x*x}) - .. parsed-literal:: + .. code-block:: text ┌──────────┐ q_0: ┤ Rz(x**2) ├ diff --git a/releasenotes/notes/0.17/bool_expression_phaseoracle-1802be3016c83fa8.yaml b/releasenotes/notes/0.17/bool_expression_phaseoracle-1802be3016c83fa8.yaml index abd484e2465f..ff3430efbfdc 100644 --- a/releasenotes/notes/0.17/bool_expression_phaseoracle-1802be3016c83fa8.yaml +++ b/releasenotes/notes/0.17/bool_expression_phaseoracle-1802be3016c83fa8.yaml @@ -37,7 +37,7 @@ features: circuit.append(boolean_exp, range(boolean_exp.num_qubits)) circuit.draw('text') - .. parsed-literal:: + .. code-block:: text ┌───────────────────┐ q_0: ┤0 ├ @@ -53,7 +53,7 @@ features: circuit.decompose().draw('text') - .. parsed-literal:: + .. code-block:: text q_0: ──o────o──────────── │ │ @@ -106,7 +106,7 @@ features: oracle = PhaseOracle.from_dimacs_file("simple_v3_c2.cnf") oracle.draw('text') - .. parsed-literal:: + .. code-block:: text state_0: ─o───────o────────────── │ ┌───┐ │ ┌───┐ diff --git a/releasenotes/notes/0.18/wrap-library-circuits-9b7f7398f3fce8a8.yaml b/releasenotes/notes/0.18/wrap-library-circuits-9b7f7398f3fce8a8.yaml index 15126bca3495..61bac9489930 100644 --- a/releasenotes/notes/0.18/wrap-library-circuits-9b7f7398f3fce8a8.yaml +++ b/releasenotes/notes/0.18/wrap-library-circuits-9b7f7398f3fce8a8.yaml @@ -16,7 +16,7 @@ upgrade: before looked like - .. parsed-literal:: + .. code-block:: text ┌───┐ q_0: ────────────────────■────────■───────┤ H ├─X─ @@ -28,7 +28,7 @@ upgrade: and now looks like - .. parsed-literal:: + .. code-block:: text ┌──────┐ q_0: ┤0 ├ diff --git a/releasenotes/notes/0.20/add-parameters-to-template-substitution-a1379cdbfcc10b5c.yaml b/releasenotes/notes/0.20/add-parameters-to-template-substitution-a1379cdbfcc10b5c.yaml index 089ef1b4626a..a7d7f8f03d6a 100644 --- a/releasenotes/notes/0.20/add-parameters-to-template-substitution-a1379cdbfcc10b5c.yaml +++ b/releasenotes/notes/0.20/add-parameters-to-template-substitution-a1379cdbfcc10b5c.yaml @@ -48,7 +48,7 @@ features: outputs - .. parsed-literal:: + .. code-block:: text Original circuit: diff --git a/releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml b/releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml index 5f79ace148ed..5291cccb850c 100644 --- a/releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml +++ b/releasenotes/notes/0.20/update-instruction-alignment-passes-ef0f20d4f89f95f3.yaml @@ -79,7 +79,7 @@ features: For example, consider scheduling an input circuit like: - .. parsed-literal:: + .. code-block:: text ┌───┐┌─┐ q_0: ┤ X ├┤M├────────────── diff --git a/releasenotes/notes/0.23/clifford_layered_synthesis-1a6b1038458ae8c3.yaml b/releasenotes/notes/0.23/clifford_layered_synthesis-1a6b1038458ae8c3.yaml index 95b24d89d3ad..bbd840334068 100644 --- a/releasenotes/notes/0.23/clifford_layered_synthesis-1a6b1038458ae8c3.yaml +++ b/releasenotes/notes/0.23/clifford_layered_synthesis-1a6b1038458ae8c3.yaml @@ -8,7 +8,8 @@ features: For example, a 5-qubit Clifford circuit is decomposed into the following layers: - .. parsed-literal:: + .. code-block:: text + ┌─────┐┌─────┐┌────────┐┌─────┐┌─────┐┌─────┐┌─────┐┌────────┐ q_0: ┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├┤0 ├ │ ││ ││ ││ ││ ││ ││ ││ │ diff --git a/releasenotes/notes/0.25/relax_wire_order_restrictions-ffc0cfeacd7b8d4b.yaml b/releasenotes/notes/0.25/relax_wire_order_restrictions-ffc0cfeacd7b8d4b.yaml index c8fd6337fdb7..147f670a1f75 100644 --- a/releasenotes/notes/0.25/relax_wire_order_restrictions-ffc0cfeacd7b8d4b.yaml +++ b/releasenotes/notes/0.25/relax_wire_order_restrictions-ffc0cfeacd7b8d4b.yaml @@ -19,7 +19,7 @@ features: circuit.x(3).c_if(cr, 10) circuit.draw('text', wire_order=[2, 3, 0, 1], cregbundle=True) - .. parsed-literal:: + .. code-block:: text q_2: ──────────── ┌───┐ ┌───┐ diff --git a/releasenotes/notes/0.45/fix_9363-445db8fde1244e57.yaml b/releasenotes/notes/0.45/fix_9363-445db8fde1244e57.yaml index ef0e6f01fbee..6b9ee90adcd1 100644 --- a/releasenotes/notes/0.45/fix_9363-445db8fde1244e57.yaml +++ b/releasenotes/notes/0.45/fix_9363-445db8fde1244e57.yaml @@ -25,7 +25,7 @@ fixes: Which would print - .. parsed-literal:: + .. code-block:: text Before After diff --git a/test/python/compiler/test_transpiler.py b/test/python/compiler/test_transpiler.py index 825dfd6bdfe7..a90c2bfee7d2 100644 --- a/test/python/compiler/test_transpiler.py +++ b/test/python/compiler/test_transpiler.py @@ -200,7 +200,7 @@ def test_transpile_non_adjacent_layout(self): circuit: - .. parsed-literal:: + .. code-block:: text ┌───┐ qr_0: ┤ H ├──■──────────── -> 1 @@ -354,7 +354,7 @@ def test_already_mapped_via_layout(self): circuit: - .. parsed-literal:: + .. code-block:: text ┌───┐ ┌───┐ ░ ┌─┐ qn_0: ┤ H ├──■────────────■──┤ H ├─░─┤M├─── -> 9 diff --git a/test/python/dagcircuit/test_dagcircuit.py b/test/python/dagcircuit/test_dagcircuit.py index ef8050961066..e2881cf4a3d9 100644 --- a/test/python/dagcircuit/test_dagcircuit.py +++ b/test/python/dagcircuit/test_dagcircuit.py @@ -1153,7 +1153,7 @@ def test_dag_nodes_on_wire_multiple_successors(self): Test that if an DAGOpNode has multiple successors in the DAG along one wire, they are all retrieved in order. This could be the case for a circuit such as - .. parsed-literal:: + .. code-block:: text q0_0: |0>──■─────────■── ┌─┴─┐┌───┐┌─┴─┐ diff --git a/test/python/transpiler/test_sabre_swap.py b/test/python/transpiler/test_sabre_swap.py index 856b5ff09f5b..c342def0ba14 100644 --- a/test/python/transpiler/test_sabre_swap.py +++ b/test/python/transpiler/test_sabre_swap.py @@ -42,7 +42,7 @@ def looping_circuit(uphill_swaps=1, additional_local_minimum_gates=0): This looks like (using cz gates to show the symmetry, though we actually output cx for testing purposes): - .. parsed-literal:: + .. code-block:: text q_0: ─■──────────────── │ diff --git a/test/python/transpiler/test_swap_strategy_router.py b/test/python/transpiler/test_swap_strategy_router.py index d6ca1bde53dd..0a800bdad642 100644 --- a/test/python/transpiler/test_swap_strategy_router.py +++ b/test/python/transpiler/test_swap_strategy_router.py @@ -62,7 +62,8 @@ def test_basic_zz(self): The expected circuit is: - ..parsed-literal:: + ..code-block:: text + ┌────────────────┐ q_0: ───────────────────X──────────────────────┤0 ├ ┌────────────────┐ │ ┌────────────────┐ │ exp(-i ZZ)(3) │ @@ -98,7 +99,7 @@ def test_basic_xx(self): The expected circuit is: - ..parsed-literal:: + ..code-block:: text ┌────────────────┐ q_0: ─┤0 ├─X───────────────────────────────────────── @@ -136,7 +137,7 @@ def test_idle_qubit(self): The expected circuit is: - ..parsed-literal:: + ..code-block:: text ┌─────────────────┐ q_0: ┤0 ├─X──────────────────── @@ -175,7 +176,7 @@ def test_basic_xx_with_measure(self): The expected circuit is: - ..parsed-literal:: + ..code-block:: text ┌────────────────┐ ░ ┌─┐ q_0: ─┤0 ├─X──────────────────────────────────────────░────┤M├────── @@ -343,7 +344,7 @@ def test_ccx(self): Here, we test that the circuit - .. parsed-literal:: + .. code-block:: text ┌──────────────────────────┐ q_0: ┤0 ├──■── @@ -356,7 +357,7 @@ def test_ccx(self): becomes - .. parsed-literal:: + .. code-block:: text ┌─────────────────┐ ┌───┐ q_0: ┤0 ├─X────────────────────┤ X ├ @@ -399,7 +400,7 @@ def test_t_device(self): The coupling map in this test corresponds to - .. parsed-literal:: + .. code-block:: text 0 -- 1 -- 2 |