Skip to content

Commit

Permalink
Minor cleanup of QCS tutorial (quantumlib#5184)
Browse files Browse the repository at this point in the history
  • Loading branch information
verult authored and rht committed May 1, 2023
1 parent a9a2ade commit 52937c6
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions docs/tutorials/google/start.ipynb
Original file line number Diff line number Diff line change
@@ -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"
]
},
{
@@ -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",
@@ -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."
]
},
{
@@ -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",
@@ -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."
]
},
{
@@ -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`."
]
},
{

0 comments on commit 52937c6

Please sign in to comment.