CK repository for Rigetti Computing workflows
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


compatibility License Travis Build Status

Obtaining your Forest API key and user_id

Visit Rigetti Forest sign-up page and follow their instructions to obtain two strings: api_key and user_id . Make a note of them, they will be needed at a later step.

Installation (on Ubuntu)

Install global prerequisites, Python and its pip (Python2 is also supported)

$ sudo apt-get install python3 python3-pip

Install Collective Knowledge

$ sudo pip3 install ck

Installation (on MacOSX)

Install Python3 and its Pip3 (Python2 is also supported)

$ brew update
$ brew reinstall python

Minimal CK installation

The minimal installation requires:

  • Python 2.7 or 3.3+ (limitation is mainly due to unitests)
  • Git command line client.

You can install CK in your local user space as follows:

$ git clone
$ export PATH=$PWD/ck/bin:$PATH

You can also install CK via PIP with sudo to avoid setting up environment variables yourself:

$ sudo pip install ck

Common part of the installation

Detect a Python interpreter (interactively choose one if there are several options)

$ ck detect soft:compiler.python

Install this CK repository with all its dependencies (other CK repos to reuse artifacts)

$ ck pull repo:ck-rigetti

List all the packages available

$ ck list ck-rigetti:package:*

Install CK package for pyQuil (insert your api_key and user_id that you obtained by registering - see above)

$ env PYQUIL_FOREST_API_KEY=xnmRPAVunQl19TtQz9eMd11iiIsArtUDTaEnsSV6ux \
      PYQUIL_USER_ID=015a1263b-d7f2-426d-b2f5-2fe2e9727d1d0 \
      ck install package:lib-pyquil

Run some simple tests

Run a demo program (select interactively from a menu)

$ ck run program:pyquil-demo

Run the hello-world demo (a Python runner + default hello_world.quil file)

$ ck run program:pyquil-demo --cmd_key=from-quil-file

Run a given .quil file (path relative to tmp directory or absolute)

$ ck run program:pyquil-demo --cmd_key=from-quil-file --env.QUIL_FILE=../teleport.quil

Run the dedicated teleportation demo in Python

$ ck run program:pyquil-demo --cmd_key=teleportation

Run a given pyQuil example (path relative to pyQuil example directory in CK-TOOLS)

$ ck run program:pyquil-demo --cmd_key=from-pyquil-examples

Run an interactive python session with access to CK-installed pyQuil

shell-bound IPython session:

$ ck virtual env --tags=pyquil --shell_cmd=ipython

In [1]: import pyquil

In [2]: ...

Jupyter Notebook session in your browser:

$ ck virtual env --tags=pyquil --shell_cmd='jupyter notebook'

In [1]: import pyquil

In [2]: ...