Skip to content

Commit 528b2d2

Browse files
authored
Update list of pre-release notebooks (#6609)
- Update the stale list of pre-release notebooks by dropping notebooks that work with the last release 1.3.0 - Enable notebook tests that pass at Cirq HEAD - Fix old instructions on installing pre-release cirq - Add missing import to examples/stabilizer_code.ipynb Ref: https://github.com/quantumlib/Cirq/blob/main/docs/dev/notebooks.md
1 parent e11d297 commit 528b2d2

13 files changed

+19
-56
lines changed

dev_tools/notebooks/isolated_notebook_test.py

-12
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,10 @@
4444
NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES: List[str] = [
4545
# Requires pinned quimb from #6438
4646
'cirq-core/cirq/contrib/quimb/Contract-a-Grid-Circuit.ipynb',
47-
# Hardcoded qubit placement
48-
'docs/google/qubit-placement.ipynb',
4947
# get_qcs_objects_for_notebook
5048
'docs/noise/calibration_api.ipynb',
51-
'docs/tutorials/google/colab.ipynb',
52-
'docs/tutorials/google/identifying_hardware_changes.ipynb',
53-
'docs/tutorials/google/echoes.ipynb',
5449
'docs/noise/floquet_calibration_example.ipynb',
55-
'docs/tutorials/google/spin_echoes.ipynb',
56-
'docs/tutorials/google/start.ipynb',
57-
'docs/tutorials/google/visualizing_calibration_metrics.ipynb',
5850
'docs/noise/qcvv/xeb_calibration_example.ipynb',
59-
'docs/named_topologies.ipynb',
60-
'docs/start/intro.ipynb',
61-
# Circuit routing
62-
'docs/transform/routing_transformer.ipynb',
6351
]
6452

6553
# By default all notebooks should be tested, however, this list contains exceptions to the rule

dev_tools/notebooks/notebook_test.py

-4
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
# disabled to unblock Python 3.12. TODO(#6590) - fix and enable.
4141
'cirq-core/cirq/contrib/quimb/Contract-a-Grid-Circuit.ipynb',
4242
# skipping fidelity estimation due to
43-
# https://github.com/quantumlib/Cirq/issues/3502
44-
'examples/*fidelity*',
4543
# skipping quantum utility simulation (too large)
4644
'examples/advanced/*quantum_utility*',
4745
# tutorials that use QCS and arent skipped due to one or more cleared output cells
@@ -53,8 +51,6 @@
5351
# temporary: need to fix QVM metrics and device spec
5452
'docs/tutorials/google/spin_echoes.ipynb',
5553
'docs/tutorials/google/visualizing_calibration_metrics.ipynb',
56-
# shouldn't have outputs generated for style reasons
57-
'docs/simulate/qvm_builder_code.ipynb',
5854
]
5955

6056

docs/dev/notebooks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ You should configure notebooks differently depending on whether they rely on fea
7878
When you introduce a notebook that depends on pre-release features of Cirq, make sure to
7979

8080
- mark the notebook at the top that `Note: this notebook relies on unreleased Cirq features. If you want to try these feature, make sure you install cirq via pip install cirq~=1.0.dev`.
81-
- use `pip install cirq —pre` in the installation instructions
81+
- use `pip install cirq~=1.0.dev` in the installation instructions
8282
- make sure [notebook_test.py](https://github.com/quantumlib/Cirq/blob/main/dev_tools/notebooks/notebook_test.py) covers the notebook
8383
- exclude the notebook from the [isolated_notebook_test.py](https://github.com/quantumlib/Cirq/blob/main/dev_tools/notebooks/isolated_notebook_test.py) by adding it to `NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES`
8484

@@ -92,7 +92,7 @@ When you introduce a notebook that only uses already released features of Cirq,
9292

9393
At release time, we change all the **pre-release notebooks** in bulk:
9494
- remove the pre-release notices
95-
- change `pip install cirq —pre` to `pip install cirq`
95+
- change `pip install cirq~=1.0.dev` to `pip install cirq`
9696
- remove the exclusions in [isolated_notebook_test.py](https://github.com/quantumlib/Cirq/blob/main/dev_tools/notebooks/isolated_notebook_test.py) by making `NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES=[]`
9797

9898
As all the notebooks have been tested continuously up to this point, the release notebook PR should pass without issues.

docs/google/qubit-placement.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
"source": [
4040
"# Qubit Placement\n",
4141
"\n",
42-
"This notebooks walks through qubit placement runtime features exposed through the `cirq_google.workflow` tools.",
43-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
42+
"This notebooks walks through qubit placement runtime features exposed through the `cirq_google.workflow` tools."
4443
]
4544
},
4645
{
@@ -77,8 +76,7 @@
7776
" import cirq\n",
7877
"except ImportError:\n",
7978
" print(\"installing cirq...\")\n",
80-
" # This depends on unreleased (as of 1.14) qubit placement functions.\n",
81-
" !pip install --quiet cirq~=1.0.dev\n",
79+
" !pip install --quiet cirq\n",
8280
" print(\"installed cirq.\")\n",
8381
" import cirq"
8482
]

docs/named_topologies.ipynb

+1-10
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,6 @@
6464
"</table>"
6565
]
6666
},
67-
{
68-
"cell_type": "markdown",
69-
"metadata": {
70-
"id": "ea381f53cf89"
71-
},
72-
"source": [
73-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
74-
]
75-
},
7667
{
7768
"cell_type": "code",
7869
"execution_count": null,
@@ -85,7 +76,7 @@
8576
" import cirq\n",
8677
"except ImportError:\n",
8778
" print(\"installing cirq...\")\n",
88-
" !pip install --quiet cirq~=1.0.dev\n",
79+
" !pip install --quiet cirq\n",
8980
" print(\"installed cirq.\")\n",
9081
" \n",
9182
"import cirq"

docs/start/intro.ipynb

+2-5
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,7 @@
8282
"source": [
8383
"To use Cirq one first needs to install Cirq. Installation instructions are available at [https://quantumai.google/cirq/start/install](https://quantumai.google/cirq/start/install). For the purpose of this tutorial, we run `pip install cirq` as shown in the following code cell to install the latest release of Cirq. \n",
8484
"\n",
85-
"> Different notebook execution systems exist, but for most part they have \"run\" button on a cell which you can click, or \"shift + enter\" is often the shortcut to run the cell. \n",
86-
"\n",
87-
"\n",
88-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`.\n"
85+
"> Different notebook execution systems exist, but for most part they have \"run\" button on a cell which you can click, or \"shift + enter\" is often the shortcut to run the cell. \n"
8986
]
9087
},
9188
{
@@ -100,7 +97,7 @@
10097
" import cirq\n",
10198
"except ImportError:\n",
10299
" print(\"installing cirq...\")\n",
103-
" !pip install --quiet cirq~=1.0.dev\n",
100+
" !pip install --quiet cirq\n",
104101
" print(\"installed cirq.\")\n",
105102
" import cirq\n",
106103
"\n",

docs/transform/routing_transformer.ipynb

+2-3
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@
6969
"id": "RrRN9ilV0Ltg"
7070
},
7171
"source": [
72-
"## Setup\n",
73-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
72+
"## Setup\n"
7473
]
7574
},
7675
{
@@ -85,7 +84,7 @@
8584
" import cirq\n",
8685
"except ImportError:\n",
8786
" print(\"installing cirq...\")\n",
88-
" !pip install --quiet cirq~=1.0.dev\n",
87+
" !pip install --quiet cirq\n",
8988
" import cirq\n",
9089
"\n",
9190
" print(\"installed cirq.\")"

docs/tutorials/google/colab.ipynb

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
"id": "fe7e28f44667"
6969
},
7070
"source": [
71-
"## Setup\n",
72-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
71+
"## Setup\n"
7372
]
7473
},
7574
{

docs/tutorials/google/echoes.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@
9999
"id": "bpBUR4JblClA"
100100
},
101101
"source": [
102-
"We first install Cirq then import packages we will use.\n",
103-
"\n",
104-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
102+
"We first install Cirq then import packages we will use.\n"
105103
]
106104
},
107105
{
@@ -115,7 +113,7 @@
115113
"try:\n",
116114
" import cirq\n",
117115
"except ImportError:\n",
118-
" !pip install --quiet cirq~=1.0.dev"
116+
" !pip install --quiet cirq"
119117
]
120118
},
121119
{

docs/tutorials/google/identifying_hardware_changes.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,7 @@
137137
"source": [
138138
"### Setup\n",
139139
"\n",
140-
"First, install Cirq and import the necessary packages.\n",
141-
"\n",
142-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
140+
"First, install Cirq and import the necessary packages.\n"
143141
]
144142
},
145143
{
@@ -188,7 +186,7 @@
188186
"try:\n",
189187
" import cirq\n",
190188
"except ImportError:\n",
191-
" !pip install --quiet cirq~=1.0.dev"
189+
" !pip install --quiet cirq"
192190
]
193191
},
194192
{

docs/tutorials/google/spin_echoes.ipynb

+2-3
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@
9393
"id": "BRfLi9YSMg4v"
9494
},
9595
"source": [
96-
"## Setup\n",
97-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
96+
"## Setup\n"
9897
]
9998
},
10099
{
@@ -109,7 +108,7 @@
109108
" import cirq\n",
110109
"except ImportError:\n",
111110
" print(\"installing cirq...\")\n",
112-
" !pip install --quiet cirq~=1.0.dev\n",
111+
" !pip install --quiet cirq\n",
113112
" print(\"installed cirq.\")"
114113
]
115114
},

docs/tutorials/google/visualizing_calibration_metrics.ipynb

+2-3
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@
7070
"id": "fe7e28f44667"
7171
},
7272
"source": [
73-
"## Setup\n",
74-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq~=1.0.dev`."
73+
"## Setup\n"
7574
]
7675
},
7776
{
@@ -88,7 +87,7 @@
8887
" import cirq\n",
8988
"except ImportError:\n",
9089
" print(\"installing cirq...\")\n",
91-
" !pip install --quiet cirq~=1.0.dev\n",
90+
" !pip install --quiet cirq\n",
9291
" print(\"installed cirq.\")\n",
9392
"import cirq\n",
9493
"import cirq_google\n",

examples/stabilizer_code.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
" print(\"installing cirq...\")\n",
2626
" !pip install --quiet cirq\n",
2727
" print(\"installed cirq.\")\n",
28+
" import cirq\n",
2829
" \n",
2930
"from cirq.contrib.svg import SVGCircuit\n",
3031
"import examples.stabilizer_code as sc"

0 commit comments

Comments
 (0)