Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor cleanup of QCS tutorial #5184

Merged
merged 2 commits into from
Apr 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions docs/tutorials/google/start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@
"source": [
"try:\n",
" import cirq\n",
" import cirq_google as cg\n",
"except ImportError:\n",
" print(\"installing cirq-google...\")\n",
" !pip install --quiet cirq-google --pre\n",
" print(\"installed cirq-google.\")"
" print(\"installed cirq-google.\")\n",
" import cirq\n",
" import cirq_google as cg"
]
},
{
Expand Down Expand Up @@ -160,8 +163,6 @@
}
],
"source": [
"import cirq_google as cg\n",
"\n",
"# The Google Cloud Project id to use.\n",
"project_id = \"\" #@param {type:\"string\"}\n",
"processor_id = \"pacific\" #@param {type:\"string\"}\n",
Expand Down Expand Up @@ -191,7 +192,7 @@
},
"source": [
"## Create a circuit\n",
"Now that you've enabled Quantum Computing Service and configured the notebook, let's create a basic program with Cirq. After reviewing the code, **run this block** to run a circuit, and print a circuit diagram and results. To learn more, refer to the [Intro to Cirq](../basics.ipynb) and [Cirq documentation](https://cirq.readthedocs.io)."
"Now that you've enabled Quantum Computing Service and configured the notebook, let's create a basic program with Cirq. After reviewing the code, **run this block** to run a circuit, and print a circuit diagram and results. To learn more, refer to the [Cirq overview](https://quantumai.google/cirq) and [Cirq basics](../basics.ipynb) pages."
]
},
{
Expand All @@ -212,9 +213,6 @@
}
],
"source": [
"import cirq\n",
"import cirq_google as cg\n",
"\n",
"# Define a qubit at an arbitrary grid location.\n",
"qubit = cirq.GridQubit(0, 0)\n",
"\n",
Expand Down Expand Up @@ -272,7 +270,7 @@
},
"source": [
"## Run on quantum hardware\n",
"Approved users can access quantum hardware in two modes. First, all approved users have access to a processor in \"open-swim\" which is a first-in-first-out queue with fairness algorithm that balances jobs across users in the queue. Secondly, processors can be reserved in hourly blocks if the user is approved. You can learn more about the reservation system on the [concepts page](../../google/engine.md). We'll use the processor `pacific` in this demo."
"Approved users can access quantum hardware in two modes. First, all approved users have access to a processor in \"open-swim\" which is a first-in-first-out queue with fairness algorithm that balances jobs across users in the queue. Secondly, processors can be reserved in hourly blocks if the user is approved. You can learn more about the reservation system on the [concepts page](../../google/concepts.ipynb). We'll use the processor `pacific` in this demo."
]
},
{
Expand Down Expand Up @@ -462,23 +460,17 @@
"\n",
"If you are planning to access Quantum Computing Service from the command line, follow these instructions to get started. If you plan on executing all of your programs from an ipython notebook, you can skip this section.\n",
"\n",
"We assume that your local machine is configured to run Python 3.6 or greater. \n",
"### Setup Cirq\n",
"\n",
"Instructions for installing Python 3:\n",
"Follow the [Cirq Install](../../install.md) page to install Cirq locally. We highly recommend that you setup a virtual environment for this installation to isolate your development stack from your overall system installations. Make sure to setup the virtual environment for Python 3 and not Python 2.\n",
"\n",
"* Linux: https://docs.python-guide.org/starting/install3/linux/\n",
"* Mac: https://docs.python-guide.org/starting/install3/osx/\n",
"* Windows: If you are using Windows Subsystem for Linux: https://docs.python-guide.org/starting/install3/linux/, otherwise: https://docs.python-guide.org/starting/install3/win/\n",
"### Setup Google Cloud authentication\n",
"\n",
"### Setup authentication\n",
"\n",
"In this quickstart we will authenticate using the gcloud command line cool. To do this, one must first install gcloud. Follow the instructions for this at https://cloud.google.com/sdk/install. If you are running on a corp desktop, gcloud should be installed. We will authenticate using Application Default Credentials. To do this simply run the following on your shell command line\n",
"In this quickstart we will authenticate using the gcloud command line cool. To do this, one must first install gcloud. Follow the instructions for this at https://cloud.google.com/sdk/install. We will authenticate using Application Default Credentials. To do this simply run the following on your shell command line\n",
"\n",
"`gcloud auth application-default login`\n",
"\n",
"This will open up a browser window or give you a link to a webpage you can navigate to in order to go through an authentication flow. Complete this using your @google.com account. After this command is run, credentials will be stored on your local machine. If at any point you want to revoke these credentials you can run `gcloud auth application-default revoke`\n",
"\n",
"We highly recommend that you setup a virtual environment for this installation to isolate your development stack from your overall system installations. Instructions for virtual environments are at https://packaging.python.org/guides/installing-using-pip-and-virtual-environments/. Make sure to setup the virtual environment for Python 3 and not Python 2."
"This will open up a browser window or give you a link to a webpage you can navigate to in order to go through an authentication flow. Complete this using your Google account. After this command is run, credentials will be stored on your local machine. If at any point you want to revoke these credentials you can run `gcloud auth application-default revoke`."
]
},
{
Expand Down