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

Update start notebook to use get_engine instead of get_qcs_objects_for_notebook #6483

Merged
merged 9 commits into from
Mar 5, 2024
21 changes: 8 additions & 13 deletions docs/tutorials/google/start.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -132,22 +132,16 @@
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "YoqI9GrOPExP",
"cellView": "form"
"id": "YoqI9GrOPExP"
},
"outputs": [],
"source": [
"# The Google Cloud Project id to use.\n",
"project_id = \"\" #@param {type:\"string\"}\n",
"\n",
"from cirq_google.engine.qcs_notebook import get_qcs_objects_for_notebook\n",
"# For virtual engine instances, set 'virtual=True' below.\n",
"qcs_objects = get_qcs_objects_for_notebook(project_id)\n",
"from cirq_google.engine import get_engine\n",
"\n",
"engine = qcs_objects.engine\n",
"if not qcs_objects.signed_in:\n",
" print(\"ERROR: Please setup project_id in this cell or set the `GOOGLE_CLOUD_PROJECT` env var to your project id.\")\n",
" print(\"Using noisy simulator instead.\")\n"
"engine = get_engine(project_id)"
]
},
{
Expand Down Expand Up @@ -175,11 +169,11 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 24,
"metadata": {
"cellView": "both",
"id": "EQoTYZIEPa9S",
"outputId": "43c72568-3bc8-4b44-871b-b9db19c9e672",
"outputId": "beb04676-8404-4831-8d40-3291ee2d6127",
"colab": {
"base_uri": "https://localhost:8080/"
}
Expand Down Expand Up @@ -275,7 +269,8 @@
{
"cell_type": "code",
"source": [
"processors = [p.processor_id for p in engine.list_processors() if p.health() == 'OK']"
"processors = [p.processor_id for p in engine.list_processors() if p.health() == 'OK']\n",
"print(f\"Available processors: {processors}\")"
],
"metadata": {
"id": "rvMeXrC1wnQi"
Expand Down Expand Up @@ -586,4 +581,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
Loading