Skip to content

Commit d3c7168

Browse files
abbycrossOsalotiomanEric-Arellano
authored
include matplotlib.pyplot as plt, and updates to guides to help with translating plural object names (#4447)
Closes #4437 Also brings in changes by external contributor in #4421 - including here so that checks will pass --------- Co-authored-by: Emmanuel Osalotioman Osazuwa <[email protected]> Co-authored-by: Eric Arellano <[email protected]>
1 parent ec14683 commit d3c7168

16 files changed

+24
-23
lines changed

docs/guides/classical-feedforward-and-control-flow.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@
360360
" with circuit.if_test((c0, 3)) ...\n",
361361
" with circuit.if_test((c1[2], 1)) ...\n",
362362
" ```\n",
363-
" In the previous code example, the first two `if_test`s on `c0` are considered one broadcast because the content of `c0` did not change, and thus does not need to be re-broadcasted. The `if_test` on `c1` is a second broadcast. The first one broadcasts all three bits in `c0` and the second broadcasts just one bit, making a total of four broadcasted bits.\n",
363+
" In the previous code example, the first two `if_test` objects on `c0` are considered one broadcast because the content of `c0` did not change, and thus does not need to be re-broadcasted. The `if_test` on `c1` is a second broadcast. The first one broadcasts all three bits in `c0` and the second broadcasts just one bit, making a total of four broadcasted bits.\n",
364364
"\n",
365365
" Currently, if you broadcast 60 bits each time, then the job can have approximately 300 broadcasts. If you broadcast just one bit each time, however, then the job can have 2400 broadcasts.\n",
366366
"\n",

docs/guides/custom-transpiler-pass.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
"source": [
221221
"## Use the `PauliTwirl` transpiler pass\n",
222222
"\n",
223-
"The following code uses the pass created above to transpile a circuit. Consider a simple circuit with `cx`s and `ecr`s."
223+
"The following code uses the pass created above to transpile a circuit. Consider a simple circuit with `cx` and `ecr` gates."
224224
]
225225
},
226226
{

docs/guides/dynamical-decoupling-pass-manager.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"id": "9d735702-4b06-4979-a0c1-2004a3c95d28",
124124
"metadata": {},
125125
"source": [
126-
"Because of the regular timing of dynamical decoupling sequences, information about the `YGate` must be added to the `target` because it is *not* a basis gate, whereas the `XGate` is. We know *a priori* that the `YGate` has the same duration and error as the `XGate`, however, so we can just retrieve those properties from the `target` and add them back for the `YGate`s. This is also why the `basis_gates` were saved separately, since we are adding the `YGate` instruction to the `target` although it is not an actual basis gate of `ibm_fez`."
126+
"Because of the regular timing of dynamical decoupling sequences, information about the `YGate` must be added to the `target` because it is *not* a basis gate, whereas the `XGate` is. We know *a priori* that the `YGate` has the same duration and error as the `XGate`, however, so we can just retrieve those properties from the `target` and add them back for the `YGate` objects. This is also why the `basis_gates` were saved separately, since we are adding the `YGate` instruction to the `target` although it is not an actual basis gate of `ibm_fez`."
127127
]
128128
},
129129
{
@@ -207,7 +207,7 @@
207207
"id": "5d418164-acbd-4694-8864-8c3100886157",
208208
"metadata": {},
209209
"source": [
210-
"Use the visualization tool [`timeline_drawer`](/docs/api/qiskit/qiskit.visualization.timeline_drawer) to see the circuit's timing and confirm that a regularly-spaced sequence of `XGate`s and `YGate`s appear in the circuit."
210+
"Use the visualization tool [`timeline_drawer`](/docs/api/qiskit/qiskit.visualization.timeline_drawer) to see the circuit's timing and confirm that a regularly-spaced sequence of `XGate` objects and `YGate` objects appear in the circuit."
211211
]
212212
},
213213
{
@@ -273,7 +273,7 @@
273273
"id": "69c77b6c-1f38-4adc-9249-0039ecd2c3c1",
274274
"metadata": {},
275275
"source": [
276-
"Now, `YGate`s are absent from our circuit, and there is explicit timing information in the form of `Delay` gates. This transpiled circuit with dynamical decoupling is now ready to be sent to the backend."
276+
"Now, `YGate` objects are absent from our circuit, and there is explicit timing information in the form of `Delay` gates. This transpiled circuit with dynamical decoupling is now ready to be sent to the backend."
277277
]
278278
},
279279
{

docs/guides/fractional-gates.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"source": [
5050
"## How to use fractional gates\n",
5151
"\n",
52-
"Internally, these fractional gates work by directly executing an $R_{ZZ}(\\theta)$ and $R_X(\\theta)$ rotation for an arbitrary angle. Use of the $R_X(\\theta)$ gate can reduce the duration and error for single-qubit rotations of arbitrary angle by up to a factor of two. The direct execution of the $R_{ZZ}(\\theta)$ gate rotation avoids decomposition into multiple `CZGate`s, similarly reducing a circuit's duration and error. This is especially useful for circuits that contain many single- and two-qubit rotations, such as when simulating the dynamics of a quantum system or when using a variational ansatz with many parameters.\n",
52+
"Internally, these fractional gates work by directly executing an $R_{ZZ}(\\theta)$ and $R_X(\\theta)$ rotation for an arbitrary angle. Use of the $R_X(\\theta)$ gate can reduce the duration and error for single-qubit rotations of arbitrary angle by up to a factor of two. The direct execution of the $R_{ZZ}(\\theta)$ gate rotation avoids decomposition into multiple `CZGate` objects, similarly reducing a circuit's duration and error. This is especially useful for circuits that contain many single- and two-qubit rotations, such as when simulating the dynamics of a quantum system or when using a variational ansatz with many parameters.\n",
5353
"\n",
5454
"\n",
5555
"While these types of gates are in the [library of standard gates](./circuit-library) which a `QuantumCircuit` can possess, they can only be used on specific IBM Quantum QPUs, and which must be loaded with the flag `use_fractional_gates` set to `True` (shown below). This flag will ensure that fractional gates are included in the backend's `Target` for the transpiler.\n",

docs/guides/functions.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"\n",
4747
"| Type | What does it do? | Example inputs and outputs | Who is it for? |\n",
4848
"| - | - | - | - |\n",
49-
"| Circuit function | Simplified interface for running circuits. Abstracts transpilation, error suppression, error mitigation | **Input**: Abstract `PUB`s <br/> **Output**: Mitigated expectation values | Researchers using Qiskit to discover new algorithms and applications, without needing to focus on optimizing for hardware or handling error. Circuit functions can be used to build custom application functions. |\n",
49+
"| Circuit function | Simplified interface for running circuits. Abstracts transpilation, error suppression, error mitigation | **Input**: Abstract `PUB` objects <br/> **Output**: Mitigated expectation values | Researchers using Qiskit to discover new algorithms and applications, without needing to focus on optimizing for hardware or handling error. Circuit functions can be used to build custom application functions. |\n",
5050
"| Application function | Covers higher-level tasks, like exploring algorithms and domain-specific use cases. Abstracts quantum workflow to solve tasks, with classical inputs and outputs | **Input**: Molecules, graphs <br/> **Output**: Ground + excited state energy, optimal values for cost function | Researchers in non-quantum domains, integrating quantum into existing large-scale classical workflows, without needing to map classical data to quantum circuits. |"
5151
]
5252
},

docs/guides/ibm-circuit-function.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
"| | zne_mitigation | | Whether to turn on Zero Noise Extrapolation error mitigation method. Refer to [Error suppression and mitigation techniques](/docs/guides/error-mitigation-and-suppression-techniques#zero-noise-extrapolation-zne) for the explanation of the method. | True/False | False |\n",
275275
"| | zne | amplifier | Which technique to use for amplifying noise. One of: <br/> - `gate_folding` (default) uses 2-qubit gate folding to amplify noise. If the noise factor requires amplifying only a subset of the gates, then these gates are chosen randomly.<br/><br/> - `gate_folding_front` uses 2-qubit gate folding to amplify noise. If the noise factor requires amplifying only a subset of the gates, then these gates are selected from the front of the topologically ordered DAG circuit.<br/><br/> - `gate_folding_back` uses 2-qubit gate folding to amplify noise. If the noise factor requires amplifying only a subset of the gates, then these gates are selected from the back of the topologically ordered DAG circuit.<br/><br/> - `pea` uses a technique called Probabilistic error amplification (PEA) to amplify noise. Refer to [Error suppression and mitigation techniques](/docs/guides/error-mitigation-and-suppression-techniques#probabilistic-error-amplification-pea) for the explanation of the method. | gate_folding / gate_folding_front / gate_folding_back / pea | gate_folding |\n",
276276
"| | | noise_factors | Noise factors to use for noise amplification. | list of floats; each float >= 1 | (1, 1.5, 2) for PEA, and (1, 3, 5) otherwise. |\n",
277-
"| | | extrapolator | Noise factors to evaluate the fit extrapolation models at. This option does not affect execution or model fitting in any way; it only determines the points at which the `extrapolator`s are evaluated to be returned in the data fields called `evs_extrapolated` and `stds_extrapolated`. | one or more of `exponential`,`linear`, `double_exponential`,`polynomial_degree_(1 <= k <= 7)` | (`exponential`, `linear`) |\n",
277+
"| | | extrapolator | Noise factors to evaluate the fit extrapolation models at. This option does not affect execution or model fitting in any way; it only determines the points at which the `extrapolator` objects are evaluated to be returned in the data fields called `evs_extrapolated` and `stds_extrapolated`. | one or more of `exponential`,`linear`, `double_exponential`,`polynomial_degree_(1 <= k <= 7)` | (`exponential`, `linear`) |\n",
278278
"| | pec_mitigation | | Whether to turn on Probabilistic Error Cancellation error mitigation method. Refer to [Error suppression and mitigation techniques](/docs/guides/error-mitigation-and-suppression-techniques#probabilistic-error-cancellation-pec) for the explanation of the method. | True/False | False |\n",
279279
"| | pec | max_overhead | The maximum circuit sampling overhead allowed, or `None` for no maximum. | None/ integer >1 | 100 |\n",
280280
"\n",

docs/guides/monitor-job.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
"id": "ae2820bc-c762-4d2e-944c-58cbc253acbe",
231231
"metadata": {},
232232
"source": [
233-
"To view execution span information, review the metadata of the result returned by `SamplerV2`, which comes in the form of an `ExecutionSpans` object. This object is a list-like container containing subclass instances of `ExecutionSpan`s such as `SliceSpan`:"
233+
"To view execution span information, review the metadata of the result returned by `SamplerV2`, which comes in the form of an `ExecutionSpans` object. This object is a list-like container containing instances of subclasses of `ExecutionSpan`, such as `SliceSpan`:"
234234
]
235235
},
236236
{

docs/guides/primitive-input-output.ipynb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@
355355
" </TabItem>\n",
356356
"</Tabs>\n",
357357
"\n",
358-
"Put simply, a single job returns a `PrimitiveResult` object and contains a list of one or more `PubResult`s. These `PubResult` objects then store the measurement data for each PUB that was submitted to the job.\n",
358+
"Put simply, a single job returns a `PrimitiveResult` object and contains a list of one or more `PubResult` objects. These `PubResult` objects then store the measurement data for each PUB that was submitted to the job.\n",
359359
"\n",
360360
"Each `PubResult` possesses different formats and attributes based on the type of primitive that was used for the job. The specifics are explained below.\n",
361361
"\n",
@@ -487,7 +487,7 @@
487487
"source": [
488488
"### Sampler output\n",
489489
"\n",
490-
"When a Sampler job is completed successfully, the returned [`PrimitiveResult`](/docs/api/qiskit/qiskit.primitives.PrimitiveResult) object contains a list of [`SamplerPubResult`](/docs/api/qiskit/qiskit.primitives.SamplerPubResult)s, one per PUB. The data bins of these `SamplerPubResult`s are dict-like objects that contain one `BitArray` per `ClassicalRegister` in the circuit.\n",
490+
"When a Sampler job is completed successfully, the returned [`PrimitiveResult`](/docs/api/qiskit/qiskit.primitives.PrimitiveResult) object contains a list of [`SamplerPubResult`](/docs/api/qiskit/qiskit.primitives.SamplerPubResult)s, one per PUB. The data bins of these `SamplerPubResult` objects are dict-like objects that contain one `BitArray` per `ClassicalRegister` in the circuit.\n",
491491
"\n",
492492
"The `BitArray` class is a container for ordered shot data. In more detail, it stores the sampled bitstrings as bytes inside a two-dimensional array. The left-most axis of this array runs over ordered shots, while the right-most axis runs over bytes.\n",
493493
"\n",
@@ -584,7 +584,7 @@
584584
"id": "514e0ac0-b42e-4f26-b608-c223dfed7915",
585585
"metadata": {},
586586
"source": [
587-
"When a circuit contains more than one classical register, the results are stored in different `BitArray`s. The following example modifies the previous snippet by splitting the classical register into two distinct registers:"
587+
"When a circuit contains more than one classical register, the results are stored in different `BitArray` objects. The following example modifies the previous snippet by splitting the classical register into two distinct registers:"
588588
]
589589
},
590590
{
@@ -636,9 +636,9 @@
636636
"id": "a65c6078-c5c2-4087-b57a-5680148ce333",
637637
"metadata": {},
638638
"source": [
639-
"#### Leveraging `BitArray`s for performant post-processing\n",
639+
"#### Leveraging `BitArray` objects for performant post-processing\n",
640640
"\n",
641-
"Since arrays generally offer better performance compared to dictionaries, it is advisable to perform any post-processing directly on the `BitArray`s rather than on dictionaries of counts. The `BitArray` class offers a range of methods to perform some common post-processing operations:"
641+
"Since arrays generally offer better performance compared to dictionaries, it is advisable to perform any post-processing directly on the `BitArray` objects rather than on dictionaries of counts. The `BitArray` class offers a range of methods to perform some common post-processing operations:"
642642
]
643643
},
644644
{

docs/guides/qiskit-addons-cutting-gates.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"id": "87b8819b-75d7-4a9e-b91a-00b6155fda9a",
109109
"metadata": {},
110110
"source": [
111-
"Each of the [`CNOT`](/docs/api/qiskit/qiskit.circuit.library.CXGate) gates between qubits $q_0$ and $q_3$ introduce two SWAP gates after transpilation (assuming the qubits are connected in a straight line). To avoid this increase in depth, you can replace these distant gates with [`TwoQubitQPDGate`s](/docs/api/qiskit-addon-cutting/qpd-two-qubit-qpd-gate) using the [`cut_gates()`](/docs/api/qiskit-addon-cutting/qiskit-addon-cutting#cut_gates) method. This function also returns a list of [`QPDBasis`](../api/qiskit-addon-cutting/qpd-qpd-basis) instances - one for each decomposition."
111+
"Each of the [`CNOT`](/docs/api/qiskit/qiskit.circuit.library.CXGate) gates between qubits $q_0$ and $q_3$ introduce two SWAP gates after transpilation (assuming the qubits are connected in a straight line). To avoid this increase in depth, you can replace these distant gates with [`TwoQubitQPDGate`](/docs/api/qiskit-addon-cutting/qpd-two-qubit-qpd-gate) objects using the [`cut_gates()`](/docs/api/qiskit-addon-cutting/qiskit-addon-cutting#cut_gates) method. This function also returns a list of [`QPDBasis`](../api/qiskit-addon-cutting/qpd-qpd-basis) instances - one for each decomposition."
112112
]
113113
},
114114
{

docs/guides/qiskit-addons-cutting-wires.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
"metadata": {},
157157
"source": [
158158
"<Admonition type=\"info\" title=\"Note about expanding observables\">\n",
159-
" When a circuit is expanded through one or more wire cuts, the observable needs to be updated to account for the extra qubits that are introduced. The `qiskit-addon-cutting` package has a convenience function [`expand_observables()`](/docs/api/qiskit-addon-cutting/qiskit-addon-cutting#expand_observables), which takes `PauliList`s and the original and expanded circuits as arguments, and returns a new `PauliList`.\n",
159+
" When a circuit is expanded through one or more wire cuts, the observable needs to be updated to account for the extra qubits that are introduced. The `qiskit-addon-cutting` package has a convenience function [`expand_observables()`](/docs/api/qiskit-addon-cutting/qiskit-addon-cutting#expand_observables), which takes `PauliList` objects and the original and expanded circuits as arguments, and returns a new `PauliList`.\n",
160160
"\n",
161161
" This returned `PauliList` will not contain any information about the original observable's coefficients, but these can be ignored until reconstruction of the final expectation value.\n",
162162
"</Admonition>"

0 commit comments

Comments
 (0)