diff --git a/qiskit/circuit/library/grover_operator.py b/qiskit/circuit/library/grover_operator.py index d55a59249a3d..8b6aeaf2db8c 100644 --- a/qiskit/circuit/library/grover_operator.py +++ b/qiskit/circuit/library/grover_operator.py @@ -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 @@ -133,7 +133,7 @@ def grover_operator( .. plot:: :include-source: - :context: + :context: close-figs oracle = QuantumCircuit(4) oracle.z(3) @@ -150,7 +150,7 @@ def grover_operator( .. plot:: :include-source: - :context: + :context: close-figs from qiskit.quantum_info import Statevector, DensityMatrix, Operator diff --git a/qiskit/circuit/library/n_local/efficient_su2.py b/qiskit/circuit/library/n_local/efficient_su2.py index 53698a3e18a6..dd04a4d0a822 100644 --- a/qiskit/circuit/library/n_local/efficient_su2.py +++ b/qiskit/circuit/library/n_local/efficient_su2.py @@ -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") diff --git a/qiskit/circuit/library/n_local/excitation_preserving.py b/qiskit/circuit/library/n_local/excitation_preserving.py index 49bfdb07f017..b0a74b8bcf49 100644 --- a/qiskit/circuit/library/n_local/excitation_preserving.py +++ b/qiskit/circuit/library/n_local/excitation_preserving.py @@ -71,7 +71,7 @@ def excitation_preserving( .. plot:: :include-source: - :context: + :context: close-figs from qiskit.circuit.library import excitation_preserving diff --git a/qiskit/circuit/library/n_local/n_local.py b/qiskit/circuit/library/n_local/n_local.py index 8c0b4d285086..a714a4699737 100644 --- a/qiskit/circuit/library/n_local/n_local.py +++ b/qiskit/circuit/library/n_local/n_local.py @@ -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") @@ -170,7 +170,7 @@ def n_local( .. plot:: :include-source: - :context: + :context: close-figs circuit = n_local(4, [], "cry", reps=2) circuit.draw("mpl") @@ -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) @@ -191,7 +191,7 @@ def n_local( .. plot: :include-source: - :context: + :context: close-figs def entanglement(layer_index): if layer_index % 2 == 0: diff --git a/qiskit/circuit/library/n_local/real_amplitudes.py b/qiskit/circuit/library/n_local/real_amplitudes.py index f1ba10604e9d..6f798af4dff6 100644 --- a/qiskit/circuit/library/n_local/real_amplitudes.py +++ b/qiskit/circuit/library/n_local/real_amplitudes.py @@ -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") diff --git a/qiskit/transpiler/__init__.py b/qiskit/transpiler/__init__.py index 1b3a3841e94f..23a3f14ceb37 100644 --- a/qiskit/transpiler/__init__.py +++ b/qiskit/transpiler/__init__.py @@ -607,7 +607,7 @@ ['id', 'rz', 'sx', 'x', 'cx', 'measure', 'delay'] - .. plot: + .. plot:: :include-source: from qiskit.circuit import QuantumCircuit