Skip to content

Commit 5ee7b6c

Browse files
erichulburddstrain115
authored andcommitted
install pyquil qvm and compiler (quantumlib#4435)
* install pyquil qvm and compiler * do not run rigetti notebook tests Co-authored-by: Doug Strain <[email protected]>
1 parent 42f0f23 commit 5ee7b6c

File tree

3 files changed

+62
-8
lines changed

3 files changed

+62
-8
lines changed

.github/workflows/ci.yml

-4
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,8 @@ jobs:
286286
architecture: 'x64'
287287
- name: Install requirements
288288
run: pip install -r dev_tools/requirements/notebooks.env.txt
289-
- name: Run Quil dependencies
290-
run: docker-compose -f cirq-rigetti/docker-compose.test.yaml up -d
291289
- name: Notebook tests
292290
run: check/pytest -n auto -m slow dev_tools/notebooks/notebook_test.py
293-
- name: Stop Quil dependencies
294-
run: docker-compose -f cirq-rigetti/docker-compose.test.yaml down
295291
- uses: actions/upload-artifact@v2
296292
if: failure()
297293
with:

dev_tools/notebooks/notebook_test.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@
3232
"**/ionq/*.ipynb",
3333
"**/google/*.ipynb",
3434
"**/pasqal/*.ipynb",
35-
# Rigetti uses local simulation with docker, so should work
36-
# if you run into issues locally, run
37-
# `docker compose -f cirq-rigetti/docker-compose.test.yaml up`
38-
# "**/rigetti/*.ipynb",
35+
"**/rigetti/*.ipynb",
3936
# skipping fidelity estimation due to
4037
# https://github.com/quantumlib/Cirq/issues/3502
4138
"examples/*fidelity*",

docs/tutorials/rigetti/getting_started.ipynb

+61
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,67 @@
9999
"print(cirq.__version__)"
100100
]
101101
},
102+
{
103+
"cell_type": "markdown",
104+
"metadata": {
105+
"id": "jApPwKwJZ76B"
106+
},
107+
"source": [
108+
"Running this notebook requires the pyQuil QVM and Compiler. If you are running on Google Colab or a Linux Debian machine, you can run the below cell to install them if necessary. If you are on a non-Linux Debian machine, see [these instructions](https://pyquil-docs.rigetti.com/en/stable/start.html#downloading-the-qvm-and-compiler) for installation."
109+
]
110+
},
111+
{
112+
"cell_type": "code",
113+
"execution_count": 3,
114+
"metadata": {
115+
"id": "8Jr6CdheZ76C"
116+
},
117+
"outputs": [],
118+
"source": [
119+
"! [ -z \"$(which qvm)\" ] &&\\\n",
120+
" apt update &&\\\n",
121+
" apt install jq &&\\\n",
122+
" export LATEST_FOREST_SDK_VERSION=$(curl -s https://downloads.rigetti.com/qcs-sdk/versions | jq -r '.versions[0].sdk') &&\\\n",
123+
" curl -f https://downloads.rigetti.com/qcs-sdk/forest-sdk-$LATEST_FOREST_SDK_VERSION-linux-deb.tar.bz2 -o $PWD/forest-sdk-$LATEST_FOREST_SDK_VERSION-linux-deb.tar.bz2 &&\\\n",
124+
" tar -xf forest-sdk-$LATEST_FOREST_SDK_VERSION-linux-deb.tar.bz2 &&\\\n",
125+
" ./forest-sdk-$LATEST_FOREST_SDK_VERSION-linux-deb/forest-sdk-$LATEST_FOREST_SDK_VERSION-linux-deb.run &&\\\n",
126+
" quilc --version &&\\\n",
127+
" qvm --version"
128+
]
129+
},
130+
{
131+
"cell_type": "markdown",
132+
"metadata": {
133+
"id": "nXKo2957aEEx"
134+
},
135+
"source": [
136+
"Next, run the pyQuil QVM and Compiler if they are not already running on their default ports."
137+
]
138+
},
139+
{
140+
"cell_type": "code",
141+
"execution_count": 4,
142+
"metadata": {
143+
"id": "h2KPdYw1Z76D"
144+
},
145+
"outputs": [
146+
{
147+
"data": {
148+
"text/plain": [
149+
"<subprocess.Popen at 0x7f40fcff4310>"
150+
]
151+
},
152+
"execution_count": 4,
153+
"output_type": "execute_result"
154+
}
155+
],
156+
"source": [
157+
"import subprocess\n",
158+
"\n",
159+
"subprocess.Popen([\"qvm\", \"--quiet\", \"-S\"])\n",
160+
"subprocess.Popen([\"quilc\", \"--quiet\", \"-R\"])"
161+
]
162+
},
102163
{
103164
"cell_type": "markdown",
104165
"metadata": {

0 commit comments

Comments
 (0)