Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix repeated plots in docs (backport #13635) #13639

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions qiskit/circuit/library/grover_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def grover_operator(

.. plot::
:include-source:
:context:
:context: close-figs

oracle = QuantumCircuit(1)
oracle.z(0) # the qubit state |1> is the good state
Expand All @@ -133,7 +133,7 @@ def grover_operator(

.. plot::
:include-source:
:context:
:context: close-figs

oracle = QuantumCircuit(4)
oracle.z(3)
Expand All @@ -150,7 +150,7 @@ def grover_operator(

.. plot::
:include-source:
:context:
:context: close-figs

from qiskit.quantum_info import Statevector, DensityMatrix, Operator

Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/library/n_local/efficient_su2.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def efficient_su2(

.. plot::
:include-source:
:context:
:context: close-figs

circuit = efficient_su2(4, su2_gates=["rx", "y"], entanglement="circular", reps=1)
circuit.draw("mpl")
Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/library/n_local/excitation_preserving.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def excitation_preserving(

.. plot::
:include-source:
:context:
:context: close-figs

from qiskit.circuit.library import excitation_preserving

Expand Down
8 changes: 4 additions & 4 deletions qiskit/circuit/library/n_local/n_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def n_local(

.. plot::
:include-source:
:context:
:context: close-figs

circuit = n_local(3, ["ry", "rz"], "cz", "full", reps=1, insert_barriers=True)
circuit.draw("mpl")
Expand All @@ -170,7 +170,7 @@ def n_local(

.. plot::
:include-source:
:context:
:context: close-figs

circuit = n_local(4, [], "cry", reps=2)
circuit.draw("mpl")
Expand All @@ -179,7 +179,7 @@ def n_local(

.. plot::
:include-source:
:context:
:context: close-figs

entangler_map = [[0, 1], [2, 0]]
circuit = n_local(3, "x", "crx", entangler_map, reps=2)
Expand All @@ -191,7 +191,7 @@ def n_local(

.. plot:
:include-source:
:context:
:context: close-figs

def entanglement(layer_index):
if layer_index % 2 == 0:
Expand Down
6 changes: 3 additions & 3 deletions qiskit/circuit/library/n_local/real_amplitudes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,21 +78,21 @@ def real_amplitudes(

.. plot::
:include-source:
:context:
:context: close-figs

ansatz = real_amplitudes(3, entanglement="full", reps=2) # it is the same unitary as above
ansatz.draw("mpl")

.. plot::
:include-source:
:context:
:context: close-figs

ansatz = real_amplitudes(3, entanglement="linear", reps=2, insert_barriers=True)
ansatz.draw("mpl")

.. plot::
:include-source:
:context:
:context: close-figs

ansatz = real_amplitudes(4, reps=2, entanglement=[[0,3], [0,2]], skip_unentangled_qubits=True)
ansatz.draw("mpl")
Expand Down
2 changes: 1 addition & 1 deletion qiskit/transpiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@

['id', 'rz', 'sx', 'x', 'cx', 'measure', 'delay']

.. plot:
.. plot::
:include-source:

from qiskit.circuit import QuantumCircuit
Expand Down
Loading