diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py index 1b7bbd8c08a7..894d6355c3f2 100644 --- a/qiskit/circuit/quantumcircuit.py +++ b/qiskit/circuit/quantumcircuit.py @@ -2526,17 +2526,17 @@ def parameters(self) -> ParameterView: .. code-block:: python - >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector - >>> x = ParameterVector("x", 12) - >>> circuit = QuantumCircuit(1) - >>> for x_i in x: - ... circuit.rx(x_i, 0) - >>> circuit.parameters - ParameterView([ - ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), - ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), - ..., ParameterVectorElement(x[11]) - ]) + >>> from qiskit.circuit import QuantumCircuit, Parameter, ParameterVector + >>> x = ParameterVector("x", 12) + >>> circuit = QuantumCircuit(1) + >>> for x_i in x: + ... circuit.rx(x_i, 0) + >>> circuit.parameters + ParameterView([ + ParameterVectorElement(x[0]), ParameterVectorElement(x[1]), + ParameterVectorElement(x[2]), ParameterVectorElement(x[3]), + ..., ParameterVectorElement(x[11]) + ]) Returns: @@ -3991,12 +3991,12 @@ def prepare_state( .. code-block:: - import numpy as np - from qiskit import QuantumCircuit + import numpy as np + from qiskit import QuantumCircuit - circuit = QuantumCircuit(1) - circuit.prepare_state([1/np.sqrt(2), -1/np.sqrt(2)], 0) - circuit.draw() + circuit = QuantumCircuit(1) + circuit.prepare_state([1/np.sqrt(2), -1/np.sqrt(2)], 0) + circuit.draw() output: