Skip to main content

A quantum circuit transformation and manipulation tool

Project description

Mini-compiler for Quantum Inspire's quantum chip(munk)s

 ,;;:;,
   ;;;;;
  ,:;;:;    ,'=.
  ;:;:;' .=" ,'_\
  ':;:;,/  ,__:=@
   ';;:;  =./)_
 jgs `"=\_  )_"`
          ``'"`

Installation

$ pip install opensquirrel

Editable installation

To perform an editable install, run the following command in the root directory of OpenSquirrel with the -e flag:

$ pip install -e .

To install the developer specific dependencies, run the command:

$ pip install -e '.[dev]'

Documentation

OpenSquirrel documentation is hosted through GitHub Pages here.

MkDocs

The documentation is generated using MkDocs. For full documentation visit mkdocs.org.

mkdocs.yml    # The configuration file.
docs/
    index.md  # The documentation homepage.
    ...       # Other markdown pages, images and other files.

In order to build OpenSquirrel documentation, run the following command in the root directory of OpenSquirrel:

mkdocs build

Style guide

We use the Google style guide for the docstring format.

Tools

Poetry

Project dependencies are specified in the pyproject.toml file in the root directory of the project.

Website: https://python-poetry.org/

Install dependencies:

$ poetry install

Start a Poetry shell:

$ poetry shell

Within the shell PyTest and MyPy can be run accordingly:

$ mypy -p opensquirrel
$ pytest

Dev Container

PyCharm

Open the Dev Container configuration file located at .devcontainer/devcontainer.json in the PyCharm editor.

On the left of the editor, in the gutter, you should see the Docker icon: or .

Upon clicking on the Docker icon, the following options appear (depending on the PyCharm version used):

  • Create Dev Container and Mount Sources..., and
  • Show Dev Containers.

If no Dev Containers have been created previously, select the former option and proceed to create a Dev Container, otherwise select the latter option to list the existing Dev Containers.

Create Dev Container and Mount Sources...

  1. If you select Create Dev Container and Mount Sources..., a separate window (Building Dev Container) will open and a Dev Container will be built according to the specification in the devcontainer/Dockerfile.
  2. The system dependencies are installed, a user account (i.e. pydev) is created, and additional Python packages and Poetry are installed.
  3. Upon completion the status messages should read something like: 'Dev Container' has been deployed successfully and Environment is successfully prepared…
  4. Proceed by choosing your PyCharm installation, from the dropdown menu that appears at the top, and click Continue.
  5. A connection is established with the remote host and a new PyCharm window is opened.
  6. Skip the following subsection and proceed below.

Show Dev Containers

  1. If you select Show Dev Containers, a separate window appears where the existing (previously created) Dev Containers are listed by their name and status (i.e. either running or idle). In general, all docker containers (including idle ones) can be listed using:

    docker ps -a
    
  2. If they are idle they can be started by clicking on their name or on the play button. An idle (Dev) Container can also be started from the terminal:

    docker container start <container-name>
    

A running Dev Container can be accessed from the terminal, accordingly:

docker exec -it <container-name> bash

The -i flag stands for interactive session and the -t stands for running it in the terminal.

Once you have accessed the Dev Container, change to the user pydev:

sudo -u pydev -i

And make sure to navigate to the project root folder:

cd /IdeaProjects/OpenSquirrel/

Continue to install the dependencies (if not done already in this container; otherwise you may skip this step):

poetry install

and initiating the Poetry shell environment:

poetry shell

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

opensquirrel-0.0.8.tar.gz (36.3 kB view hashes)

Uploaded Source

Built Distribution

opensquirrel-0.0.8-py3-none-any.whl (48.8 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