Skip to main content

Google Cirq adapter for IQM's quantum architectures

Project description

CI badge

Cirq on IQM

Google Cirq adapter for IQM’s quantum architectures.

What is it good for?

Currently Cirq on IQM can

  • take an arbitrary quantum circuit created in Cirq or load from an OpenQASM 2.0 file

  • map the circuit into an equivalent one compatible with the chosen IQM quantum architecture

  • optimize the circuit by commuting and merging gates

  • simulate the circuit using one of Cirq’s simulators

  • run the circuit on an IQM quantum computer

See the Jupyter Notebook with examples: examples/usage.ipynb.

How to use

The recommended way is to install the distribution package cirq-iqm directly from the Python Package Index (PyPI). You can either add cirq-iqm as a dependency to your project using setup.cfg, or install it manually:

$ pip install cirq-iqm

Alternatively, you can clone the repository, and build and install the distribution package yourself. Note the trailing slash to install from the local directory.

$ git clone git@github.com:iqm-finland/cirq-on-iqm.git
$ pip install cirq-on-iqm/

Import the module in your Python code:

import cirq_iqm

Run the demo:

$ python cirq-on-iqm/examples/demo_adonis.py

Run code on a real quantum computer:

$ export IQM_SERVER_URL="https://example.com"
$ export IQM_SETTINGS_PATH="/path/to/settings.json"
$ python cirq-on-iqm/examples/demo_iqm_execution.py

How to develop

Clone the repository and install it in editable mode with all the extras:

$ git clone git@github.com:iqm-finland/cirq-on-iqm.git
$ cd cirq-on-iqm
$ pip install -e ".[dev,docs,testing]"

Build and view the docs:

$ tox -e docs
$ firefox build/sphinx/html/index.html

Run the tests:

$ tox

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cirq-iqm-0.7.tar.gz (35.9 kB view hashes)

Uploaded Source

Built Distribution

cirq_iqm-0.7-py3-none-any.whl (23.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page