Skip to main content

National Quantum Initiative Co-design Center for Quantum Advantage bosonic Qiskit simulator

Reason this release was yanked:

Issues with github actions

Project description

PACKAGE DEPRECIATION WARNING

The way to import bosonic-qiskit will be changing from import c2qa to import bosonic_qiskit. This change will occur on release of version 15.0 on November 16, 2025.

Please update any use of c2qa in your code accordingly

Bosonic Qiskit

NQI C2QA project to simulate hybrid boson-qubit systems within QisKit.

Installation

Virtual Environment

It is recommended to install bosonic-qiskit in a virtual environment:

python3 -m venv venv
source venv/bin/activate

PyPi Installation

The easiest way to install bosonic-qiskit is through PyPi:

pip install bosonic-qiskit

Development

Source code installation of bosonic-qiskit for development is possible with the install-dependencies.sh convenience script:

git clone https://github.com/C2QA/bosonic-qiskit.git
cd bosonic-qiskit
./install-dependencies.sh

The above script does the following:

  1. Creates a virtual environment with the name venv and activates it.
  2. The bosonic-qiskit library is installed in editable mode with developer requirements from requirements_dev.txt which include tools such as flake8, black, and pre-commit to aid in satisfying code style and format requirements.
  3. The tool pre-commit is installed which automatically runs flake8 and black upon the git commit command.

Code Style Requirements

Any changes or additions to bosonic-qiskit must be black and flake8 compliant. These tools can be run manually, however with pre-commit these tools automatically check for code style compliance when commiting code. If black shows non-compliant code formatting, changes must be be manually made and altered files must be recommitted.

Dependency Version Compatibility

The Bosonic Qiskit software has not been extensively tested with different versions of its dependencies; however, some success has been achieved with both newer and older versions of Qiskit. Do note that some features require newer versions. For example, the noise modelling requires Qiskit v0.34.2+. Using older versions will cause ModuleNotFoundError at runtime.

Tutorials

Jupyter Notebook tutorials can be found in the tutorials folder. JupyterLab is a dependency found in requirements.txt, so after installing and activating the virtual environment, to run the tutorials simply start Jupyter with jupyter lab and then navigate to the desired tutorial.

See our paper presented at IEEE HPEC 2022 on arXiv for more information on using bosonic-qiskit.

How to add gates

The code is structured to separate generation of the operator matrices from creating instances of QisKit Gate.

The first step in adding a new gate is to develop software to build a unitary operator matrix. These matrices must be unitary in order for QisKit to simulate them. Non unitary matrices will fail during simulation. Existing operator matrices are built in the CVOperators class found in operators.py. Included in CVOperators are functions to build the bosonic creation and annihilation operators based on a provided cutoff. The order of the data in your operators must match the order of the qumodes (QisKit qubits) sent in as QisKit gate parameters found in circuit.py, as described next.

Once you've written software to build the operator matrix, a new function is added to the CVCircuit class found in circuit.py. This class extends the QisKit QuantumCircuit class to add the bosonic gates available in this library. The previusly defined operators are parameterized by user input, as needed, and appended to the QuantumCircuit as unitary gates. The CVCircuit class includes functions to easily make your new gates conditional based on a control qubit.

See examples of software building new gates in the previously mentioned operators.py and circuit.py. Examples using the library's gates can be found in both the PyTest test cases and Jupyter Notebook tutorials folders

Available Gates

Current gates available for simulation are documented at https://c2qa.github.io/bosonic-qiskit/c2qa.circuit.CVCircuit.html

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

bosonic_qiskit-14.1.tar.gz (51.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bosonic_qiskit-14.1-py3-none-any.whl (40.7 kB view details)

Uploaded Python 3

File details

Details for the file bosonic_qiskit-14.1.tar.gz.

File metadata

  • Download URL: bosonic_qiskit-14.1.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bosonic_qiskit-14.1.tar.gz
Algorithm Hash digest
SHA256 84fa24d9920117b4737a726900a6b4d96dc4f0cd16c415a295be504c0e8f2f61
MD5 cea64f25f63a3671578dee445dfa07c2
BLAKE2b-256 1c82ec934f6df73bd7da54c8a72275db39b2ec0dd9656c3dd2ee2edd449c560e

See more details on using hashes here.

Provenance

The following attestation bundles were made for bosonic_qiskit-14.1.tar.gz:

Publisher: python-publish.yml on C2QA/bosonic-qiskit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bosonic_qiskit-14.1-py3-none-any.whl.

File metadata

  • Download URL: bosonic_qiskit-14.1-py3-none-any.whl
  • Upload date:
  • Size: 40.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for bosonic_qiskit-14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 125cc4f28d2592286892c896a68a366c946ebcf84342ccef178e1ed7bc7ca9f1
MD5 55b6c43cc581592563ac9b834cf66944
BLAKE2b-256 b2f4713c3a7133a33ad2315b4465ee08fb8cb32a7da59fa08a523448cf1eb864

See more details on using hashes here.

Provenance

The following attestation bundles were made for bosonic_qiskit-14.1-py3-none-any.whl:

Publisher: python-publish.yml on C2QA/bosonic-qiskit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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