Skip to content

Commit

Permalink
Adding more text
Browse files Browse the repository at this point in the history
  • Loading branch information
beckykd committed Dec 13, 2024
1 parent 6324af5 commit c77efe2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions qiskit/quantum_info/states/statevector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 22 additions & 2 deletions qiskit/transpiler/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -395,6 +398,7 @@
:meth:`.CouplingMap.build_coupling_map`:
.. plot::
:alt: Output from the previous code.
:include-source:
from qiskit.circuit import Parameter, Measure
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -713,6 +722,7 @@
:func:`qiskit.visualization.plot_circuit_layout`:
.. plot::
:alt: Output from the previous code.
:include-source:
from qiskit import QuantumCircuit, transpile
Expand All @@ -731,6 +741,7 @@
- **Layout Using Optimization Level 0**
.. plot::
:alt: Output from the previous code.
:include-source:
from qiskit import QuantumCircuit, transpile
Expand All @@ -750,6 +761,7 @@
- **Layout Using Optimization Level 3**
.. plot::
:alt: Output from the previous code.
:include-source:
from qiskit import QuantumCircuit, transpile
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -829,6 +843,7 @@
ghz.draw(output='mpl')
.. plot::
:alt: Output from the previous code.
:include-source:
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -901,6 +916,7 @@
.. plot::
:alt: Diagram illustrating the previously described circuit.
import matplotlib.pyplot as plt
from qiskit import QuantumCircuit, transpile
Expand All @@ -913,6 +929,7 @@
ghz.draw(output='mpl')
.. plot::
:alt: Output from the previous code.
:include-source:
import matplotlib.pyplot as plt
Expand Down Expand Up @@ -959,6 +976,7 @@
circuit such as:
.. plot::
:alt: Diagram illustrating the previously described circuit.
from qiskit import QuantumCircuit
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions qiskit/transpiler/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -498,6 +500,7 @@ class TranspileLayout:
becomes:
.. plot::
:alt: Output from the previous code.
:include-source:
from qiskit import QuantumCircuit
Expand Down

0 comments on commit c77efe2

Please sign in to comment.