Quil SDK Docker Image
We regularly publish Docker images that contain the Quil SDK pre-installed. They will also start up quilc and QVM servers upon container start.
Running the Image
To use the image, just run the following in a terminal:
You'll then be presented with an IPython prompt, where you can easily write and execute Quil programs.
Running Programs
Try running a simple Quil program against a QVM by pasting the following into the IPython prompt:
If all goes well, you'll see results similar to the following:
Programs on Your Host Computer
While typing programs into the IPython prompt can be instructive, it's often more useful to run programs that you're working on from your host computer.
For example, if you have a program located on your host computer at ~/pyquil/example.py
, you can run the program using the rigetti/forest
image with the following command:
Avoiding Container Restarts
If you don't want to have to restart the container each time you run a program, you can start the container into a terminal instead:
Then, each time you need to run a program, you can execute it with the python
command:
Using JupyterLab
If you prefer to work with programs as Jupyter notebooks located on your host computer, you can run the rigetti/forest
image with the following command (assuming notebooks are located in ~/pyquil
on your host computer):
You should see a JupyterLab server start up and print out a URL of the form:
You can then paste that URL into a browser on your host computer and start creating notebooks!
Notebooks saved to /root/pyquil
in JupyterLab will be stored in ~/pyquil
on your host computer.
If you'd like to use notebooks stored in a different location on your host computer, simply replace ~/pyquil
with a different path in the command above.
If you're not familiar with using JupyterLab, we recommend this handy guide.
Last updated