Skip to content

Commit cac6aad

Browse files
authored
Ensure QVM notebooks use development version of cirq (#7436)
Problem: QVM notebooks use function that is not in stable cirq. This causes failures in nightly builds of cirq docs. Solution: Force cirq upgrade if running with stable cirq. Fixes b/425769714
1 parent 9a58a8b commit cac6aad

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

docs/hardware/qubit_picking.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
"# @title Setup\n",
9595
"try:\n",
9696
" import cirq\n",
97+
"\n",
98+
" # trigger ImportError when cirq is not cirq~=1.0.dev\n",
99+
" from cirq_google.engine import load_device_noise_properties as _\n",
97100
"except ImportError:\n",
98101
" print(\"installing cirq...\")\n",
99102
" !pip install --upgrade --quiet cirq~=1.0.dev\n",

docs/simulate/noisy_simulation.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@
8383
"source": [
8484
"try:\n",
8585
" import cirq\n",
86+
"\n",
87+
" # trigger ImportError when cirq is not cirq~=1.0.dev\n",
88+
" from cirq_google.engine import load_device_noise_properties as _\n",
8689
"except ImportError:\n",
8790
" print(\"installing cirq...\")\n",
8891
" !pip install --upgrade --quiet cirq~=1.0.dev\n",

docs/simulate/quantum_virtual_machine.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
"try:\n",
9999
" import cirq\n",
100100
" import cirq_google\n",
101+
"\n",
102+
" # trigger ImportError when cirq is not cirq~=1.0.dev\n",
103+
" from cirq_google.engine import load_device_noise_properties as _\n",
101104
"except ImportError:\n",
102105
" print(\"installing cirq...\")\n",
103106
" !pip install --upgrade --quiet cirq-google~=1.0.dev\n",

docs/simulate/qvm_basic_example.ipynb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@
105105
"try:\n",
106106
" import cirq\n",
107107
" import cirq_google\n",
108+
"\n",
109+
" # trigger ImportError when cirq is not cirq~=1.0.dev\n",
110+
" from cirq_google.engine import load_device_noise_properties as _\n",
108111
"except ImportError:\n",
109112
" print(\"installing cirq...\")\n",
110113
" !pip install --upgrade --quiet cirq-google~=1.0.dev\n",

0 commit comments

Comments
 (0)