Skip to content

Commit b5ca970

Browse files
mhuckapavoljuhas
andauthored
Test all notebooks vs stable Cirq after the release (#7561)
Make all notebook tests use stable cirq after the 1.6.0 release. Ref: https://github.com/quantumlib/Cirq/blob/main/docs/dev/notebooks.md#lifecycle Fixes #7556 --------- Co-authored-by: Pavol Juhas <[email protected]>
1 parent 1be4d9a commit b5ca970

8 files changed

+9
-102
lines changed

dev_tools/notebooks/isolated_notebook_test.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,7 @@
4242
# note that these notebooks are still tested in dev_tools/notebook_test.py
4343
# Please, always indicate in comments the feature used for easier bookkeeping.
4444

45-
NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES: list[str] = [
46-
# Requires `load_device_noise_properties` from #7369
47-
'docs/hardware/qubit_picking.ipynb',
48-
'docs/simulate/noisy_simulation.ipynb',
49-
'docs/simulate/quantum_virtual_machine.ipynb',
50-
'docs/simulate/qvm_basic_example.ipynb',
51-
# Remove once the renaming of `whitelisted_users` -> `allowlisted_users`
52-
# throughout cirq_google is released.
53-
'docs/simulate/virtual_engine_interface.ipynb',
54-
]
45+
NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES: list[str] = []
5546

5647
# By default all notebooks should be tested, however, this list contains exceptions to the rule
5748
# please always add a reason for skipping.

docs/hardware/qubit_picking.ipynb

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,6 @@
7171
"When running a circuit on a noisy quantum hardware device, the choice and even ordering of hardware qubits used directly affects how reliably the device measures a correct result. This notebook covers some of the available qubit error information that can be useful for picking good hardware qubits to run your circuit on."
7272
]
7373
},
74-
{
75-
"cell_type": "markdown",
76-
"metadata": {
77-
"id": "cb67ae611d34"
78-
},
79-
"source": [
80-
"## Setup\n",
81-
"\n",
82-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install --upgrade cirq~=1.0.dev`."
83-
]
84-
},
8574
{
8675
"cell_type": "code",
8776
"execution_count": null,
@@ -94,13 +83,9 @@
9483
"# @title Setup\n",
9584
"try:\n",
9685
" import cirq\n",
97-
"\n",
98-
" # raise ImportError when cirq is not new enough\n",
99-
" if cirq.__version__ == \"1.5.0\":\n",
100-
" raise ImportError(\"This notebook requires the development version of Cirq\")\n",
10186
"except ImportError:\n",
10287
" print(\"installing cirq...\")\n",
103-
" !pip install --upgrade --quiet cirq~=1.0.dev\n",
88+
" !pip install --quiet cirq\n",
10489
" print(\"installed cirq.\")\n",
10590
" import cirq\n",
10691
"\n",

docs/simulate/noisy_simulation.ipynb

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,6 @@
6262
"</table>"
6363
]
6464
},
65-
{
66-
"cell_type": "markdown",
67-
"metadata": {
68-
"id": "f9c6fb06ebbf"
69-
},
70-
"source": [
71-
"## Setup\n",
72-
"\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 --upgrade cirq~=1.0.dev`."
74-
]
75-
},
7665
{
7766
"cell_type": "code",
7867
"execution_count": null,
@@ -83,13 +72,9 @@
8372
"source": [
8473
"try:\n",
8574
" import cirq\n",
86-
"\n",
87-
" # raise ImportError when cirq is not new enough\n",
88-
" if cirq.__version__ == \"1.5.0\":\n",
89-
" raise ImportError(\"This notebook requires the development version of Cirq\")\n",
9075
"except ImportError:\n",
9176
" print(\"installing cirq...\")\n",
92-
" !pip install --upgrade --quiet cirq~=1.0.dev\n",
77+
" !pip install --quiet cirq\n",
9378
" print(\"installed cirq.\")"
9479
]
9580
},

docs/simulate/quantum_virtual_machine.ipynb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@
7979
"id": "p31cCK_T1ylm"
8080
},
8181
"source": [
82-
"## Setup\n",
83-
"\n",
84-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install --upgrade cirq~=1.0.dev`."
82+
"## Setup"
8583
]
8684
},
8785
{
@@ -97,15 +95,10 @@
9795
"\n",
9896
"try:\n",
9997
" import cirq\n",
100-
"\n",
101-
" # raise ImportError when cirq is not new enough\n",
102-
" if cirq.__version__ == \"1.5.0\":\n",
103-
" raise ImportError(\"This notebook requires the development version of Cirq\")\n",
104-
"\n",
10598
" import cirq_google\n",
10699
"except ImportError:\n",
107100
" print(\"installing cirq...\")\n",
108-
" !pip install --upgrade --quiet cirq-google~=1.0.dev\n",
101+
" !pip install --quiet cirq-google\n",
109102
" print(\"installed cirq.\")\n",
110103
" import cirq\n",
111104
" import cirq_google\n",

docs/simulate/qvm_basic_example.ipynb

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@
8080
"## **Install** Cirq and qsim"
8181
]
8282
},
83-
{
84-
"cell_type": "markdown",
85-
"metadata": {
86-
"id": "8e3ded3ff3d1"
87-
},
88-
"source": [
89-
"## Setup\n",
90-
"\n",
91-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install --upgrade cirq~=1.0.dev`."
92-
]
93-
},
9483
{
9584
"cell_type": "code",
9685
"execution_count": null,
@@ -104,15 +93,10 @@
10493
"\n",
10594
"try:\n",
10695
" import cirq\n",
107-
"\n",
108-
" # raise ImportError when cirq is not new enough\n",
109-
" if cirq.__version__ == \"1.5.0\":\n",
110-
" raise ImportError(\"This notebook requires the development version of Cirq\")\n",
111-
"\n",
11296
" import cirq_google\n",
11397
"except ImportError:\n",
11498
" print(\"installing cirq...\")\n",
115-
" !pip install --upgrade --quiet cirq-google~=1.0.dev\n",
99+
" !pip install --quiet cirq-google\n",
116100
" print(\"installed cirq.\")\n",
117101
" import cirq\n",
118102
" import cirq_google\n",

docs/simulate/qvm_builder_code.ipynb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@
8080
"## **Install** Cirq and qsim"
8181
]
8282
},
83-
{
84-
"cell_type": "markdown",
85-
"metadata": {
86-
"id": "3f2687e48726"
87-
},
88-
"source": [
89-
"## Setup\n",
90-
"\n",
91-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install --upgrade cirq~=1.0.dev`."
92-
]
93-
},
9483
{
9584
"cell_type": "code",
9685
"execution_count": null,
@@ -107,7 +96,7 @@
10796
" import cirq_google\n",
10897
"except ImportError:\n",
10998
" print(\"installing cirq...\")\n",
110-
" !pip install --upgrade --quiet cirq-google~=1.0.dev\n",
99+
" !pip install --quiet cirq-google\n",
111100
" print(\"installed cirq.\")\n",
112101
" import cirq\n",
113102
" import cirq_google\n",

docs/simulate/qvm_stabilizer_example.ipynb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@
8080
"## **Install** Cirq and qsim, Create **Quantum Virtual Machine**"
8181
]
8282
},
83-
{
84-
"cell_type": "markdown",
85-
"metadata": {
86-
"id": "3f2687e48726"
87-
},
88-
"source": [
89-
"## Setup\n",
90-
"\n",
91-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install --upgrade cirq~=1.0.dev`."
92-
]
93-
},
9483
{
9584
"cell_type": "code",
9685
"execution_count": null,
@@ -107,7 +96,7 @@
10796
" import cirq_google\n",
10897
"except ImportError:\n",
10998
" print(\"installing cirq...\")\n",
110-
" !pip install --upgrade --quiet cirq-google~=1.0.dev\n",
99+
" !pip install --quiet cirq-google\n",
111100
" print(\"installed cirq.\")\n",
112101
" import cirq\n",
113102
" import cirq_google\n",

docs/simulate/virtual_engine_interface.ipynb

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@
3131
"# limitations under the License."
3232
]
3333
},
34-
{
35-
"cell_type": "markdown",
36-
"metadata": {
37-
"id": "ff0101ac0724"
38-
},
39-
"source": [
40-
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq-google via `pip install --upgrade cirq-google~=1.0.dev`."
41-
]
42-
},
4334
{
4435
"cell_type": "markdown",
4536
"metadata": {
@@ -106,7 +97,7 @@
10697
" import cirq_google\n",
10798
"except ImportError:\n",
10899
" print(\"installing cirq...\")\n",
109-
" !pip install --upgrade --quiet cirq~=1.0.dev cirq-google~=1.0.dev\n",
100+
" !pip install --quiet cirq\n",
110101
" print(\"installed cirq.\")\n",
111102
" import cirq\n",
112103
" import cirq_google\n",

0 commit comments

Comments
 (0)