Skip to content

Commit

Permalink
fix indentation quantumcircuit.py (#11744)
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Arellano <[email protected]>
(cherry picked from commit 1dd9a57)
  • Loading branch information
arnaucasau authored and mergify[bot] committed Feb 12, 2024
1 parent 2745dc1 commit e92343f
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit e92343f

Please sign in to comment.