diff --git a/qiskit/circuit/__init__.py b/qiskit/circuit/__init__.py index f4d533b7a2f2..fc9e7a9af80e 100644 --- a/qiskit/circuit/__init__.py +++ b/qiskit/circuit/__init__.py @@ -64,6 +64,7 @@ .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit @@ -1144,6 +1145,7 @@ def __array__(self, dtype=None, copy=None): drawing: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: :show-source-link: False diff --git a/qiskit/circuit/controlledgate.py b/qiskit/circuit/controlledgate.py index a2038be9bb0c..54d0cd817d28 100644 --- a/qiskit/circuit/controlledgate.py +++ b/qiskit/circuit/controlledgate.py @@ -70,6 +70,7 @@ def __init__( Create a controlled standard gate and apply it to a circuit. .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit, QuantumRegister @@ -84,6 +85,7 @@ def __init__( Create a controlled custom gate and apply it to a circuit. .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit, QuantumRegister diff --git a/qiskit/circuit/library/__init__.py b/qiskit/circuit/library/__init__.py index 969ccfc5e5a6..7033d7eb758b 100644 --- a/qiskit/circuit/library/__init__.py +++ b/qiskit/circuit/library/__init__.py @@ -26,6 +26,7 @@ For example, to append a multi-controlled CNOT: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.library import MCXGate diff --git a/qiskit/circuit/library/arithmetic/piecewise_chebyshev.py b/qiskit/circuit/library/arithmetic/piecewise_chebyshev.py index cc34d3631f59..666f05c0323c 100644 --- a/qiskit/circuit/library/arithmetic/piecewise_chebyshev.py +++ b/qiskit/circuit/library/arithmetic/piecewise_chebyshev.py @@ -37,6 +37,7 @@ class PiecewiseChebyshev(BlueprintCircuit): Examples: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: import numpy as np diff --git a/qiskit/circuit/library/basis_change/qft.py b/qiskit/circuit/library/basis_change/qft.py index cb14977b4463..42cc43ced17f 100644 --- a/qiskit/circuit/library/basis_change/qft.py +++ b/qiskit/circuit/library/basis_change/qft.py @@ -38,6 +38,7 @@ class QFT(BlueprintCircuit): For 4 qubits, the circuit that implements this transformation is: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import QFT from qiskit.visualization.library import _generate_circuit_library_visualization @@ -48,6 +49,7 @@ class QFT(BlueprintCircuit): The respective circuit diagram is: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import QFT from qiskit.visualization.library import _generate_circuit_library_visualization @@ -64,6 +66,7 @@ class QFT(BlueprintCircuit): on 5 qubits with approximation degree 2 yields (the barriers are dropped in this example): .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import QFT from qiskit.visualization.library import _generate_circuit_library_visualization diff --git a/qiskit/circuit/library/boolean_logic/inner_product.py b/qiskit/circuit/library/boolean_logic/inner_product.py index 84b3807fb56c..757cfe3a48de 100644 --- a/qiskit/circuit/library/boolean_logic/inner_product.py +++ b/qiskit/circuit/library/boolean_logic/inner_product.py @@ -55,6 +55,7 @@ class InnerProduct(QuantumCircuit): Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import InnerProduct from qiskit.visualization.library import _generate_circuit_library_visualization @@ -121,6 +122,7 @@ class InnerProductGate(Gate): Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import InnerProductGate diff --git a/qiskit/circuit/library/boolean_logic/quantum_and.py b/qiskit/circuit/library/boolean_logic/quantum_and.py index 53099aa7be84..9f3033fc3024 100644 --- a/qiskit/circuit/library/boolean_logic/quantum_and.py +++ b/qiskit/circuit/library/boolean_logic/quantum_and.py @@ -32,6 +32,7 @@ class AND(QuantumCircuit): The AND gate without special flags equals the multi-controlled-X gate: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import AND from qiskit.visualization.library import _generate_circuit_library_visualization @@ -43,6 +44,7 @@ class AND(QuantumCircuit): ``[-1, 0, 0, 1, 1]``. .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import AND from qiskit.visualization.library import _generate_circuit_library_visualization @@ -116,6 +118,7 @@ class AndGate(Gate): The AndGate gate without special flags equals the multi-controlled-X gate: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import AndGate @@ -129,6 +132,7 @@ class AndGate(Gate): ``[-1, 0, 0, 1, 1]``. .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import AndGate diff --git a/qiskit/circuit/library/boolean_logic/quantum_or.py b/qiskit/circuit/library/boolean_logic/quantum_or.py index 95b346b34846..5a4f4d06b867 100644 --- a/qiskit/circuit/library/boolean_logic/quantum_or.py +++ b/qiskit/circuit/library/boolean_logic/quantum_or.py @@ -33,6 +33,7 @@ class OR(QuantumCircuit): The OR gate without special flags: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import OR from qiskit.visualization.library import _generate_circuit_library_visualization @@ -44,6 +45,7 @@ class OR(QuantumCircuit): flags ``[-1, 0, 0, 1, 1]``. .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import OR from qiskit.visualization.library import _generate_circuit_library_visualization @@ -117,6 +119,7 @@ class OrGate(Gate): The OrGate gate without special flags: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import OrGate @@ -130,6 +133,7 @@ class OrGate(Gate): flags ``[-1, 0, 0, 1, 1]``. .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import OrGate diff --git a/qiskit/circuit/library/boolean_logic/quantum_xor.py b/qiskit/circuit/library/boolean_logic/quantum_xor.py index 73a2178830bc..9d4f459be4d6 100644 --- a/qiskit/circuit/library/boolean_logic/quantum_xor.py +++ b/qiskit/circuit/library/boolean_logic/quantum_xor.py @@ -53,6 +53,7 @@ def __init__( Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import XOR from qiskit.visualization.library import _generate_circuit_library_visualization @@ -88,6 +89,7 @@ class BitwiseXorGate(Gate): Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import BitwiseXorGate diff --git a/qiskit/circuit/library/fourier_checking.py b/qiskit/circuit/library/fourier_checking.py index b5012b4beeef..cce2dbe0e2a9 100644 --- a/qiskit/circuit/library/fourier_checking.py +++ b/qiskit/circuit/library/fourier_checking.py @@ -70,6 +70,7 @@ def __init__(self, f: Sequence[int], g: Sequence[int]) -> None: Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import FourierChecking from qiskit.visualization.library import _generate_circuit_library_visualization @@ -124,6 +125,7 @@ def fourier_checking(f: Sequence[int], g: Sequence[int]) -> QuantumCircuit: **Reference Circuit:** .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.library import fourier_checking diff --git a/qiskit/circuit/library/generalized_gates/gms.py b/qiskit/circuit/library/generalized_gates/gms.py index bdf01757abd0..d79b9bf79fcb 100644 --- a/qiskit/circuit/library/generalized_gates/gms.py +++ b/qiskit/circuit/library/generalized_gates/gms.py @@ -45,6 +45,7 @@ class GMS(QuantumCircuit): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import GMS from qiskit.visualization.library import _generate_circuit_library_visualization diff --git a/qiskit/circuit/library/generalized_gates/gr.py b/qiskit/circuit/library/generalized_gates/gr.py index 3ababe25f3dd..d4189f7c0bd6 100644 --- a/qiskit/circuit/library/generalized_gates/gr.py +++ b/qiskit/circuit/library/generalized_gates/gr.py @@ -45,6 +45,7 @@ class GR(QuantumCircuit): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import GR from qiskit.visualization.library import _generate_circuit_library_visualization @@ -99,6 +100,7 @@ class GRX(GR): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import GRX from qiskit.visualization.library import _generate_circuit_library_visualization @@ -147,6 +149,7 @@ class GRY(GR): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import GRY from qiskit.visualization.library import _generate_circuit_library_visualization @@ -195,6 +198,7 @@ class GRZ(QuantumCircuit): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import GRZ from qiskit.visualization.library import _generate_circuit_library_visualization diff --git a/qiskit/circuit/library/generalized_gates/mcmt.py b/qiskit/circuit/library/generalized_gates/mcmt.py index 496b391d38e8..8e649b6a36cb 100644 --- a/qiskit/circuit/library/generalized_gates/mcmt.py +++ b/qiskit/circuit/library/generalized_gates/mcmt.py @@ -129,6 +129,7 @@ class MCMTVChain(MCMT): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import MCMTVChain, ZGate from qiskit.visualization.library import _generate_circuit_library_visualization diff --git a/qiskit/circuit/library/generalized_gates/permutation.py b/qiskit/circuit/library/generalized_gates/permutation.py index bea863f78242..aa27a6b20fdc 100644 --- a/qiskit/circuit/library/generalized_gates/permutation.py +++ b/qiskit/circuit/library/generalized_gates/permutation.py @@ -54,6 +54,7 @@ def __init__( Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import Permutation A = [2,4,3,0,1] @@ -62,6 +63,7 @@ def __init__( Expanded Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import Permutation from qiskit.visualization.library import _generate_circuit_library_visualization @@ -116,6 +118,7 @@ def __init__( Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.quantumcircuit import QuantumCircuit from qiskit.circuit.library import PermutationGate @@ -127,6 +130,7 @@ def __init__( Expanded Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.quantumcircuit import QuantumCircuit from qiskit.circuit.library import PermutationGate diff --git a/qiskit/circuit/library/graph_state.py b/qiskit/circuit/library/graph_state.py index 79c0dfbc864d..9f84f6fcbb4a 100644 --- a/qiskit/circuit/library/graph_state.py +++ b/qiskit/circuit/library/graph_state.py @@ -41,6 +41,7 @@ class GraphState(QuantumCircuit): **Reference Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import GraphState from qiskit.visualization.library import _generate_circuit_library_visualization @@ -105,6 +106,7 @@ class GraphStateGate(Gate): **Reference Circuit:** .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit diff --git a/qiskit/circuit/library/grover_operator.py b/qiskit/circuit/library/grover_operator.py index 8b6aeaf2db8c..9b0cef56745f 100644 --- a/qiskit/circuit/library/grover_operator.py +++ b/qiskit/circuit/library/grover_operator.py @@ -103,6 +103,7 @@ def grover_operator( We can construct a Grover operator just from the phase oracle: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: @@ -117,6 +118,7 @@ def grover_operator( We can also modify the state preparation: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -132,6 +134,7 @@ def grover_operator( the oracle: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -149,6 +152,7 @@ def grover_operator( objects: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs diff --git a/qiskit/circuit/library/hidden_linear_function.py b/qiskit/circuit/library/hidden_linear_function.py index 7acaaa7aa72e..c3bfad38c54d 100644 --- a/qiskit/circuit/library/hidden_linear_function.py +++ b/qiskit/circuit/library/hidden_linear_function.py @@ -55,6 +55,7 @@ class HiddenLinearFunction(QuantumCircuit): **Reference Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import HiddenLinearFunction from qiskit.visualization.library import _generate_circuit_library_visualization @@ -123,6 +124,7 @@ def hidden_linear_function(adjacency_matrix: list | np.ndarray) -> QuantumCircui **Reference Circuit:** .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.library import hidden_linear_function diff --git a/qiskit/circuit/library/iqp.py b/qiskit/circuit/library/iqp.py index 62082fd5c446..ac8624ec7015 100644 --- a/qiskit/circuit/library/iqp.py +++ b/qiskit/circuit/library/iqp.py @@ -38,6 +38,7 @@ class IQP(QuantumCircuit): **Reference Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import IQP A = [[6, 5, 3], [5, 4, 5], [3, 5, 1]] @@ -47,6 +48,7 @@ class IQP(QuantumCircuit): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import IQP from qiskit.visualization.library import _generate_circuit_library_visualization @@ -97,6 +99,7 @@ def iqp( **Reference Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import iqp A = [[6, 5, 3], [5, 4, 5], [3, 5, 1]] @@ -106,6 +109,7 @@ def iqp( **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import iqp from qiskit.visualization.library import _generate_circuit_library_visualization @@ -154,6 +158,7 @@ def random_iqp( Example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.library import random_iqp diff --git a/qiskit/circuit/library/n_local/efficient_su2.py b/qiskit/circuit/library/n_local/efficient_su2.py index 954e74a3d296..a24fb4e1d88b 100644 --- a/qiskit/circuit/library/n_local/efficient_su2.py +++ b/qiskit/circuit/library/n_local/efficient_su2.py @@ -71,6 +71,7 @@ def efficient_su2( CX gates, is equivalent to an all-to-all entanglement: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: @@ -84,6 +85,7 @@ def efficient_su2( For example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs diff --git a/qiskit/circuit/library/n_local/evolved_operator_ansatz.py b/qiskit/circuit/library/n_local/evolved_operator_ansatz.py index 086bbda31749..386d05f16f7b 100644 --- a/qiskit/circuit/library/n_local/evolved_operator_ansatz.py +++ b/qiskit/circuit/library/n_local/evolved_operator_ansatz.py @@ -61,6 +61,7 @@ def evolved_operator_ansatz( Examples: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.library import evolved_operator_ansatz @@ -213,6 +214,7 @@ def hamiltonian_variational_ansatz( A single operator will be split into commuting terms automatically: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.quantum_info import SparsePauliOp @@ -226,6 +228,7 @@ def hamiltonian_variational_ansatz( Alternatively, we can directly provide the terms: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.quantum_info import SparsePauliOp diff --git a/qiskit/circuit/library/n_local/excitation_preserving.py b/qiskit/circuit/library/n_local/excitation_preserving.py index 3623834f2b6d..7d4e0c74b057 100644 --- a/qiskit/circuit/library/n_local/excitation_preserving.py +++ b/qiskit/circuit/library/n_local/excitation_preserving.py @@ -70,6 +70,7 @@ def excitation_preserving( With linear entanglement, this circuit is given by: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -83,6 +84,7 @@ def excitation_preserving( in each block: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: diff --git a/qiskit/circuit/library/n_local/n_local.py b/qiskit/circuit/library/n_local/n_local.py index a714a4699737..057290ac98eb 100644 --- a/qiskit/circuit/library/n_local/n_local.py +++ b/qiskit/circuit/library/n_local/n_local.py @@ -148,6 +148,7 @@ def n_local( are made up of a single block per layer: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: @@ -160,6 +161,7 @@ def n_local( Pauli-Y and Pauli-Z rotations in the rotation layer: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -169,6 +171,7 @@ def n_local( To omit rotation or entanglement layers, the block can be set to an empty list: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -178,6 +181,7 @@ def n_local( The entanglement can be set explicitly via the ``entanglement`` argument: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -189,7 +193,8 @@ def n_local( as input the current layer index, and returns the entanglement structure. For example, the following uses different entanglements for odd and even layers: - .. plot: + .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs diff --git a/qiskit/circuit/library/n_local/pauli_two_design.py b/qiskit/circuit/library/n_local/pauli_two_design.py index fc286c8533be..8d9b64fc37ad 100644 --- a/qiskit/circuit/library/n_local/pauli_two_design.py +++ b/qiskit/circuit/library/n_local/pauli_two_design.py @@ -59,6 +59,7 @@ def pauli_two_design( Examples: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.library import pauli_two_design @@ -148,6 +149,7 @@ class PauliTwoDesign(TwoLocal): Examples: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.library import PauliTwoDesign diff --git a/qiskit/circuit/library/n_local/qaoa_ansatz.py b/qiskit/circuit/library/n_local/qaoa_ansatz.py index b200d7ea7e15..508840391445 100644 --- a/qiskit/circuit/library/n_local/qaoa_ansatz.py +++ b/qiskit/circuit/library/n_local/qaoa_ansatz.py @@ -47,6 +47,7 @@ def qaoa_ansatz( optimization problem: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.quantum_info import SparsePauliOp diff --git a/qiskit/circuit/library/n_local/real_amplitudes.py b/qiskit/circuit/library/n_local/real_amplitudes.py index 79d85db5b603..96f7001443a7 100644 --- a/qiskit/circuit/library/n_local/real_amplitudes.py +++ b/qiskit/circuit/library/n_local/real_amplitudes.py @@ -68,6 +68,7 @@ def real_amplitudes( Examples: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: @@ -77,6 +78,7 @@ def real_amplitudes( ansatz.draw("mpl") .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -84,6 +86,7 @@ def real_amplitudes( ansatz.draw("mpl") .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs @@ -91,6 +94,7 @@ def real_amplitudes( ansatz.draw("mpl") .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: close-figs diff --git a/qiskit/circuit/library/overlap.py b/qiskit/circuit/library/overlap.py index 3cf85eb072ee..eb31ee679440 100644 --- a/qiskit/circuit/library/overlap.py +++ b/qiskit/circuit/library/overlap.py @@ -128,6 +128,7 @@ def unitary_overlap( **Reference Circuit:** .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: import numpy as np diff --git a/qiskit/circuit/library/phase_estimation.py b/qiskit/circuit/library/phase_estimation.py index 8ff441eb705e..f5f3abc22c96 100644 --- a/qiskit/circuit/library/phase_estimation.py +++ b/qiskit/circuit/library/phase_estimation.py @@ -76,6 +76,7 @@ def __init__( Reference Circuit: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit import QuantumCircuit from qiskit.circuit.library import PhaseEstimation @@ -131,6 +132,7 @@ def phase_estimation( **Reference Circuit:** .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit diff --git a/qiskit/circuit/library/quantum_volume.py b/qiskit/circuit/library/quantum_volume.py index 644a85d9af13..1ff480e7ef0d 100644 --- a/qiskit/circuit/library/quantum_volume.py +++ b/qiskit/circuit/library/quantum_volume.py @@ -35,6 +35,7 @@ class QuantumVolume(QuantumCircuit): **Reference Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import QuantumVolume circuit = QuantumVolume(5, 6, seed=10) @@ -43,6 +44,7 @@ class QuantumVolume(QuantumCircuit): **Expanded Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import QuantumVolume from qiskit.visualization.library import _generate_circuit_library_visualization @@ -150,6 +152,7 @@ def quantum_volume( **Reference Circuit:** .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.circuit.library import quantum_volume circuit = quantum_volume(5, 6, seed=10) diff --git a/qiskit/circuit/operation.py b/qiskit/circuit/operation.py index 8856222b2663..6a00a2a2811c 100644 --- a/qiskit/circuit/operation.py +++ b/qiskit/circuit/operation.py @@ -34,6 +34,7 @@ class Operation(ABC): Add a Clifford and a Toffoli gate to a :class:`QuantumCircuit`. .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit diff --git a/qiskit/circuit/parameter.py b/qiskit/circuit/parameter.py index 8723445cdef4..1ccfb103412f 100644 --- a/qiskit/circuit/parameter.py +++ b/qiskit/circuit/parameter.py @@ -41,6 +41,7 @@ class Parameter(ParameterExpression): Construct a variable-rotation X gate using circuit parameters. .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit, Parameter diff --git a/qiskit/circuit/quantumcircuit.py b/qiskit/circuit/quantumcircuit.py index 495d6b36f439..5598c3032d14 100644 --- a/qiskit/circuit/quantumcircuit.py +++ b/qiskit/circuit/quantumcircuit.py @@ -836,6 +836,7 @@ class QuantumCircuit: Consider the following circuit: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit @@ -902,6 +903,8 @@ class QuantumCircuit: graphically: .. image:: /source_images/depth.gif + :alt: Rotate the circuit and let each gate fall as far as possible. The gates fall \ + into "layers". The depth of the circuit is the number of layers. We can verify our graphical result using :meth:`QuantumCircuit.depth`:: @@ -2170,6 +2173,7 @@ def tensor(self, other: "QuantumCircuit", inplace: bool = False) -> Optional["Qu Examples: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit @@ -3426,6 +3430,7 @@ def draw( Example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit @@ -4328,6 +4333,7 @@ def assign_parameters( # pylint: disable=missing-raises-doc Create a parameterized circuit and assign the parameters in-place. .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit, Parameter @@ -4343,6 +4349,7 @@ def assign_parameters( # pylint: disable=missing-raises-doc Bind the values out-of-place by list and get a copy of the original circuit. .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit, ParameterVector diff --git a/qiskit/circuit/random/utils.py b/qiskit/circuit/random/utils.py index 5caba8ca2ae0..7ce48bed01ee 100644 --- a/qiskit/circuit/random/utils.py +++ b/qiskit/circuit/random/utils.py @@ -37,6 +37,7 @@ def random_circuit( from the set of standard gates in :mod:`qiskit.circuit.library.standard_gates`. For example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.random import random_circuit @@ -295,6 +296,7 @@ def random_clifford_circuit(num_qubits, num_gates, gates="all", seed=None): gates from the set of standard gates in :mod:`qiskit.circuit.library.standard_gates`. For example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit.random import random_clifford_circuit diff --git a/qiskit/converters/dag_to_circuit.py b/qiskit/converters/dag_to_circuit.py index 6ffa74527aa3..5c81dd07a6bf 100644 --- a/qiskit/converters/dag_to_circuit.py +++ b/qiskit/converters/dag_to_circuit.py @@ -34,6 +34,7 @@ def dag_to_circuit(dag, copy_operations=True): Example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit diff --git a/qiskit/primitives/statevector_estimator.py b/qiskit/primitives/statevector_estimator.py index f96d409631a3..bdfc2c4df721 100644 --- a/qiskit/primitives/statevector_estimator.py +++ b/qiskit/primitives/statevector_estimator.py @@ -49,6 +49,7 @@ class StatevectorEstimator(BaseEstimatorV2): ``StatevectorEstimator(seed=123)``. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.circuit import Parameter, QuantumCircuit diff --git a/qiskit/providers/fake_provider/__init__.py b/qiskit/providers/fake_provider/__init__.py index 9526793f0e10..a119f8b77e99 100644 --- a/qiskit/providers/fake_provider/__init__.py +++ b/qiskit/providers/fake_provider/__init__.py @@ -29,6 +29,7 @@ Here is an example of using a simulated backend for transpilation and running. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile diff --git a/qiskit/pulse/builder.py b/qiskit/pulse/builder.py index 9b2c9208ac72..bc057980cf09 100644 --- a/qiskit/pulse/builder.py +++ b/qiskit/pulse/builder.py @@ -39,6 +39,7 @@ .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import pulse @@ -61,6 +62,7 @@ a pulse: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import pulse @@ -90,6 +92,7 @@ automatically lowered to be run as a pulse program: .. plot:: + :alt: Output from the previous code. :include-source: from math import pi @@ -277,6 +280,7 @@ Pulse instructions are available within the builder interface. Here's an example: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import pulse @@ -325,6 +329,7 @@ be used to align all pulses as late as possible in a pulse program. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import pulse @@ -1188,6 +1193,7 @@ def align_equispaced(duration: int | ParameterExpression) -> Generator[None, Non Examples: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import pulse @@ -1242,6 +1248,7 @@ def align_func( Examples: .. plot:: + :alt: Output from the previous code. :include-source: import numpy as np @@ -2116,6 +2123,7 @@ def macro(func: Callable): Examples: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import pulse diff --git a/qiskit/pulse/library/symbolic_pulses.py b/qiskit/pulse/library/symbolic_pulses.py index f18a10805739..560e1d529958 100644 --- a/qiskit/pulse/library/symbolic_pulses.py +++ b/qiskit/pulse/library/symbolic_pulses.py @@ -330,6 +330,7 @@ class SymbolicPulse(Pulse): without knowing the envelope definition. Now you need to provide the envelope. .. plot:: + :alt: Output from the previous code. :include-source: import sympy diff --git a/qiskit/qasm3/__init__.py b/qiskit/qasm3/__init__.py index 8f2ef60369bf..1dc6ff3feae8 100644 --- a/qiskit/qasm3/__init__.py +++ b/qiskit/qasm3/__init__.py @@ -130,6 +130,7 @@ convert it into a :class:`.QuantumCircuit`: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: import qiskit.qasm3 diff --git a/qiskit/quantum_info/states/statevector.py b/qiskit/quantum_info/states/statevector.py index 087d942cba43..15519fb2e24d 100644 --- a/qiskit/quantum_info/states/statevector.py +++ b/qiskit/quantum_info/states/statevector.py @@ -181,6 +181,7 @@ def draw(self, output: str | None = None, **drawer_args): Plot one of the Bell states .. plot:: + :alt: Output from the previous code. :include-source: from numpy import sqrt diff --git a/qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py b/qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py index 676d57ce4342..fa7b87b6c533 100644 --- a/qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py +++ b/qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py @@ -27,6 +27,7 @@ def multiplier_cumulative_h18( performs a non-modular multiplication on two 3-qubit sized registers is: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.synthesis.arithmetic import multiplier_cumulative_h18 diff --git a/qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py b/qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py index 550fc44694d0..d69eafe0c427 100644 --- a/qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py +++ b/qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py @@ -35,6 +35,7 @@ def multiplier_qft_r17( For example, on 3 state qubits, a full multiplier is given by: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.synthesis.arithmetic import multiplier_qft_r17 diff --git a/qiskit/transpiler/__init__.py b/qiskit/transpiler/__init__.py index b5c64bc95a95..4b1446915081 100644 --- a/qiskit/transpiler/__init__.py +++ b/qiskit/transpiler/__init__.py @@ -33,6 +33,8 @@ compilation flow follows the structure given below: .. image:: /source_images/transpiling_core_steps.png + :alt: The transpilation process takes the input circuit, applies the transpilation \ + passes, then produces the output circuit. .. raw:: html @@ -336,7 +338,8 @@ .. plot:: :include-source: - + :alt: Output from the previous code. + from qiskit.circuit import Parameter, Measure from qiskit.transpiler import Target, InstructionProperties from qiskit.circuit.library import UGate, RZGate, RXGate, RYGate, CXGate, CZGate @@ -395,6 +398,7 @@ :meth:`.CouplingMap.build_coupling_map`: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.circuit import Parameter, Measure @@ -450,6 +454,7 @@ target.build_coupling_map('cx').draw() .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.circuit import Parameter, Measure @@ -539,6 +544,7 @@ For example, to run a simple phase estimation circuit: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: import numpy as np @@ -564,6 +570,7 @@ a fake backend with a specified number of qubits for test purposes): .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: :context: reset @@ -620,7 +627,8 @@ ['id', 'rz', 'sx', 'x', 'cx', 'measure', 'delay'] - .. plot:: + .. plot: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit @@ -641,6 +649,7 @@ this gate must be decomposed. This decomposition is quite costly: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit @@ -666,6 +675,7 @@ manner to the "physical" qubits in an actual quantum device. .. image:: /source_images/mapping.png + :alt: Diagram illustrating how virtual qubits are mapped to physical qubits. By default, qiskit will do this mapping for you. The choice of mapping depends on the @@ -713,6 +723,7 @@ :func:`qiskit.visualization.plot_circuit_layout`: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -731,6 +742,7 @@ - **Layout Using Optimization Level 0** .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -750,6 +762,7 @@ - **Layout Using Optimization Level 3** .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -773,6 +786,7 @@ corresponding value is the label for the physical qubit to map onto: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -820,6 +834,7 @@ ``initial_layout`` in a heavy hex coupling map: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit import QuantumCircuit, transpile @@ -829,6 +844,7 @@ ghz.draw(output='mpl') .. plot:: + :alt: Output from the previous code. :include-source: import matplotlib.pyplot as plt @@ -901,6 +917,7 @@ .. plot:: + :alt: Diagram illustrating the previously described circuit. import matplotlib.pyplot as plt from qiskit import QuantumCircuit, transpile @@ -913,6 +930,7 @@ ghz.draw(output='mpl') .. plot:: + :alt: Output from the previous code. :include-source: import matplotlib.pyplot as plt @@ -959,6 +977,7 @@ circuit such as: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit import QuantumCircuit @@ -970,6 +989,7 @@ we can then call :func:`~.transpile` on it with ``scheduling_method`` set: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -989,6 +1009,7 @@ also look at it with the :func:`.timeline.draw` function: .. plot:: + :alt: Output from circuit timeline drawer. from qiskit.visualization.timeline import draw as timeline_draw diff --git a/qiskit/transpiler/layout.py b/qiskit/transpiler/layout.py index bece19671794..4f7e8a98bf1a 100644 --- a/qiskit/transpiler/layout.py +++ b/qiskit/transpiler/layout.py @@ -455,6 +455,7 @@ class TranspileLayout: let the input circuit be: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit, QuantumRegister @@ -470,6 +471,7 @@ class TranspileLayout: Suppose that during the layout stage the transpiler reorders the qubits to be: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit @@ -498,6 +500,7 @@ class TranspileLayout: becomes: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit diff --git a/qiskit/transpiler/passes/routing/star_prerouting.py b/qiskit/transpiler/passes/routing/star_prerouting.py index 259d79ba636b..aa09e0a3fe46 100644 --- a/qiskit/transpiler/passes/routing/star_prerouting.py +++ b/qiskit/transpiler/passes/routing/star_prerouting.py @@ -89,6 +89,7 @@ class StarPreRouting(TransformationPass): For example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit.circuit import QuantumCircuit diff --git a/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py b/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py index 7ae27ddf03d0..08371c488422 100644 --- a/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py +++ b/qiskit/transpiler/passes/scheduling/dynamical_decoupling.py @@ -47,6 +47,7 @@ class DynamicalDecoupling(TransformationPass): (including global phase). .. plot:: + :alt: Output from the previous code. :include-source: import numpy as np diff --git a/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py b/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py index 0a692a85621b..6159253e93e7 100644 --- a/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py +++ b/qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py @@ -53,6 +53,7 @@ class PadDynamicalDecoupling(BasePadding): (including global phase). .. plot:: + :alt: Output from the previous code. :include-source: import numpy as np diff --git a/qiskit/transpiler/passes/utils/filter_op_nodes.py b/qiskit/transpiler/passes/utils/filter_op_nodes.py index 75b824332aee..4da15d45385a 100644 --- a/qiskit/transpiler/passes/utils/filter_op_nodes.py +++ b/qiskit/transpiler/passes/utils/filter_op_nodes.py @@ -35,9 +35,10 @@ class FilterOpNodes(TransformationPass): Example: - Filter out operations that are labelled ``"foo"`` + Filter out operations that are labeled ``"foo"`` .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit diff --git a/qiskit/transpiler/passes/utils/remove_barriers.py b/qiskit/transpiler/passes/utils/remove_barriers.py index 53b500ff31c6..cf374435c8e7 100644 --- a/qiskit/transpiler/passes/utils/remove_barriers.py +++ b/qiskit/transpiler/passes/utils/remove_barriers.py @@ -25,6 +25,7 @@ class RemoveBarriers(TransformationPass): Example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit diff --git a/qiskit/visualization/__init__.py b/qiskit/visualization/__init__.py index 3fdaa9ffaa53..6d1b4e86622d 100644 --- a/qiskit/visualization/__init__.py +++ b/qiskit/visualization/__init__.py @@ -47,6 +47,7 @@ The following example demonstrates the common usage of these arguments: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.visualization import plot_histogram @@ -60,6 +61,7 @@ You can specify ``legend``, ``title``, ``figsize`` and ``color`` by passing to the kwargs. .. plot:: + :alt: Output from the previous code. :include-source: :context: reset @@ -103,6 +105,7 @@ Here is an example of using :func:`plot_histogram` to visualize measurement outcome counts: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.visualization import plot_histogram @@ -144,6 +147,7 @@ Here is an example of using :func:`plot_state_city` to visualize a quantum state: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.visualization import plot_state_city @@ -157,6 +161,7 @@ obtained from a :class:`~qiskit.circuit.QuantumCircuit`: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit @@ -172,6 +177,7 @@ plot_state_city(state) .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit diff --git a/qiskit/visualization/circuit/circuit_visualization.py b/qiskit/visualization/circuit/circuit_visualization.py index 82c3307e36c2..dc01e69dc41d 100644 --- a/qiskit/visualization/circuit/circuit_visualization.py +++ b/qiskit/visualization/circuit/circuit_visualization.py @@ -189,6 +189,7 @@ def circuit_drawer( Example: .. plot:: + :alt: Circuit diagram output by the previous code. :include-source: from qiskit import QuantumCircuit diff --git a/qiskit/visualization/counts_visualization.py b/qiskit/visualization/counts_visualization.py index 6d93ff6bfac0..b20c0b20e24e 100644 --- a/qiskit/visualization/counts_visualization.py +++ b/qiskit/visualization/counts_visualization.py @@ -111,6 +111,7 @@ def plot_histogram( Examples: .. plot:: + :alt: Output from the previous code. :include-source: # Plot two counts in the same figure with legends and colors specified. @@ -215,6 +216,7 @@ def plot_distribution( Examples: .. plot:: + :alt: Output from the previous code. :include-source: # Plot two counts in the same figure with legends and colors specified. diff --git a/qiskit/visualization/dag_visualization.py b/qiskit/visualization/dag_visualization.py index 8f8b8fc89097..c80a753174c1 100644 --- a/qiskit/visualization/dag_visualization.py +++ b/qiskit/visualization/dag_visualization.py @@ -100,6 +100,7 @@ def dag_drawer(dag, scale=0.7, filename=None, style="color"): Example: .. plot:: :include-source: + :nofigs: from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit from qiskit.dagcircuit import DAGCircuit diff --git a/qiskit/visualization/gate_map.py b/qiskit/visualization/gate_map.py index eb20623f0c8c..06dc3c66e425 100644 --- a/qiskit/visualization/gate_map.py +++ b/qiskit/visualization/gate_map.py @@ -75,13 +75,14 @@ def plot_gate_map( Figure: A Matplotlib figure instance. Raises: - QiskitError: if tried to pass a simulator, or if the backend is None, + QiskitError: If you tried to pass a simulator or the backend is None, but one of num_qubits, mpl_data, or cmap is None. - MissingOptionalLibraryError: if matplotlib not installed. + MissingOptionalLibraryError: If matplotlib not installed. Example: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.providers.fake_provider import GenericBackendV2 @@ -997,11 +998,12 @@ def plot_coupling_map( Raises: MissingOptionalLibraryError: If matplotlib or graphviz is not installed. - QiskitError: If length of qubit labels does not match number of qubits. + QiskitError: If the length of qubit labels does not match the number of qubits. Example: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.visualization import plot_coupling_map @@ -1168,6 +1170,7 @@ def plot_circuit_layout(circuit, backend, view="virtual", qubit_coordinates=None Example: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -1270,6 +1273,7 @@ def plot_error_map(backend, figsize=(15, 12), show_title=True, qubit_coordinates Example: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.visualization import plot_error_map diff --git a/qiskit/visualization/pulse_v2/interface.py b/qiskit/visualization/pulse_v2/interface.py index 9d781bd6e457..b879c73224dd 100644 --- a/qiskit/visualization/pulse_v2/interface.py +++ b/qiskit/visualization/pulse_v2/interface.py @@ -306,12 +306,13 @@ def draw( Examples: To visualize a pulse program, you can call this function with set of - control arguments. Most of appearance of the output image can be controlled by the + control arguments. Most of the appearance of the output image can be controlled by the stylesheet. Drawing with the default stylesheet. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile, schedule @@ -330,6 +331,7 @@ def draw( Drawing with the stylesheet suited for publication. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile, schedule @@ -348,6 +350,7 @@ def draw( Drawing with the stylesheet suited for program debugging. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile, schedule diff --git a/qiskit/visualization/state_visualization.py b/qiskit/visualization/state_visualization.py index 0e47a5fe6d72..ac003055d2c8 100644 --- a/qiskit/visualization/state_visualization.py +++ b/qiskit/visualization/state_visualization.py @@ -70,10 +70,11 @@ def plot_state_hinton(state, title="", figsize=None, ax_real=None, ax_imag=None, Raises: MissingOptionalLibraryError: Requires matplotlib. - VisualizationError: if input is not a valid N-qubit state. + VisualizationError: Input is not a valid N-qubit state. Examples: .. plot:: + :alt: Output from the previous code. :include-source: import numpy as np @@ -214,6 +215,7 @@ def plot_bloch_vector( Examples: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.visualization import plot_bloch_vector @@ -221,6 +223,7 @@ def plot_bloch_vector( plot_bloch_vector([0,1,0], title="New Bloch Sphere") .. plot:: + :alt: Output from the previous code. :include-source: import numpy as np @@ -290,6 +293,7 @@ def plot_bloch_multivector( Examples: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit @@ -304,6 +308,7 @@ def plot_bloch_multivector( plot_bloch_multivector(state) .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit @@ -406,6 +411,7 @@ def plot_state_city( Examples: .. plot:: + :alt: Output from the previous code. :include-source: # You can choose different colors for the real and imaginary parts of the density matrix. @@ -422,6 +428,7 @@ def plot_state_city( plot_state_city(state, color=['midnightblue', 'crimson'], title="New State City") .. plot:: + :alt: Output from the previous code. :include-source: # You can make the bars more transparent to better see the ones that are behind @@ -643,6 +650,7 @@ def plot_state_paulivec(state, title="", figsize=None, color=None, ax=None, *, f Examples: .. plot:: + :alt: Output from the previous code. :include-source: # You can set a color for all the bars. @@ -659,6 +667,7 @@ def plot_state_paulivec(state, title="", figsize=None, color=None, ax=None, *, f plot_state_paulivec(state, color='midnightblue', title="New PauliVec plot") .. plot:: + :alt: Output from the previous code. :include-source: # If you introduce a list with less colors than bars, the color of the bars will @@ -816,12 +825,13 @@ def plot_state_qsphere( Raises: MissingOptionalLibraryError: Requires matplotlib. - VisualizationError: if input is not a valid N-qubit state. + VisualizationError: Input is not a valid N-qubit state. QiskitError: Input statevector does not have valid dimensions. Examples: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit @@ -836,6 +846,7 @@ def plot_state_qsphere( plot_state_qsphere(state) .. plot:: + :alt: Output from the previous code. :include-source: # You can show the phase of each state and use diff --git a/qiskit/visualization/timeline/interface.py b/qiskit/visualization/timeline/interface.py index 686e0fe1d810..50dd006633a7 100644 --- a/qiskit/visualization/timeline/interface.py +++ b/qiskit/visualization/timeline/interface.py @@ -291,13 +291,14 @@ def draw( for more details. No default layout is set. (default `None`). Examples: - To visualize a scheduled circuit program, you can call this function with set of - control arguments. Most of appearance of the output image can be controlled by the + To visualize a scheduled circuit program, you can call this function with a set of + control arguments. Most of the appearance of the output image can be controlled by the stylesheet. Drawing with the default stylesheet. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile, schedule @@ -314,6 +315,7 @@ def draw( Drawing with the simple stylesheet. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile, schedule @@ -330,6 +332,7 @@ def draw( Drawing with the stylesheet suited for program debugging. .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile, schedule @@ -356,7 +359,7 @@ def draw( In the same way as above, you can create custom generator or layout functions and update existing stylesheet with custom functions. - This feature enables you to control the most of appearance of the output image + This feature enables you to control the most of the appearance of the output image without modifying the codebase of the scheduled circuit drawer. """ del show_idle diff --git a/tools/verify_images.py b/tools/verify_images.py index 5a33263dd7b4..5335cd3bc4eb 100755 --- a/tools/verify_images.py +++ b/tools/verify_images.py @@ -19,64 +19,7 @@ import glob # List of allowlist files that the checker will not verify -ALLOWLIST_MISSING_ALT_TEXT = [ - "qiskit/primitives/statevector_estimator.py", - "qiskit/pulse/builder.py", - "qiskit/pulse/library/symbolic_pulses.py", - "qiskit/transpiler/layout.py", - "qiskit/transpiler/__init__.py", - "qiskit/transpiler/passes/utils/filter_op_nodes.py", - "qiskit/transpiler/passes/utils/remove_barriers.py", - "qiskit/transpiler/passes/scheduling/dynamical_decoupling.py", - "qiskit/transpiler/passes/scheduling/padding/dynamical_decoupling.py", - "qiskit/transpiler/passes/routing/star_prerouting.py", - "qiskit/providers/fake_provider/__init__.py", - "qiskit/quantum_info/states/statevector.py", - "qiskit/qasm3/__init__.py", - "qiskit/converters/dag_to_circuit.py", - "qiskit/circuit/controlledgate.py", - "qiskit/circuit/operation.py", - "qiskit/circuit/quantumcircuit.py", - "qiskit/circuit/__init__.py", - "qiskit/circuit/parameter.py", - "qiskit/circuit/random/utils.py", - "qiskit/circuit/library/overlap.py", - "qiskit/circuit/library/iqp.py", - "qiskit/circuit/library/graph_state.py", - "qiskit/circuit/library/phase_estimation.py", - "qiskit/circuit/library/grover_operator.py", - "qiskit/circuit/library/quantum_volume.py", - "qiskit/circuit/library/hidden_linear_function.py", - "qiskit/circuit/library/fourier_checking.py", - "qiskit/circuit/library/__init__.py", - "qiskit/circuit/library/boolean_logic/quantum_xor.py", - "qiskit/circuit/library/boolean_logic/quantum_and.py", - "qiskit/circuit/library/boolean_logic/inner_product.py", - "qiskit/circuit/library/boolean_logic/quantum_or.py", - "qiskit/circuit/library/basis_change/qft.py", - "qiskit/circuit/library/generalized_gates/gms.py", - "qiskit/circuit/library/generalized_gates/permutation.py", - "qiskit/circuit/library/generalized_gates/gr.py", - "qiskit/circuit/library/generalized_gates/mcmt.py", - "qiskit/circuit/library/arithmetic/piecewise_chebyshev.py", - "qiskit/circuit/library/n_local/real_amplitudes.py", - "qiskit/circuit/library/n_local/evolved_operator_ansatz.py", - "qiskit/circuit/library/n_local/n_local.py", - "qiskit/circuit/library/n_local/pauli_two_design.py", - "qiskit/circuit/library/n_local/qaoa_ansatz.py", - "qiskit/circuit/library/n_local/excitation_preserving.py", - "qiskit/circuit/library/n_local/efficient_su2.py", - "qiskit/synthesis/arithmetic/multipliers/rg_qft_multiplier.py", - "qiskit/synthesis/arithmetic/multipliers/hrs_cumulative_multiplier.py", - "qiskit/visualization/dag_visualization.py", - "qiskit/visualization/gate_map.py", - "qiskit/visualization/state_visualization.py", - "qiskit/visualization/counts_visualization.py", - "qiskit/visualization/__init__.py", - "qiskit/visualization/timeline/interface.py", - "qiskit/visualization/circuit/circuit_visualization.py", - "qiskit/visualization/pulse_v2/interface.py", -] +ALLOWLIST_MISSING_ALT_TEXT = [] def is_image(line: str) -> bool: