Skip to content

Commit 6a40da5

Browse files
authoredFeb 14, 2024
Enable testing of quimb-dependent notebook (#6461)
* Enable Contract-a-Grid-Circuit.ipynb in notebook tests, but test it only with the pre-release Cirq. The notebook requires a pinned version of quimb from #6438 otherwise the tensor_expectation_value() call in the last-cell causes out-of-memory error. Fixes #6088
1 parent c2e37df commit 6a40da5

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed
 

‎cirq-core/cirq/contrib/quimb/Contract-a-Grid-Circuit.ipynb

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"## Setup\n",
8+
"Note: this notebook relies on unreleased Cirq features. If you want to try these features, make sure you install cirq via `pip install cirq --pre`."
9+
]
10+
},
311
{
412
"cell_type": "code",
513
"execution_count": null,
@@ -12,14 +20,14 @@
1220
" import cirq\n",
1321
"except ImportError:\n",
1422
" print(\"installing cirq...\")\n",
15-
" !pip install --quiet cirq\n",
23+
" !pip install --quiet cirq --pre\n",
1624
" print(\"installed cirq.\")\n",
1725
"\n",
1826
"try:\n",
1927
" import quimb\n",
2028
"except ImportError:\n",
2129
" print(\"installing cirq-core[contrib]...\")\n",
22-
" !pip install --quiet 'cirq-core[contrib]'\n",
30+
" !pip install --quiet 'cirq-core[contrib]' --pre\n",
2331
" print(\"installed cirq-core[contrib].\")"
2432
]
2533
},

‎dev_tools/notebooks/isolated_notebook_test.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
# Please, always indicate in comments the feature used for easier bookkeeping.
4343

4444
NOTEBOOKS_DEPENDING_ON_UNRELEASED_FEATURES: List[str] = [
45+
# Requires pinned quimb from #6438
46+
'cirq-core/cirq/contrib/quimb/Contract-a-Grid-Circuit.ipynb',
4547
# Hardcoded qubit placement
4648
'docs/google/qubit-placement.ipynb',
4749
# get_qcs_objects_for_notebook
@@ -63,9 +65,6 @@
6365
# By default all notebooks should be tested, however, this list contains exceptions to the rule
6466
# please always add a reason for skipping.
6567
SKIP_NOTEBOOKS = [
66-
# TODO(#6088) - enable notebooks below
67-
'cirq-core/cirq/contrib/quimb/Contract-a-Grid-Circuit.ipynb',
68-
# End of TODO(#6088)
6968
# skipping vendor notebooks as we don't have auth sorted out
7069
"**/aqt/*.ipynb",
7170
"**/azure-quantum/*.ipynb",

0 commit comments

Comments
 (0)
Please sign in to comment.