Skip to content

Commit 92f71b6

Browse files
authored
Test all notebooks vs stable cirq after the release (#7255)
* Use stable cirq in interop.ipynb * Use stable cirq in classical_control.ipynb * Use stable cirq in notebooks that pass for repo head * Sync SKIP_NOTEBOOKS list in notebook_test and isolated_notebook_test Test all notebooks that pass with cirq head also in isolation with stable cirq. * Skip notebooks that import examples from testing with stable cirq
1 parent 10eb800 commit 92f71b6

File tree

8 files changed

+27
-37
lines changed

8 files changed

+27
-37
lines changed

dev_tools/notebooks/isolated_notebook_test.py

+18-24
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,33 @@
4141
# note that these notebooks are still tested in dev_tools/notebook_test.py
4242
# Please, always indicate in comments the feature used for easier bookkeeping.
4343

44-
NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES: List[str] = [
45-
# Requires OpenQASM 3.0 support from cirq 1.5
46-
'docs/build/interop.ipynb',
47-
# Requires features in cirq 1.5.
48-
'docs/build/classical_control.ipynb',
49-
]
44+
NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES: List[str] = []
5045

5146
# By default all notebooks should be tested, however, this list contains exceptions to the rule
5247
# please always add a reason for skipping.
5348
SKIP_NOTEBOOKS = [
5449
# skipping vendor notebooks as we don't have auth sorted out
55-
"**/aqt/*.ipynb",
56-
"**/azure-quantum/*.ipynb",
57-
"**/google/*.ipynb",
58-
"**/ionq/*.ipynb",
59-
"**/pasqal/*.ipynb",
60-
# Rigetti uses local simulation with docker, so should work
61-
# if you run into issues locally, run
62-
# `docker compose -f cirq-rigetti/docker-compose.test.yaml up`
63-
"**/rigetti/*.ipynb",
64-
# skipping fidelity estimation due to
65-
# https://github.com/quantumlib/Cirq/issues/3502
66-
"examples/*fidelity*",
50+
'**/aqt/*.ipynb',
51+
'**/azure-quantum/*.ipynb',
52+
'**/ionq/*.ipynb',
53+
'**/pasqal/*.ipynb',
54+
'**/rigetti/*.ipynb',
6755
# skipping quantum utility simulation (too large)
6856
'examples/advanced/*quantum_utility*',
69-
# Also skipping stabilizer code testing.
70-
"examples/*stabilizer_code*",
71-
# get_qcs_objects_for_notebook
57+
# tutorials that use QCS and arent skipped due to one or more cleared output cells
58+
'docs/tutorials/google/identifying_hardware_changes.ipynb',
59+
'docs/tutorials/google/echoes.ipynb',
7260
'docs/noise/qcvv/xeb_calibration_example.ipynb',
73-
# An intentionally empty/template code notebook.
74-
"docs/simulate/qvm_builder_code.ipynb",
75-
*NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES,
61+
# temporary: need to fix QVM metrics and device spec
62+
'docs/tutorials/google/spin_echoes.ipynb',
63+
'docs/tutorials/google/visualizing_calibration_metrics.ipynb',
64+
]
65+
SKIP_NOTEBOOKS += [
66+
# notebooks that import the examples module which is not installed with cirq
67+
'examples/direct_fidelity_estimation.ipynb',
68+
'examples/stabilizer_code.ipynb',
7669
]
70+
SKIP_NOTEBOOKS += NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES
7771

7872
# As these notebooks run in an isolated env, we want to minimize dependencies that are
7973
# installed. We assume colab packages (feel free to add dependencies here that appear in colab, as

dev_tools/notebooks/notebook_test.py

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
'**/ionq/*.ipynb',
3838
'**/pasqal/*.ipynb',
3939
'**/rigetti/*.ipynb',
40-
# skipping fidelity estimation due to
4140
# skipping quantum utility simulation (too large)
4241
'examples/advanced/*quantum_utility*',
4342
# tutorials that use QCS and arent skipped due to one or more cleared output cells

docs/build/classical_control.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"id": "bb398b9478d3"
6060
},
6161
"source": [
62-
"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`."
62+
"## Setup"
6363
]
6464
},
6565
{
@@ -74,7 +74,7 @@
7474
" import cirq\n",
7575
"except ImportError:\n",
7676
" print(\"installing cirq...\")\n",
77-
" !pip install --upgrade --quiet cirq~=1.0.dev\n",
77+
" !pip install --quiet cirq\n",
7878
" import cirq\n",
7979
"\n",
8080
" print(\"installed cirq.\")"

docs/build/interop.ipynb

+2-4
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,7 @@
7474
" import cirq\n",
7575
"except ImportError:\n",
7676
" print(\"installing cirq...\")\n",
77-
" # Cirq 1.5 needed for OpenQASM 3.0 support",
78-
" !pip install --upgrade --quiet cirq~=1.0.dev\n",
77+
" !pip install --quiet cirq\n",
7978
" print(\"installed cirq.\")"
8079
]
8180
},
@@ -85,8 +84,7 @@
8584
"id": "S541ev7MvVe4"
8685
},
8786
"source": [
88-
"Cirq has several features that allow the user to import/export from other quantum languages.",
89-
"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`."
87+
"Cirq has several features that allow the user to import/export from other quantum languages."
9088
]
9189
},
9290
{

docs/noise/qcvv/parallel_xeb.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
" import cirq\n",
6666
"except ImportError:\n",
6767
" print(\"installing cirq...\")\n",
68-
" !pip install --upgrade --quiet cirq~=1.0.dev\n",
68+
" !pip install --quiet cirq\n",
6969
" print(\"installed cirq.\")"
7070
]
7171
},

docs/simulate/qvm_stabilizer_example.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@
504504
},
505505
"outputs": [],
506506
"source": [
507-
"!pip install --upgrade --quiet cirq-web~=1.0.dev\n",
507+
"!pip install --quiet cirq-web\n",
508508
"import cirq_web\n",
509509
"\n",
510510
"circuit_vis = cirq_web.Circuit3D(stabilizer_grid_circuit)\n",

docs/tutorials/google/colab.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
" import cirq_google\n",
8585
"except ImportError:\n",
8686
" print(\"installing cirq...\")\n",
87-
" !pip install --upgrade --quiet cirq-google~=1.0.dev\n",
87+
" !pip install --quiet cirq-google\n",
8888
" print(\"installed cirq.\")\n",
8989
" import cirq\n",
9090
" import cirq_google"

docs/tutorials/google/start.ipynb

+2-3
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 --upgrade cirq-google~=1.0.dev`."
71+
"## Setup"
7372
]
7473
},
7574
{
@@ -85,7 +84,7 @@
8584
" import cirq_google as cg\n",
8685
"except ImportError:\n",
8786
" print(\"installing cirq-google and cirq...\")\n",
88-
" !pip install --upgrade --quiet cirq-google~=1.0.dev cirq~=1.0.dev\n",
87+
" !pip install --quiet cirq-google cirq\n",
8988
" print(\"installed cirq-google and cirq.\")\n",
9089
" import cirq\n",
9190
" import cirq_google as cg"

0 commit comments

Comments
 (0)