Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Commit 64d504c

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 73659dd + 4e76af1 commit 64d504c

73 files changed

Lines changed: 3224 additions & 1153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Qiskit IQX Tutorials
22

3-
[![License](https://img.shields.io/github/license/Qiskit/qiskit-tutorials.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)[![](https://img.shields.io/github/release/Qiskit/qiskit-tutorials.svg?style=popout-square)](https://github.com/Qiskit/qiskit-tutorials/releases)
3+
[![License](https://img.shields.io/github/license/Qiskit/qiskit-iqx-tutorials.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)[![](https://img.shields.io/github/release/Qiskit/qiskit-iqx-tutorials.svg?style=popout-square)](https://github.com/Qiskit/qiskit-iqx-tutorials/releases)
44

55
Welcome to the [Qiskit](https://www.qiskit.org/) IQX Tutorials!
66

@@ -11,7 +11,7 @@ processors, online simulators, and local simulators). The online quantum
1111
processors are the [IBM Q](https://quantum-computing.ibm.com) devices.
1212

1313
For our community-contributed tutorials, please check out the
14-
[qiskit-community-tutorials](https://github.com/Qiskit/qiskit-tutorials-community)
14+
[qiskit-community-tutorials](https://github.com/Qiskit/qiskit-community-tutorials)
1515
repository.
1616

1717
## Installation
@@ -48,7 +48,7 @@ If you'd like to contribute to Qiskit IQX Tutorials, please take a look at our
4848
Qiskit's [code of conduct](.github/CODE_OF_CONDUCT.md). By participating, you
4949
are expect to uphold to this code.
5050

51-
We use [GitHub issues](https://github.com/Qiskit/qiskit-tutorials/issues) for
51+
We use [GitHub issues](https://github.com/Qiskit/qiskit-iqx-tutorials/issues) for
5252
tracking requests and bugs. Please use our [Slack](https://qiskit.slack.com)
5353
for discussion and simple questions. To join our Slack community, use the
5454
[link](https://join.slack.com/t/qiskit/shared_invite/enQtNDc2NjUzMjE4Mzc0LTMwZmE0YTM4ZThiNGJmODkzN2Y2NTNlMDIwYWNjYzA2ZmM1YTRlZGQ3OGM0NjcwMjZkZGE0MTA4MGQ1ZTVmYzk).
@@ -59,7 +59,7 @@ Exchange](https://quantumcomputing.stackexchange.com/questions/tagged/qiskit).
5959
## Authors and Citation
6060

6161
Qiskit IQX Tutorials is the work of [many
62-
people](https://github.com/Qiskit/qiskit-tutorials/graphs/contributors) who
62+
people](https://github.com/Qiskit/qiskit-iqx-tutorials/graphs/contributors) who
6363
contribute to the project at different levels. If you use Qiskit, please cite
6464
as per the included [BibTeX
6565
file](https://github.com/Qiskit/qiskit/blob/master/Qiskit.bib).

qiskit/1_start_here.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@
103103
"[Qiskit AI](advanced/aqua/artificial_intelligence/index.ipynb) - demonstrates using quantum computers to tackle problems in the artificial intelligence domain. These include using a quantum-enhanced support vector machine to experiment with classification problems on a quantum computer.\n",
104104
"\n",
105105
"### 5.2 Qiskit Chemistry\n",
106-
"[Qiskit Chemistry](advanced/aqua/chemistry/index.ipynb) - applications in the domain of quantum chemistry on quantum computers, including ground state energy, dipole moments and dissociation plots\n",
106+
"[Qiskit Chemistry](advanced/aqua/chemistry/index.ipynb) - applications in the domain of quantum chemistry on quantum computers, including ground state energy, dipole moments and dissociation plots.\n",
107107
"\n",
108108
"### 5.3 Qiskit Finance\n",
109109
"[Qiskit Finance](advanced/aqua/finance/index.ipynb) - provides a collection of applications of quantum algorithms to use cases relevant in finance. This includes use cases like portfolio management, derivative pricing, or credit risk analysis.\n",
110110
" \n",
111111
"### 5.4 Qiskit Optimization\n",
112-
"[Qiskit Optimization](advanced/aqua/optimization/index.ipynb) - using VQE (Variational Quantum Eigensolver) to experiment with optimization problems (max-cut and traveling salesman problem) on a quantum computer. Includes optimization problem modelling, using docplex, which can be automatically translated to input suitable for VQE.\n"
112+
"[Qiskit Optimization](advanced/aqua/optimization/index.ipynb) - using VQE (Variational Quantum Eigensolver) to experiment with optimization problems (max-cut and traveling salesman problem) on a quantum computer. This includes optimization problem modelling, using docplex, which can be automatically translated to input suitable for VQE.\n"
113113
]
114114
},
115115
{

qiskit/advanced/aer/1_aer_provider.ipynb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"source": [
1414
"# Qiskit Aer: Simulators\n",
1515
"\n",
16-
"The latest version of this notebook is available on https://github.com/Qiskit/qiskit-tutorials."
16+
"The latest version of this notebook is available on https://github.com/Qiskit/qiskit-iqx-tutorials."
1717
]
1818
},
1919
{
@@ -55,7 +55,7 @@
5555
"* `StatevectorSimulator`: Allows ideal single-shot execution of qiskit circuits and returns the final statevector of the simulator after application\n",
5656
"* `UnitarySimulator`: Allows ideal single-shot execution of qiskit circuits and returns the final unitary matrix of the circuit itself. Note that the circuit cannot contain measure or reset operations for this backend\n",
5757
"\n",
58-
"These backends are found in the `Aer` provider with the names `qasm_simulstor`, `statevector_simulator` and `unitary_simulator` respectively"
58+
"These backends are found in the `Aer` provider with the names `qasm_simulator`, `statevector_simulator` and `unitary_simulator`, respectively."
5959
]
6060
},
6161
{
@@ -90,7 +90,7 @@
9090
"cell_type": "markdown",
9191
"metadata": {},
9292
"source": [
93-
"The simulator backends can also be directly and may be imported from `qiskit.providers.aer`"
93+
"The simulator backends can also be directly imported from `qiskit.providers.aer`"
9494
]
9595
},
9696
{
@@ -113,8 +113,8 @@
113113
"source": [
114114
"## QasmSimulator\n",
115115
"\n",
116-
"The `QasmSimulator` backend is designed to mimic an actual device. It executes a Qiskit `QuantumCircuit` and returns a count dictionary containing the final values of any classical registers in the circuit. The circuit may contain *gates*\n",
117-
"*measure*, *reset*, *conditionals*, and other advanced simulator options that will be discussed in another notebook.\n",
116+
"The `QasmSimulator` backend is designed to mimic an actual device. It executes a Qiskit `QuantumCircuit` and returns a count dictionary containing the final values of any classical registers in the circuit. The circuit may contain *gates*,\n",
117+
"*measurements*, *resets*, *conditionals*, and other advanced simulator options that will be discussed in another notebook.\n",
118118
"\n",
119119
"### Simulating a quantum circuit\n",
120120
"\n",
@@ -163,7 +163,7 @@
163163
"cell_type": "markdown",
164164
"metadata": {},
165165
"source": [
166-
"### Returning measurements outcomes for each shot\n",
166+
"### Returning measurement outcomes for each shot\n",
167167
"\n",
168168
"The `QasmSimulator` also supports returning a list of measurement outcomes for each individual shot. This is enabled by setting the keyword argument `memory=True` in the `assemble` or `execute` function."
169169
]
@@ -211,10 +211,10 @@
211211
"The `QasmSimulator` allows setting a custom initial statevector for the simulation. This means that all experiments in a Qobj will be executed starting in a state $|\\psi\\rangle$ rather than the all zero state $|0,0,..0\\rangle$. The custom state may be set in the circuit using the `initialize` method.\n",
212212
"\n",
213213
"**Note:**\n",
214-
"* The initial statevector must be a valid quantum state $|\\langle\\psi|\\psi\\rangle|=1$. If not an exception will be raised. \n",
214+
"* The initial statevector must be a valid quantum state $|\\langle\\psi|\\psi\\rangle|=1$. If not, an exception will be raised. \n",
215215
"* The simulator supports this option directly for efficiency, but it can also be unrolled to standard gates for execution on actual devices.\n",
216216
"\n",
217-
"We now demonstate this functionality by setting the simulator to be initialized in the the final Bell-state of the previous example:"
217+
"We now demonstrate this functionality by setting the simulator to be initialized in the the final Bell-state of the previous example:"
218218
]
219219
},
220220
{
@@ -261,7 +261,7 @@
261261
"## StatevectorSimulator\n",
262262
"\n",
263263
"\n",
264-
"The `StatevectorSimulator` executes a single shot of a Qiskit `QuantumCircuit` and returns the final quantum statevector of the simulation. The circuit may contain *gates*, and also *measure*, *reset*, and *conditional* operations.\n",
264+
"The `StatevectorSimulator` executes a single shot of a Qiskit `QuantumCircuit` and returns the final quantum statevector of the simulation. The circuit may contain *gates*, and also *measurements*, *resets*, and *conditional* operations.\n",
265265
"\n",
266266
"### Simulating a quantum circuit\n",
267267
"\n",
@@ -453,11 +453,11 @@
453453
"source": [
454454
"### Setting a custom initial unitary\n",
455455
"\n",
456-
"we may also set an initial state for the `UnitarySimulator`, however this state is an initial *unitary matrix* $U_i$, not a statevector. In this case the return unitary will be $U.U_i$ given by applying the circuit unitary to the initial unitary matrix.\n",
456+
"We may also set an initial state for the `UnitarySimulator`, however this state is an initial *unitary matrix* $U_i$, not a statevector. In this case the returned unitary will be $U.U_i$ given by applying the circuit unitary to the initial unitary matrix.\n",
457457
"\n",
458458
"**Note:**\n",
459-
"* The initial unitary must be a valid unitary matrix $U^\\dagger.U =\\mathbb{1}$. If not an exception will be raised. \n",
460-
"* If a Qobj contains multiple experiments, the initial unitary must be the correct size fo *all* experiments in the Qobj, otherwise an exception will be raised.\n",
459+
"* The initial unitary must be a valid unitary matrix $U^\\dagger.U =\\mathbb{1}$. If not, an exception will be raised. \n",
460+
"* If a `Qobj` contains multiple experiments, the initial unitary must be the correct size for *all* experiments in the `Qobj`, otherwise an exception will be raised.\n",
461461
"\n",
462462
"Let us consider preparing the output unitary of the previous circuit as the initial state for the simulator:"
463463
]

qiskit/advanced/aer/2_device_noise_simulation.ipynb

Lines changed: 1323 additions & 359 deletions
Large diffs are not rendered by default.

qiskit/advanced/aer/3_building_noise_models.ipynb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
"\n",
7171
"The `aer.noise` module contains Python classes to build customized noise models for simulation. There are three key classes:\n",
7272
"\n",
73-
"1. The `NoiseModel` class which stores a noise model used for noisy simulation \n",
74-
"2. The `QuantumError` class which describes CPTP gate errors. These can be applied\n",
73+
"1. The `NoiseModel` class which stores a noise model used for noisy simulation.\n",
74+
"2. The `QuantumError` class which describes CPTP gate errors. These can be applied:\n",
7575
" * After *gate* or *reset* instructions\n",
7676
" * Before *measure* instructions.\n",
7777
"\n",
@@ -212,7 +212,7 @@
212212
"source": [
213213
"### Converting to and from QuantumChannel operators\n",
214214
" \n",
215-
" We can also convert back and forth between `QuantumError` objects in Qiskit-Aer and `QuantumChannel` objects in Qiskit-Terra"
215+
"We can also convert back and forth between `QuantumError` objects in Qiskit Aer and `QuantumChannel` objects in Qiskit Terra."
216216
]
217217
},
218218
{
@@ -317,7 +317,7 @@
317317
" * $A$ is the *recorded* classical bit value\n",
318318
" * $B$ is the *true* bit value returned from the measurement \n",
319319
" \n",
320-
"E.g. for 1 qubits: $ P(A|B) = [P(A|0), P(A|1)]$"
320+
"E.g. for 1 qubits: $ P(A|B) = [P(A|0), P(A|1)]$."
321321
]
322322
},
323323
{
@@ -355,7 +355,7 @@
355355
"cell_type": "markdown",
356356
"metadata": {},
357357
"source": [
358-
"Readout errors may also be combined using `compose`, `tensor` and `expand` like with quantum errors"
358+
"Readout errors may also be combined using `compose`, `tensor` and `expand` like with quantum errors."
359359
]
360360
},
361361
{
@@ -509,7 +509,7 @@
509509
"* To execute a noisy simulation we pass the noise model object to `QasmSimulator.run` or `execute` using the `noise_model` kwarg.\n",
510510
"* Eg: `qiskit.execute(circuits, QasmSimulator(), noise_model=noise)`\n",
511511
"\n",
512-
"**Important:** *When running a noisy simulation make sure you compile your qobj to the same basis gates as the noise model!*\n",
512+
"**Important:** *When running a noisy simulation make sure you compile your `Qobj` to the same basis gates as the noise model!*\n",
513513
"\n",
514514
"This can be done using `NoiseModel.basis_gates`"
515515
]
@@ -524,7 +524,7 @@
524524
"source": [
525525
"# Noise Model Examples\n",
526526
"\n",
527-
"We will now give some examples of noise models For our demonstrations we wil use a simple test circuit generating a n-qubit GHZ state:"
527+
"We will now give some examples of noise models. For our demonstrations we will use a simple test circuit generating a n-qubit GHZ state:"
528528
]
529529
},
530530
{
@@ -631,8 +631,8 @@
631631
"\n",
632632
"* When applying a single qubit gate, flip the state of the qubit with probability `p_gate1`.\n",
633633
"* When applying a 2-qubit gate apply single-qubit errors to each qubit.\n",
634-
"* When reseting a qubit reset to 1 instead of 0 with probability `p_reset`\n",
635-
"* When measuring a qubit, flip the state of the qubit before with probability `p_meas`."
634+
"* When resetting a qubit reset to 1 instead of 0 with probability `p_reset`.\n",
635+
"* When measuring a qubit, flip the state of the qubit with probability `p_meas`."
636636
]
637637
},
638638
{
@@ -729,10 +729,10 @@
729729
"source": [
730730
"## Example 2: T1/T2 thermal relaxation\n",
731731
"\n",
732-
"* Now consider a more realistic error model based on thermal relaxation with the qubit environment\n",
733-
"* Each qubit parameterized by a thermal relaxation time constant $T_1$ and a dephasing time constant $T_2$.\n",
734-
"* Note that we must have $T_2 \\le 2 T_1$\n",
735-
"* Error rates on instructions are determined by gate time and qubit $T_1$, $T_2$ values"
732+
"Now consider a more realistic error model based on thermal relaxation with the qubit environment:\n",
733+
"* Each qubit is parameterized by a thermal relaxation time constant $T_1$ and a dephasing time constant $T_2$.\n",
734+
"* Note that we must have $T_2 \\le 2 T_1$.\n",
735+
"* Error rates on instructions are determined by gate times and qubit $T_1$, $T_2$ values."
736736
]
737737
},
738738
{

qiskit/advanced/aer/4_custom_gate_noise.ipynb

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"\n",
5454
"We can use the `Operator` class in `qiskit.quantum_info.operators` to represent arbitrary matrix operators. If the operator is unitary it can then be added to a quantum circuit and used for simulation on Qiskit Aer.\n",
5555
"\n",
56-
"Lets create two operators below for a CNOT gate, and an iSWAP gates:\n",
56+
"Lets create two operators below for a CNOT gate and an iSWAP gate:\n",
5757
"\n",
5858
"$$\\mbox{CNOT} = \\left(\\begin{array} \n",
5959
"& 1 & 0 & 0 & 0 \\\\ \n",
@@ -160,7 +160,7 @@
160160
"cell_type": "markdown",
161161
"metadata": {},
162162
"source": [
163-
"We can confirm this circuit returns the correct using the `Operator` class as a simulator for the circuit:"
163+
"We can confirm this circuit returns the correct output using the `Operator` class as a simulator for the circuit:"
164164
]
165165
},
166166
{
@@ -194,7 +194,7 @@
194194
"cell_type": "markdown",
195195
"metadata": {},
196196
"source": [
197-
"And to confirm the output is corrct we can compute the process fidelity:"
197+
"And to confirm the output is correct we can compute the process fidelity:"
198198
]
199199
},
200200
{
@@ -226,7 +226,7 @@
226226
"source": [
227227
"## Creating a custom unitary in a noise model\n",
228228
"\n",
229-
"The Qiskit Aer QasmSimulator supports simulation of arbitrary unitary operators directly as specified by the `\"unitary\"` in the basis gates."
229+
"The Qiskit Aer `QasmSimulator` supports simulation of arbitrary unitary operators directly as specified by the `\"unitary\"` in the basis gates."
230230
]
231231
},
232232
{
@@ -258,9 +258,9 @@
258258
"cell_type": "markdown",
259259
"metadata": {},
260260
"source": [
261-
"This allows us to add noise models to arbitrary unitaries in our simulation when we identity them using the optional `label` argument of `QuantumCircuit.unitary`.\n",
261+
"This allows us to add noise models to arbitrary unitaries in our simulation when we identify them using the optional `label` argument of `QuantumCircuit.unitary`.\n",
262262
"\n",
263-
"We will now do this by creating a `NoiseModel` that includes a quantum error channel on our custom iSWAP gate. For our example we will create an 2-qubit error consisting of two single-qubit amplitude damping channels with different damping parameters. For now we will assume all the other circuit instructions are ideal."
263+
"We will now do this by creating a `NoiseModel` that includes a quantum error channel on our custom iSWAP gate. For our example we will create a 2-qubit error consisting of two single-qubit amplitude damping channels with different damping parameters. For now we will assume all the other circuit instructions are ideal."
264264
]
265265
},
266266
{
@@ -292,7 +292,7 @@
292292
"cell_type": "markdown",
293293
"metadata": {},
294294
"source": [
295-
"Note that when we add an error to a custom label such as `\"iswap\"` the `NoiseModel` does not know what gate this label is supposed to apply to, so we must manually add the desired gate string to the noise model `basis_gates`. This ensure that the compiler will unroll to the correct basis gates for the noise model simulation. This can done using the `NoiseModel.add_basis_gates` function:"
295+
"Note that when we add an error to a custom label such as `\"iswap\"` the `NoiseModel` does not know what gate this label is supposed to apply to, so we must manually add the desired gate string to the noise model `basis_gates`. This ensures that the compiler will unroll to the correct basis gates for the noise model simulation. This can done using the `NoiseModel.add_basis_gates` function:"
296296
]
297297
},
298298
{
@@ -322,7 +322,7 @@
322322
"cell_type": "markdown",
323323
"metadata": {},
324324
"source": [
325-
"By default the basis gates of a noise model are `['cx','id','u3']` plus any standard QasmSimulator basis gates that are added to the noise model."
325+
"By default the basis gates of a noise model are `['cx','id','u3']` plus any standard `QasmSimulator` basis gates that are added to the noise model."
326326
]
327327
},
328328
{
@@ -336,7 +336,7 @@
336336
"cell_type": "markdown",
337337
"metadata": {},
338338
"source": [
339-
"Let us first take our previous CX circuit and add an initial Hadamard gate and final measurement to create a Bell-state preparation circuit that we may simulator on the `QasmSimulator` both for the ideal and noisy case"
339+
"Let us first take our previous CX circuit and add an initial Hadamard gate and final measurement to create a Bell-state preparation circuit that we may simulator on the `QasmSimulator` both for the ideal and noisy case:"
340340
]
341341
},
342342
{
@@ -380,7 +380,7 @@
380380
"source": [
381381
"### Ideal output\n",
382382
"\n",
383-
"Lets first see the ideal output. Since this generates a Bell-state we expect two peaks for 00 and 11"
383+
"Let's first see the ideal output. Since this generates a Bell-state we expect two peaks for 00 and 11."
384384
]
385385
},
386386
{
@@ -420,7 +420,7 @@
420420
"source": [
421421
"### Noisy circuit execution\n",
422422
"\n",
423-
"Finally lets now simulate it with our custom noise model. Since there is a small amplitude damping error on the two qubit gates we expect small additional peaks for the 01 and 10 outcome probabilities"
423+
"Finally, let's now simulate it with our custom noise model. Since there is a small amplitude damping error on the two qubit gates we expect small additional peaks for the 01 and 10 outcome probabilities."
424424
]
425425
},
426426
{

0 commit comments

Comments
 (0)