@@ -130,11 +130,11 @@ class QuantumCircuit:
130
130
A circuit is a list of instructions bound to some registers.
131
131
132
132
Args:
133
- regs (list(:class:`Register`) or list(``int``) or list(list(:class:`Bit`))): The
133
+ regs (list(:class:`~. Register`) or list(``int``) or list(list(:class:`~. Bit`))): The
134
134
registers to be included in the circuit.
135
135
136
- * If a list of :class:`Register` objects, represents the :class:`QuantumRegister`
137
- and/or :class:`ClassicalRegister` objects to include in the circuit.
136
+ * If a list of :class:`~. Register` objects, represents the :class:`. QuantumRegister`
137
+ and/or :class:`. ClassicalRegister` objects to include in the circuit.
138
138
139
139
For example:
140
140
@@ -151,8 +151,8 @@ class QuantumCircuit:
151
151
* ``QuantumCircuit(4) # A QuantumCircuit with 4 qubits``
152
152
* ``QuantumCircuit(4, 3) # A QuantumCircuit with 4 qubits and 3 classical bits``
153
153
154
- * If a list of python lists containing :class:`Bit` objects, a collection of
155
- :class:`Bit` s to be added to the circuit.
154
+ * If a list of python lists containing :class:`. Bit` objects, a collection of
155
+ :class:`. Bit` s to be added to the circuit.
156
156
157
157
158
158
name (str): the name of the quantum circuit. If not set, an
@@ -1217,8 +1217,7 @@ def append(
1217
1217
were actually added to the circuit.
1218
1218
1219
1219
Raises:
1220
- CircuitError: if the operation passed is not an instance of
1221
- :class:`~.circuit..Instruction`.
1220
+ CircuitError: if the operation passed is not an instance of :class:`~.circuit.Instruction` .
1222
1221
"""
1223
1222
if isinstance (instruction , CircuitInstruction ):
1224
1223
operation = instruction .operation
@@ -1855,10 +1854,10 @@ def draw(
1855
1854
Default is True, except for when ``output`` is set to ``"text"``.
1856
1855
wire_order (list): Optional. A list of integers used to reorder the display
1857
1856
of the bits. The list must have an entry for every bit with the bits
1858
- in the range 0 to (num_qubits + num_clbits).
1857
+ in the range 0 to (`` num_qubits`` + `` num_clbits`` ).
1859
1858
1860
1859
Returns:
1861
- :class:`TextDrawing` or :class:`matplotlib.figure` or :class:`PIL.Image` or
1860
+ :class:`. TextDrawing` or :class:`matplotlib.figure` or :class:`PIL.Image` or
1862
1861
:class:`str`:
1863
1862
1864
1863
* `TextDrawing` (output='text')
@@ -2860,8 +2859,8 @@ def _rebind_definition(
2860
2859
self ._rebind_definition (inner .operation , parameter , value )
2861
2860
2862
2861
def barrier (self , * qargs : QubitSpecifier , label = None ) -> InstructionSet :
2863
- """Apply :class:`~qiskit.circuit .Barrier`. If qargs is empty, applies to all qubits in the
2864
- circuit.
2862
+ """Apply :class:`~.library .Barrier`. If `` qargs`` is empty, applies to all qubits
2863
+ in the circuit.
2865
2864
2866
2865
Args:
2867
2866
qargs (QubitSpecifier): Specification for one or more qubit arguments.
@@ -2897,14 +2896,15 @@ def delay(
2897
2896
qarg : Optional [QubitSpecifier ] = None ,
2898
2897
unit : str = "dt" ,
2899
2898
) -> InstructionSet :
2900
- """Apply :class:`~qiskit .circuit.Delay`. If qarg is None, applies to all qubits.
2899
+ """Apply :class:`~.circuit.Delay`. If qarg is `` None`` , applies to all qubits.
2901
2900
When applying to multiple qubits, delays with the same duration will be created.
2902
2901
2903
2902
Args:
2904
2903
duration (int or float or ParameterExpression): duration of the delay.
2905
2904
qarg (Object): qubit argument to apply this delay.
2906
- unit (str): unit of the duration. Supported units: 's', 'ms', 'us', 'ns', 'ps', 'dt'.
2907
- Default is ``dt``, i.e. integer time unit depending on the target backend.
2905
+ unit (str): unit of the duration. Supported units: ``'s'``, ``'ms'``, ``'us'``,
2906
+ ``'ns'``, ``'ps'``, and ``'dt'``. Default is ``'dt'``, i.e. integer time unit
2907
+ depending on the target backend.
2908
2908
2909
2909
Returns:
2910
2910
qiskit.circuit.InstructionSet: handle to the added instructions.
@@ -3010,7 +3010,7 @@ def id(self, qubit: QubitSpecifier) -> InstructionSet: # pylint: disable=invali
3010
3010
return self .i (qubit )
3011
3011
3012
3012
def ms (self , theta : ParameterValueType , qubits : Sequence [QubitSpecifier ]) -> InstructionSet :
3013
- """Apply :class:`~qiskit.circuit.library.generalized_gates.gms. MSGate`.
3013
+ """Apply :class:`~qiskit.circuit.library.MSGate`.
3014
3014
3015
3015
For the full matrix form of this gate, see the underlying gate documentation.
3016
3016
@@ -3131,9 +3131,9 @@ def rv(
3131
3131
rotation in radians.
3132
3132
3133
3133
Args:
3134
- vx: x-compenent of the rotation axis.
3135
- vy: y-compenent of the rotation axis.
3136
- vz: z-compenent of the rotation axis.
3134
+ vx: x-component of the rotation axis.
3135
+ vy: y-component of the rotation axis.
3136
+ vz: z-component of the rotation axis.
3137
3137
qubit: The qubit(s) to apply the gate to.
3138
3138
3139
3139
Returns:
@@ -3564,8 +3564,8 @@ def cswap(
3564
3564
target_qubit2: The qubit(s) targeted by the gate.
3565
3565
label: The string label of the gate in the circuit.
3566
3566
ctrl_state:
3567
- The control state in decimal, or as a bitstring (e.g. '1'). Defaults to controlling
3568
- on the '1' state.
3567
+ The control state in decimal, or as a bitstring (e.g. `` '1'`` ). Defaults to controlling
3568
+ on the `` '1'`` state.
3569
3569
3570
3570
Returns:
3571
3571
A handle to the instructions created.
@@ -3906,10 +3906,10 @@ def mcx(
3906
3906
The multi-cX gate can be implemented using different techniques, which use different numbers
3907
3907
of ancilla qubits and have varying circuit depth. These modes are:
3908
3908
3909
- - 'noancilla': Requires 0 ancilla qubits.
3910
- - 'recursion': Requires 1 ancilla qubit if more than 4 controls are used, otherwise 0.
3911
- - 'v-chain': Requires 2 less ancillas than the number of control qubits.
3912
- - 'v-chain-dirty': Same as for the clean ancillas (but the circuit will be longer).
3909
+ - `` 'noancilla'`` : Requires 0 ancilla qubits.
3910
+ - `` 'recursion'`` : Requires 1 ancilla qubit if more than 4 controls are used, otherwise 0.
3911
+ - `` 'v-chain'`` : Requires 2 less ancillas than the number of control qubits.
3912
+ - `` 'v-chain-dirty'`` : Same as for the clean ancillas (but the circuit will be longer).
3913
3913
3914
3914
For the full matrix form of this gate, see the underlying gate documentation.
3915
3915
@@ -3984,10 +3984,10 @@ def mct(
3984
3984
The multi-cX gate can be implemented using different techniques, which use different numbers
3985
3985
of ancilla qubits and have varying circuit depth. These modes are:
3986
3986
3987
- - 'noancilla': Requires 0 ancilla qubits.
3988
- - 'recursion': Requires 1 ancilla qubit if more than 4 controls are used, otherwise 0.
3989
- - 'v-chain': Requires 2 less ancillas than the number of control qubits.
3990
- - 'v-chain-dirty': Same as for the clean ancillas (but the circuit will be longer).
3987
+ - `` 'noancilla'`` : Requires 0 ancilla qubits.
3988
+ - `` 'recursion'`` : Requires 1 ancilla qubit if more than 4 controls are used, otherwise 0.
3989
+ - `` 'v-chain'`` : Requires 2 less ancillas than the number of control qubits.
3990
+ - `` 'v-chain-dirty'`` : Same as for the clean ancillas (but the circuit will be longer).
3991
3991
3992
3992
For the full matrix form of this gate, see the underlying gate documentation.
3993
3993
@@ -4362,10 +4362,10 @@ def for_loop(
4362
4362
4363
4363
There are two forms for calling this function. If called with all its arguments (with the
4364
4364
possible exception of ``label``), it will create a
4365
- :obj :`~qiskit.circuit.controlflow .ForLoopOp` with the given ``body``. If ``body`` (and
4365
+ :class :`~qiskit.circuit.ForLoopOp` with the given ``body``. If ``body`` (and
4366
4366
``qubits`` and ``clbits``) are *not* passed, then this acts as a context manager, which,
4367
4367
when entered, provides a loop variable (unless one is given, in which case it will be
4368
- reused) and will automatically build a :obj :`~qiskit.circuit.controlflow .ForLoopOp` when the
4368
+ reused) and will automatically build a :class :`~qiskit.circuit.ForLoopOp` when the
4369
4369
scope finishes. In this form, you do not need to keep track of the qubits or clbits you are
4370
4370
using, because the scope will handle it for you.
4371
4371
@@ -4460,7 +4460,7 @@ def if_test(
4460
4460
4461
4461
There are two forms for calling this function. If called with all its arguments (with the
4462
4462
possible exception of ``label``), it will create a
4463
- :obj:`~qiskit.circuit.controlflow. IfElseOp` with the given ``true_body``, and there will be
4463
+ :obj:`~qiskit.circuit.IfElseOp` with the given ``true_body``, and there will be
4464
4464
no branch for the ``false`` condition (see also the :meth:`.if_else` method). However, if
4465
4465
``true_body`` (and ``qubits`` and ``clbits``) are *not* passed, then this acts as a context
4466
4466
manager, which can be used to build ``if`` statements. The return value of the ``with``
@@ -4547,7 +4547,7 @@ def if_else(
4547
4547
clbits : Sequence [ClbitSpecifier ],
4548
4548
label : Optional [str ] = None ,
4549
4549
) -> InstructionSet :
4550
- """Apply :class:`~qiskit.circuit.controlflow. IfElseOp`.
4550
+ """Apply :class:`~qiskit.circuit.IfElseOp`.
4551
4551
4552
4552
.. note::
4553
4553
@@ -4592,7 +4592,7 @@ def if_else(
4592
4592
return self .append (IfElseOp (condition , true_body , false_body , label ), qubits , clbits )
4593
4593
4594
4594
def break_loop (self ) -> InstructionSet :
4595
- """Apply :class:`~qiskit.circuit.controlflow. BreakLoopOp`.
4595
+ """Apply :class:`~qiskit.circuit.BreakLoopOp`.
4596
4596
4597
4597
.. warning::
4598
4598
@@ -4622,7 +4622,7 @@ def break_loop(self) -> InstructionSet:
4622
4622
return self .append (BreakLoopOp (self .num_qubits , self .num_clbits ), self .qubits , self .clbits )
4623
4623
4624
4624
def continue_loop (self ) -> InstructionSet :
4625
- """Apply :class:`~qiskit.circuit.controlflow. ContinueLoopOp`.
4625
+ """Apply :class:`~qiskit.circuit.ContinueLoopOp`.
4626
4626
4627
4627
.. warning::
4628
4628
@@ -4632,8 +4632,8 @@ def continue_loop(self) -> InstructionSet:
4632
4632
determined. This would quickly lead to invalid circuits, and so if you are trying to
4633
4633
construct a reusable loop body (without the context managers), you must also use the
4634
4634
non-context-manager form of :meth:`.if_test` and :meth:`.if_else`. Take care that the
4635
- :obj:`. ContinueLoopOp` instruction must span all the resources of its containing loop,
4636
- not just the immediate scope.
4635
+ :class:`~qiskit.circuit. ContinueLoopOp` instruction must span all the resources of its
4636
+ containing loop, not just the immediate scope.
4637
4637
4638
4638
Returns:
4639
4639
A handle to the instruction created.
0 commit comments