From c77efe2cccbfd825d6d74a81a0161f6711ec77ed Mon Sep 17 00:00:00 2001 From: Rebecca Dimock Date: Thu, 12 Dec 2024 18:03:54 -0600 Subject: [PATCH] Adding more text --- qiskit/quantum_info/states/statevector.py | 1 + .../multipliers/hrs_cumulative_multiplier.py | 1 + .../multipliers/rg_qft_multiplier.py | 1 + qiskit/transpiler/__init__.py | 24 +++++++++++++++++-- qiskit/transpiler/layout.py | 3 +++ 5 files changed, 28 insertions(+), 2 deletions(-) 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..6387edbb4963 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: Output from 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..90a1bb665f68 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: Output from 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 7924d4034aef..8dc664727c69 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 @@ -335,8 +337,9 @@ example 3 qubit :class:`~.Target` above: .. plot:: - :include-source: + :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 @@ -564,6 +569,7 @@ a fake backend with a specified number of qubits for test purposes): .. plot:: + :alt: Output from the previous code. :include-source: :context: reset @@ -621,6 +627,7 @@ ['id', 'rz', 'sx', 'x', 'cx', 'measure', 'delay'] .. plot: + :alt: Output from the previous code. :include-source: from qiskit.circuit import QuantumCircuit @@ -641,6 +648,7 @@ this gate must be decomposed. This decomposition is quite costly: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit.circuit import QuantumCircuit @@ -665,7 +673,8 @@ qubits used in computations. We need to be able to map these virtual qubits in a one-to-one manner to the "physical" qubits in an actual quantum device. -.. image:: /source_images/mapping.png +.. image:: /source_images/ + :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 +722,7 @@ :func:`qiskit.visualization.plot_circuit_layout`: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -731,6 +741,7 @@ - **Layout Using Optimization Level 0** .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -750,6 +761,7 @@ - **Layout Using Optimization Level 3** .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -773,6 +785,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 +833,7 @@ ``initial_layout`` in a heavy hex coupling map: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit import QuantumCircuit, transpile @@ -829,6 +843,7 @@ ghz.draw(output='mpl') .. plot:: + :alt: Output from the previous code. :include-source: import matplotlib.pyplot as plt @@ -901,6 +916,7 @@ .. plot:: + :alt: Diagram illustrating the previously described circuit. import matplotlib.pyplot as plt from qiskit import QuantumCircuit, transpile @@ -913,6 +929,7 @@ ghz.draw(output='mpl') .. plot:: + :alt: Output from the previous code. :include-source: import matplotlib.pyplot as plt @@ -959,6 +976,7 @@ circuit such as: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit import QuantumCircuit @@ -970,6 +988,7 @@ we can then call :func:`~.transpile` on it with ``scheduling_method`` set: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit, transpile @@ -989,6 +1008,7 @@ also look at it with the :func:`.timeline.draw` function: .. plot:: + :alt: Diagram illustrating the previously described circuit. from qiskit.visualization.timeline import draw as timeline_draw diff --git a/qiskit/transpiler/layout.py b/qiskit/transpiler/layout.py index bece19671794..7011a20ece65 100644 --- a/qiskit/transpiler/layout.py +++ b/qiskit/transpiler/layout.py @@ -455,6 +455,7 @@ class TranspileLayout: let the input circuit be: .. plot:: + :alt: Output from 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: Output from the previous code. :include-source: from qiskit import QuantumCircuit @@ -498,6 +500,7 @@ class TranspileLayout: becomes: .. plot:: + :alt: Output from the previous code. :include-source: from qiskit import QuantumCircuit