Skip to content

Commit

Permalink
Update google concepts doc. (quantumlib#5186)
Browse files Browse the repository at this point in the history
* Update google concepts doc.

- Remove form for applying to EAP program.
- Remove references to simulators.
- Change images to remove simulators.
- Remove dangling "Installing cirq".
- Add commas and improve sentences in a few places.

Co-authored-by: Matthew Neeley <mneeley@gmail.com>
  • Loading branch information
2 people authored and tonybruguier committed Apr 19, 2022
1 parent bc324ec commit d52a471
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 35 deletions.
55 changes: 20 additions & 35 deletions docs/google/concepts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@
"except ImportError:\n",
" print(\"installing cirq...\")\n",
" !pip install --quiet cirq\n",
" print(\"installed cirq.\")"
" print(\"installed cirq.\")\n",
" import cirq"
]
},
{
Expand All @@ -88,7 +89,7 @@
"\n",
"Quantum Computing Service gives customers access to Google's quantum computing hardware. Programs that are written in Cirq, an open-source quantum computing program language, can be sent to run on a quantum computer in Google’s quantum computing lab in Santa Barbara, CA. You will be able to do arbitrary single qubit rotations as well as several choices of two qubit gates. Measurements of all qubits as a final step are also supported. \n",
"\n",
"Access is currently only granted to those on an approved list. Apply to become an early access partner with this [questionnaire](https://docs.google.com/forms/d/1DfUWu4zUAJ87GKy-ZoTHrFri5IwIteKtMxKfsy3lmHE).\n"
"**Access is currently only granted to those on an approved list.** No public access to the service is available at this time.\n"
]
},
{
Expand All @@ -99,9 +100,7 @@
"source": [
"## Concepts\n",
"\n",
"Quantum Computing Service uses Cirq, an open source Python framework for creating quantum programs and running them against simulators or against real quantum computers. Here we provide a conceptual overview of how to run a quantum program on a quantum processor.\n",
"\n",
"Installing Cirq:"
"Quantum Computing Service uses Cirq, an open source Python framework for creating quantum programs and running them against real quantum computers. Here we provide a conceptual overview of how to run a quantum program on a quantum processor."
]
},
{
Expand All @@ -112,7 +111,7 @@
"source": [
"### Circuits\n",
"\n",
"The language of quantum computing is the quantum circuit model. Cirq is our open source framework which allows one to write a quantum circuit model in Python. To learn more about Cirq itself, we recommend starting with the [Tutorial](../tutorials/basics.ipynb). Conceptually Cirq can be thought of as a way to create an object in Python that contains the information about a quantum circuit. Here, for example, we create a single circuit made up of square root of NOT gates, controlled-Z gates, and a measurement:"
"The language of quantum computing is the quantum circuit model. Cirq is our open source framework which allows one to write a quantum circuit model in Python. To learn more about Cirq itself, we recommend starting with the [Tutorial](../tutorials/basics.ipynb). Conceptually, Cirq can be thought of as a way to create a quantum circuit as an object in Python. For example, we create a single circuit made up of square root of NOT gates, controlled-Z gates, and a measurement:"
]
},
{
Expand All @@ -121,23 +120,9 @@
"metadata": {
"id": "E2VjfwVubc8V"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"0: ───X^0.5───@────────────────\n",
"\n",
"1: ───X^0.5───@───@────────────\n",
"\n",
"2: ───X^0.5───────@───M('m')───\n"
]
}
],
"outputs": [],
"source": [
"import cirq\n",
"\n",
"q0, q1, q2 = cirq.LineQubit.range(3)\n",
"q0, q1, q2 = cirq.GridQubit.rect(1,3)\n",
"circuit = cirq.Circuit(\n",
" (cirq.X ** 0.5).on_each(q0, q1, q2),\n",
" cirq.CZ(q0, q1),\n",
Expand All @@ -155,9 +140,9 @@
"source": [
"### Quantum Engine API\n",
"\n",
"Quantum Engine is the name of the cloud API which one can call to run the circuits you create in Cirq on simulator or on quantum computers. When access is enabled, users can write code in Cirq that makes a call to Google’s servers to run a circuit that they have built in Cirq on simulators or on quantum computers. Read more about how to do this using cirq's `Engine` class [here](./engine.ipynb).\n",
"Quantum Engine is the name of the cloud API which one can call to run the circuits you create in Cirq on quantum computers. When access is enabled, users can call this API to run circuits on Google’s quantum hardware. Read more about how to do this using cirq's `Engine` class [here](./engine.ipynb).\n",
"\n",
"![Quantum Engine Conceptual Diagram](../images/engine_diagram.png)"
"![Quantum Engine Conceptual Diagram](https://github.com/quantumlib/Cirq/blob/master/docs/images/engine_diagram.png?raw=1)"
]
},
{
Expand All @@ -168,9 +153,9 @@
"source": [
"### Quantum Programs\n",
"\n",
"In Cirq, one creates a `Circuit` in Python. If one then wants to run it using Quantum Engine, one must then upload this Circuit (or Schedule) to the Quantum Engine. The uploaded version of the Circuit/Schedule is called a Program. Programs are not the Python code itself, but a representation of the Circuit in a hardware specific language. Though you will need to make sure that your circuit uses only gates and qubits compatible with the hardware (see `cirq_google.optimized_for_sycamore()` to help with this), the `Engine` class and its corresponding `sampler` will translate the circuit to this serialized form for you.\n",
"In Cirq, one creates a `Circuit` in Python. If one then wants to run it using Quantum Engine, one must then upload this Circuit to the Quantum Engine API. The uploaded version of the Circuit is called a Program. Programs are not the Python code itself, but a representation of the Circuit suitable for running on hardware. The `Engine` class and its corresponding `sampler` will translate the circuit into the format needed by the API for you. You will need to make sure that your circuit uses only gates and qubits compatible with the hardware (see `cirq_google.optimized_for_sycamore()` to help with this).\n",
"\n",
"![Quantum Program Conceptual Diagram](../images/engine_program.png)\n",
"![Quantum Program Conceptual Diagram](https://github.com/quantumlib/Cirq/blob/master/docs/images/engine_program.png?raw=1)\n",
"\n",
"When you upload a program to Quantum Engine, the program is given a name. The organizational unit of Quantum Engine is the cloud project (see below), so when you create a program it is identified by the project id and the program id. We write this as a path\n",
"\n",
Expand All @@ -187,9 +172,9 @@
"source": [
"### Cloud Project\n",
"\n",
"Quantum Engine interfaces with Google Cloud. In Google Cloud one can create different projects with different names. For instance, you might create a project that is for your experiments on quantum computers, and you might create one to manage your side business running servers that day trade Star Wars memorabilia. Everything under your cloud project can be seen by navigating to the Google Cloud console. Here, for example, we see the programs that have been uploaded to a quantum projected called “Quantum Cloud Client”:\n",
"Quantum Engine interfaces with Google Cloud. In Google Cloud, one can create different projects with different names. It is typical to create one project for each experiment you run on the quantum computer, to keep data and access compartmentalized. Everything under your cloud project can be seen by navigating to the Google Cloud console. Here, for example, we see the programs that have been uploaded to a quantum projected called “Quantum Cloud Client”:\n",
"\n",
"![Quantum Cloud Conceptual Diagram](../images/engine_cloud.png)\n",
"![Quantum Cloud Conceptual Diagram](https://github.com/quantumlib/Cirq/blob/master/docs/images/engine_cloud.png?raw=1)\n",
"\n",
"See the [Getting Started](../tutorials/google/start.ipynb) guide for step-by-step instructions on how to create a project and enable the API."
]
Expand All @@ -202,9 +187,9 @@
"source": [
"### Jobs\n",
"\n",
"Once a circuit has been uploaded as a program to Quantum Engine, you can run this program by creating a job. When you create a job on Quantum Engine, the quantum engine then is responsible for routing your program and the information about the job to the appropriate simulator or quantum computer. Note that there is a time limit for job length, so you will want to separate your programs into multiple jobs below this limit.\n",
"Once a circuit has been uploaded as a program to Quantum Engine, you can run this program by creating a job. When you create a job on Quantum Engine, the quantum engine then is responsible for routing your program and the information about the job to the appropriate quantum processor. Note that there is a time limit for job length, so you will want to separate your programs into multiple jobs below this limit.\n",
"\n",
"![Quantum Jobs Conceptual Diagram](../images/engine_job.png)\n",
"![Quantum Jobs Conceptual Diagram](https://github.com/quantumlib/Cirq/blob/master/docs/images/engine_job.png?raw=1)\n",
"\n",
"Quantum Engine is designed so that you can upload a program once and then, if that program has different parameters (see below), you can run this program multiple times by creating multiple jobs for a given program. Jobs are associated with programs, so they have names which include everything about your program, plus a job id:\n",
"\n",
Expand All @@ -221,7 +206,7 @@
"source": [
"### Parameterized Circuits and Job Context\n",
"\n",
"Circuits in Cirq can have quantum gates that are “parameterized”. For example, a gate may represent a rotation of a qubit about the Z axis of the bloch sphere by an angle theta. For parameterized circuit this angle theta is just specified by a variable, say “my-theta”. In order to run such a circuit you will need to be able to tell the circuit what value of “my-theta” should be supplied. In fact you can create a job for a program with parameterized gates which says run this for multiple parameter values. Or each time you create a new job, you can specify new parameter values. These parameter values are supplied in a “job context\"."
"Circuits in Cirq can have quantum gates that are “parameterized”. For example, a gate may represent a rotation of a qubit about the Z axis of the bloch sphere by an angle theta. For a parameterized circuit, this angle theta is specified by a variable, such as “my-theta”. In order to run such a circuit, you will need to be able to tell the circuit what value of “my-theta” should be supplied. To do this, you create a sweep, or run context, that maps “my-theta” to a (list of) specific parameter values."
]
},
{
Expand All @@ -232,9 +217,9 @@
"source": [
"### Results\n",
"\n",
"Once a job has been scheduled to run on a machine (simulator or quantum computer), the machine returns the results of the program to the Quantum Engine. The Quantum Engine stores these results. Users can then query for these results (typically one pulls every fraction of a second):\n",
"Once a job has been scheduled to run on a quantum processor, the machine returns the results of the program to the Quantum Engine. The Quantum Engine stores these results. Users can then query for these results:\n",
"\n",
"![Quantum Results Conceptual Diagram](../images/engine_result.png)\n",
"![Quantum Results Conceptual Diagram](https://github.com/quantumlib/Cirq/blob/master/docs/images/engine_result.png?raw=1)\n",
"\n",
"There is only one result for one job, so results can be identified via the identity of the job followed by result:\n",
"\n",
Expand All @@ -257,7 +242,7 @@
"<project id>/processors/<processor id>\n",
"```\n",
"\n",
"For example, one processor is the “rainbow” processor, which corresponds to a quantum computer located in Santa Barbara. Another processor is “xmonsim” which is a fleet of simulators for the xmon architecture which all run in Google’s production datacenters.\n",
"For example, one processor is the “rainbow” processor, which corresponds to a quantum computer located in Santa Barbara.\n",
"\n",
"Processor have state associated with them. For instance, a processor can be “online” or they can be in “maintenance” mode."
]
Expand Down Expand Up @@ -294,7 +279,7 @@
"\n",
"The schedule of a processor is \"frozen\" for 4 hours into the immediate future so that users can rely on it for the coming day.\n",
"\n",
"The ability to make reservations is restricted by budgets that are delegated by Quantum Computing Service admins. These are provided on a weekly basis and communicated either during the weekly user sync or by email and are good for one week in the future, but this policy is subject to change.\n"
"The ability to make reservations is restricted by budgets that are delegated by Quantum Computing Service admins.\n"
]
}
],
Expand Down
Binary file modified docs/images/engine_diagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/engine_job.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/engine_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d52a471

Please sign in to comment.