Skip to content

Commit

Permalink
Add alt text to images (#13555)
Browse files Browse the repository at this point in the history
* Add alt text to images

* Update operation.py

* Update parameter.py

* Update quantumcircuit.py

* try breaking line

* Update __init__.py

* Update fourier_checking.py

* Update graph_state.py

* Update grover_operator.py

* add more alt text and some missing directives

* add nofigs for missing figures

* Add more alt text

* next set

* need different text when there's no code

* fix text when no code

* more alt text

* remove brackets

* More alt text and some fixes

* Adding more text

* more alt text

* missing file name

* missing blank line

* extra blank line

* update allowlist

* fix spacing

* add more alt text

* Apply suggestions from code review

Co-authored-by: Eric Arellano <[email protected]>

* Apply suggestions from code review

Co-authored-by: Elena Peña Tapia <[email protected]>

---------

Co-authored-by: Eric Arellano <[email protected]>
Co-authored-by: Elena Peña Tapia <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2025
1 parent 408741c commit b872e88
Show file tree
Hide file tree
Showing 57 changed files with 172 additions and 71 deletions.
2 changes: 2 additions & 0 deletions qiskit/circuit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
.. plot::
:alt: Circuit diagram output by the previous code.
:include-source:
from qiskit import QuantumCircuit
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions qiskit/circuit/controlledgate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions qiskit/circuit/library/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions qiskit/circuit/library/arithmetic/piecewise_chebyshev.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class PiecewiseChebyshev(BlueprintCircuit):
Examples:
.. plot::
:alt: Circuit diagram output by the previous code.
:include-source:
import numpy as np
Expand Down
3 changes: 3 additions & 0 deletions qiskit/circuit/library/basis_change/qft.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions qiskit/circuit/library/boolean_logic/inner_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions qiskit/circuit/library/boolean_logic/quantum_and.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions qiskit/circuit/library/boolean_logic/quantum_or.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions qiskit/circuit/library/boolean_logic/quantum_xor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions qiskit/circuit/library/fourier_checking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions qiskit/circuit/library/generalized_gates/gms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions qiskit/circuit/library/generalized_gates/gr.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions qiskit/circuit/library/generalized_gates/mcmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions qiskit/circuit/library/generalized_gates/permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions qiskit/circuit/library/graph_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions qiskit/circuit/library/grover_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -132,6 +134,7 @@ def grover_operator(
the oracle:
.. plot::
:alt: Circuit diagram output by the previous code.
:include-source:
:context: close-figs
Expand All @@ -149,6 +152,7 @@ def grover_operator(
objects:
.. plot::
:alt: Circuit diagram output by the previous code.
:include-source:
:context: close-figs
Expand Down
2 changes: 2 additions & 0 deletions qiskit/circuit/library/hidden_linear_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions qiskit/circuit/library/iqp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -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
Expand Down Expand Up @@ -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]]
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions qiskit/circuit/library/n_local/efficient_su2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -84,6 +85,7 @@ def efficient_su2(
For example:
.. plot::
:alt: Circuit diagram output by the previous code.
:include-source:
:context: close-figs
Expand Down
Loading

0 comments on commit b872e88

Please sign in to comment.