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

Commit ebbf910

Browse files
mrossinekjaygambetta
authored andcommitted
Minor fixes - Part 2 of 8 (#800)
* Fix README and INSTALL files. This fixes the following issues: - installation instructions updated to IBMQ v3 - old links are moved to correct location - some typos - consistent formatting * Update gitignore to properly ignore any checkpoints folder * Remove unnecessary executable permissions * Fix start and index notebooks. This introduces the following changes: - fixes typos - adds missing references to other notebooks * Fix typos in qiskit/fundamentals chapter 1 * Update qiskit/fundamentals chapter 2 - fixes typos - adds missing figure of `plot_state_qsphere(psi)` * Fix qiskit/fundamentals chapter 3 - fixes typos - adds links to the final section ("Updating from previous versions") - removes some redundant cells * Fix typos in qiskit/fundamentals chapter 4 * Fix typos in qiskit/fundamentals chapter 5 * Fix typos in qiskit/fundamentals chapter 6 * Fix typos in qiskit/fundamentals chapter 7
1 parent c61f4c1 commit ebbf910

7 files changed

Lines changed: 156 additions & 150 deletions

qiskit/fundamentals/1_getting_started_with_qiskit.ipynb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@
585585
"source": [
586586
"## Running circuits from the IBM Q account <a name='ibmq'></a>\n",
587587
"\n",
588-
"To faciliate access to real quantum computing hardware, we have provided a simple API interface.\n",
588+
"To facilitate access to real quantum computing hardware, we have provided a simple API interface.\n",
589589
"To access IBM Q devices, you'll need an API token. You can generate, or view, your API token [here](https://quantum-computing.ibm.com/account) (create an account if you don't already have one).\n",
590590
"\n",
591591
"Your IBM Q account lets you run your circuit on real devices or on our cloud simulator. Basic account usage can be seen in the examples below. For more detailed instructions on using the IBM Q account, see [Part 3: The IBMQ Account](3_the_ibmq_account.ipynb)."
@@ -700,7 +700,7 @@
700700
"cell_type": "markdown",
701701
"metadata": {},
702702
"source": [
703-
"the ask the provider to list its backends:"
703+
"then ask the provider to list its backends:"
704704
]
705705
},
706706
{
@@ -867,8 +867,7 @@
867867
"source": [
868868
"### Simulating circuits using the IBM Q cloud simulator\n",
869869
"\n",
870-
"The IBM Q provider also comes with a remote optimized simulator called ``ibmq_qasm_simulator``. This remote simulator is capable of simulating up to 32 qubits. It can be used the \n",
871-
"same way as the remote real backends. "
870+
"The IBM Q provider also comes with a remote optimized simulator called ``ibmq_qasm_simulator``. This remote simulator is capable of simulating up to 32 qubits. It can be used the same way as the remote real backends. "
872871
]
873872
},
874873
{
@@ -947,7 +946,7 @@
947946
"### Retrieving a previously run job\n",
948947
"\n",
949948
"If your experiment takes longer to run then you have time to wait around, or if you simply want to retrieve old jobs, the IBM Q backends allow you to do that.\n",
950-
"First you would need to note your job's ID:"
949+
"First, you would need to note your job's ID:"
951950
]
952951
},
953952
{
@@ -979,7 +978,7 @@
979978
"cell_type": "markdown",
980979
"metadata": {},
981980
"source": [
982-
"Given a job ID, that job object can be later reconstructed from the backend using retrieve_job:"
981+
"Given a job ID, that job object can be later reconstructed from the backend using ```retrieve_job```:"
983982
]
984983
},
985984
{

qiskit/fundamentals/2_plotting_data_in_qiskit.ipynb

Lines changed: 28 additions & 16 deletions
Large diffs are not rendered by default.

qiskit/fundamentals/3_the_ibmq_account.ipynb

Lines changed: 30 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@
2020
"source": [
2121
"In Qiskit we have an interface for backends and jobs that is useful for running circuits and extending to third-party backends. In this tutorial, we will review the core components of Qiskit’s base backend framework, using the IBM Q account as an example.\n",
2222
"\n",
23-
"The interface has four main component: the account, providers, backends, and jobs:\n",
23+
"The interface has four main components: the account, providers, backends, and jobs:\n",
2424
"\n",
25-
"- **account**: Gives access to one or more ‘providers’ based on account permissions.\n",
25+
"- **account**: Gives access to one or more ‘providers’ based on the account's permissions.\n",
2626
"\n",
27-
"- **providers**: Provides access to quantum devices and simulators, collectively called ‘backends’, and additional services tailored to a specific backend instance.\n",
27+
"- **provider**: Provides access to quantum devices and simulators, collectively called ‘backends’, and additional services tailored to a specific backend instance.\n",
2828
"\n",
29-
"- **backends**: A quantum device or simulator capable of running quantum circuits or pulse schedules.\n",
29+
"- **backend**: A quantum device or simulator capable of running quantum circuits or pulse schedules.\n",
3030
"\n",
31-
"- **jobs**: A local reference to a collection of quantum circuits or pulse schedules submitted to a given backend."
31+
"- **job**: A local reference to a collection of quantum circuits or pulse schedules submitted to a given backend."
3232
]
3333
},
3434
{
@@ -51,7 +51,10 @@
5151
"3) [Backends](#backends)\n",
5252
" \n",
5353
" \n",
54-
"3) [Jobs](#jobs)"
54+
"4) [Jobs](#jobs)\n",
55+
"\n",
56+
"\n",
57+
"5) [Updating from previous versions](#updating)"
5558
]
5659
},
5760
{
@@ -64,7 +67,7 @@
6467
"\n",
6568
"The `IBMQ` account has functions for handling administrative tasks. The credentials can be saved to disk, or used in a session and never saved.\n",
6669
"\n",
67-
"- `enable_account(TOKEN)`: Enable your account in the current session\n",
70+
"- `enable_account(TOKEN)`: Enable your account in the current session.\n",
6871
"- `save_account(TOKEN)`: Save your account to disk for future use.\n",
6972
"- `load_account()`: Load account using stored credentials.\n",
7073
"- `disable_account()`: Disable your account in the current session.\n",
@@ -74,12 +77,7 @@
7477
"\n",
7578
"\n",
7679
"\n",
77-
"In order to access quantum devices, simulators, or other services, you must specify the source of these items by selecting a provider. To see all the providers available:\n",
78-
"\n",
79-
"\n",
80-
"<div class=\"alert alert-block alert-info\">\n",
81-
"<b>Note:</b> The use of `provider` instances is the default way of retrieving backends from Qiskit 0.11 onwards - if you have been using earlier versions of Qiskit, check the \"Updating from previous versions\" section for more detailed instructions on updating and using the different options.</div>\n",
82-
"</div>"
80+
"In order to access quantum devices, simulators, or other services, you must specify the source of these items by selecting a provider. To see all the providers available do the following:"
8381
]
8482
},
8583
{
@@ -120,14 +118,18 @@
120118
"source": [
121119
"where we have assumed that the user has stored their IBMQ account information locally ahead of time using `IBMQ.save_account(TOKEN)`.\n",
122120
"\n",
121+
"<div class=\"alert alert-block alert-info\">\n",
122+
"<b>Note:</b> The use of `provider` instances is the default way of retrieving backends from Qiskit 0.11 onwards - if you have been using earlier versions of Qiskit, check the <a href=\"#updating\">\"Updating from previous versions\"</a> section for more detailed instructions on updating and using the different options.</div>\n",
123+
"</div>\n",
124+
"\n",
123125
"The above example shows two different providers. All `IBMQ` providers are specified by a `hub`, `group`, and `project`. The provider given by `hub='ibm-q', group='open', project='main'` is the provider that gives access to the public IBM Q devices available to all IQX users. The second is an example of a provider that is only unlocked for a specific set of users. Members of the IBM Q network may see one or more providers (with names different than those shown above) depending on the access level granted to them."
124126
]
125127
},
126128
{
127129
"cell_type": "markdown",
128130
"metadata": {},
129131
"source": [
130-
"To access a given provider one should use the get_provider() method of the IBMQ account, filtering by `hub`, `group`, or `project`:"
132+
"To access a given provider one should use the `get_provider()` method of the `IBMQ` account, filtering by `hub`, `group`, or `project`:"
131133
]
132134
},
133135
{
@@ -265,43 +267,13 @@
265267
"backend"
266268
]
267269
},
268-
{
269-
"cell_type": "markdown",
270-
"metadata": {},
271-
"source": [
272-
"and backends which are available in the default provider"
273-
]
274-
},
275-
{
276-
"cell_type": "code",
277-
"execution_count": 7,
278-
"metadata": {},
279-
"outputs": [
280-
{
281-
"data": {
282-
"text/plain": [
283-
"[<IBMQBackend('ibmqx4') from IBMQ()>,\n",
284-
" <IBMQBackend('ibmqx2') from IBMQ()>,\n",
285-
" <IBMQBackend('ibmq_16_melbourne') from IBMQ()>,\n",
286-
" <IBMQSimulator('ibmq_qasm_simulator') from IBMQ()>]"
287-
]
288-
},
289-
"execution_count": 7,
290-
"metadata": {},
291-
"output_type": "execute_result"
292-
}
293-
],
294-
"source": [
295-
"provider.backends()"
296-
]
297-
},
298270
{
299271
"cell_type": "markdown",
300272
"metadata": {},
301273
"source": [
302274
"### Filtering the Backends\n",
303275
"\n",
304-
"You may also optionally filter the set of returned backends, by passing arguments that query the backend’s `configuration`, `status`, or `properties`. The filters are passed by conditions and, for more general filters, you can make advanced functions using the lambda function.\n",
276+
"You may also optionally filter the set of returned backends, by passing arguments that query the backend’s `configuration`, `status`, or `properties`. The filters are passed by conditions and, for more general filters, you can make advanced functions using a lambda function.\n",
305277
"\n",
306278
"As a first example lets return only those backends that are real quantum devices, and that are currently operational:"
307279
]
@@ -438,17 +410,17 @@
438410
"cell_type": "markdown",
439411
"metadata": {},
440412
"source": [
441-
"For remote backends they must support the additional\n",
413+
"For remote backends they must support the additional methods:\n",
442414
"\n",
443415
"- `jobs()`: Returns a list of previous jobs executed on this backend through the current provider instance.\n",
444416
"- `retrieve_job(JOB_ID)`: Returns a job by a job_id.\n",
445417
"\n",
446418
"On a per device basis, the following commands may be supported:\n",
447419
"\n",
448420
"- `defaults()`: Gives a data structure of typical default parameters.\n",
449-
"- `schema()`: Fets a schema for the backend.\n",
421+
"- `schema()`: Gets a schema for the backend.\n",
450422
"\n",
451-
"There are some IBM Q backend only attributes:\n",
423+
"There are some \"IBM Q backend\"-only attributes:\n",
452424
"\n",
453425
"- `hub`: The IBMQ hub for this backend.\n",
454426
"- `group`: The IBMQ group for this backend.\n",
@@ -656,7 +628,7 @@
656628
"cell_type": "markdown",
657629
"metadata": {},
658630
"source": [
659-
"A `job` can be retrieved using `retrieve_job(JOB_ID)` method"
631+
"A `job` can be retrieved using the `retrieve_job(JOB_ID)` method:"
660632
]
661633
},
662634
{
@@ -687,20 +659,18 @@
687659
"- `cancel()`: Cancels the job.\n",
688660
"- `result()`: Gets the results from the circuit run.\n",
689661
"\n",
690-
"IBM Q job only functions include:\n",
662+
"\"IBM Q job\"-only functions include:\n",
691663
"\n",
692664
"- `creation_date()`: Gives the date at which the job was created.\n",
693665
"- `queue_position()`: Returns the position of the job in the queue.\n",
694-
"- `error_message()`: The error message of failed jobs, if any.\n",
695-
"\n",
696-
"Let’s start with the `status()`. This returns the job status and a message"
666+
"- `error_message()`: The error message of failed jobs, if any."
697667
]
698668
},
699669
{
700670
"cell_type": "markdown",
701671
"metadata": {},
702672
"source": [
703-
"Let's start with the `status()`. This returns the job status and a message"
673+
"Let's start with the `status()`. This returns the job status and a message:"
704674
]
705675
},
706676
{
@@ -732,7 +702,7 @@
732702
"cell_type": "markdown",
733703
"metadata": {},
734704
"source": [
735-
"To get a backend object from the job, use the `backend()` method"
705+
"To get a backend object from the job, use the `backend()` method:"
736706
]
737707
},
738708
{
@@ -765,7 +735,7 @@
765735
"cell_type": "markdown",
766736
"metadata": {},
767737
"source": [
768-
"To get the job_id use the `job_id()` method"
738+
"To get the job_id use the `job_id()` method:"
769739
]
770740
},
771741
{
@@ -797,7 +767,7 @@
797767
"cell_type": "markdown",
798768
"metadata": {},
799769
"source": [
800-
"To get the result from the job, use the `result()` method"
770+
"To get the result from the job, use the `result()` method:"
801771
]
802772
},
803773
{
@@ -828,7 +798,7 @@
828798
"cell_type": "markdown",
829799
"metadata": {},
830800
"source": [
831-
"If you want to check the creation date, use `creation_date()`"
801+
"If you want to check the creation date, use `creation_date()`:"
832802
]
833803
},
834804
{
@@ -860,7 +830,7 @@
860830
"cell_type": "markdown",
861831
"metadata": {},
862832
"source": [
863-
"Let's make an active example"
833+
"Let's make an active example."
864834
]
865835
},
866836
{
@@ -965,7 +935,7 @@
965935
"cell_type": "markdown",
966936
"metadata": {},
967937
"source": [
968-
"## Updating from previous versions\n",
938+
"## Updating from previous versions <a name='updating'></a>\n",
969939
"\n",
970940
"Since `Qiskit` version `0.11`, the IBM Q account defaults to using the new [IBM Q Experience](https://quantum-computing.ibm.com), which supersedes the legacy Quantum Experience and Q-console.\n",
971941
"\n",

qiskit/fundamentals/4_quantum_circuit_properties.ipynb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"source": [
6464
"## Introduction <a name='introduction'></a>\n",
6565
"\n",
66-
"When constructing quantum circuits, there are several properties that help quantify the \"size\" of the circuits, and their ability to be run on a noisy quantum device. Some of these, like number of qubits, are straightforward to understand. While others like depth and number of tensor components require a bit more explanation. Here we will explain all of these properties, and in preparation of understanding how circuits change when run on actual devices, highlight the conditions under which they change.\n",
66+
"When constructing quantum circuits, there are several properties that help quantify the \"size\" of the circuits, and their ability to be run on a noisy quantum device. Some of these, like number of qubits, are straightforward to understand, while others like depth and number of tensor components require a bit more explanation. Here we will explain all of these properties, and, in preparation for understanding how circuits change when run on actual devices, highlight the conditions under which they change.\n",
6767
"\n",
6868
"\n",
6969
"### Basics\n",
@@ -156,7 +156,7 @@
156156
"cell_type": "markdown",
157157
"metadata": {},
158158
"source": [
159-
"we can also just get the number of qubits directly:"
159+
"We can also just get the number of qubits directly:"
160160
]
161161
},
162162
{
@@ -188,7 +188,7 @@
188188
"cell_type": "markdown",
189189
"metadata": {},
190190
"source": [
191-
"It is also straightforward to get the number and type of the gates in a circuit using `count_ops`:"
191+
"It is also straightforward to get the number and type of the gates in a circuit using `count_ops()`:"
192192
]
193193
},
194194
{
@@ -220,7 +220,7 @@
220220
"cell_type": "markdown",
221221
"metadata": {},
222222
"source": [
223-
"We can also get just the raw count of operations by computing the circuits **size**."
223+
"We can also get just the raw count of operations by computing the circuits **size**:"
224224
]
225225
},
226226
{
@@ -261,7 +261,7 @@
261261
"source": [
262262
"A particularly important circuit property is known as the **depth**. The depth of a quantum circuit is a measure of how many \"layers\" of quantum gates, executed in parallel, it takes to complete the computation defined by the circuit. Because quantum gates take time to implement, the depth of a circuit roughly corresponds to the amount of time it takes the quantum computer to execute the circuit. Thus, the depth of a circuit is one important quantity used to measure if a quantum circuit can be run on a device.\n",
263263
"\n",
264-
"The depth of a quantum circuit has a mathematical definition as the longest path in a directed acyclic graph (DAG). However, such a definition is a bit hard to grasp, even for experts. Fortunately, the depth of a circuit can be easily understood by anyone familiar with playing [Tetris](https://en.wikipedia.org/wiki/Tetris). To undertand this let us redraw the circuit, with the first five CNOT gates colored differently for clarity:"
264+
"The depth of a quantum circuit has a mathematical definition as the longest path in a directed acyclic graph (DAG). However, such a definition is a bit hard to grasp, even for experts. Fortunately, the depth of a circuit can be easily understood by anyone familiar with playing [Tetris](https://en.wikipedia.org/wiki/Tetris). To understand this, let us redraw the circuit with the first five CNOT gates colored differently for clarity:"
265265
]
266266
},
267267
{
@@ -435,7 +435,7 @@
435435
"cell_type": "markdown",
436436
"metadata": {},
437437
"source": [
438-
"The **width** of the circuit now includes the number of qubits and number of classical bits:"
438+
"The **width** of the circuit now includes the number of qubits _and_ number of classical bits:"
439439
]
440440
},
441441
{
@@ -541,9 +541,7 @@
541541
}
542542
},
543543
"source": [
544-
"### Depth\n",
545-
"\n",
546-
"The depth of the circuit has now increased because measurements are included in the depth computation as they perform physical operations:"
544+
"The **depth** of the circuit has now increased because measurements are included in the depth computation as they perform physical operations:"
547545
]
548546
},
549547
{
@@ -575,7 +573,7 @@
575573
"cell_type": "markdown",
576574
"metadata": {},
577575
"source": [
578-
"Barriers and other special commands like snapshots do not count toward the depth directly. However, gates cannot pass through them and must therefore start stacking on top."
576+
"Barriers and other special commands like snapshots do not count towards the depth directly. However, gates cannot pass through them and must therefore start stacking on top."
579577
]
580578
},
581579
{
@@ -746,7 +744,7 @@
746744
"cell_type": "markdown",
747745
"metadata": {},
748746
"source": [
749-
"This simple example is meant to illustrate a very important point: **When running circuits on actual quantum devices, the circuit that gets run is in general not the same circuit that you constructed**. In addition, the depth of that new circuit is likely to be larger, and in some cases much larger, than the original one. Fortunately, there are often times where one can reduce this overhead through smart circuit rewriting toolchains."
747+
"This simple example is meant to illustrate a very important point: **When running circuits on actual quantum devices, the circuit that gets run is in general not the same circuit that you constructed**. In addition, the depth of that new circuit is likely to be larger, and in some cases much larger, than the original one. Fortunately, often times one can reduce this overhead through smart circuit rewriting toolchains."
750748
]
751749
},
752750
{

0 commit comments

Comments
 (0)