Skip to main content

A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.

Project description

Qubitron logo

Python package for writing, manipulating, and running quantum circuits on quantum computers and simulators.

Licensed under the Apache 2.0 license Compatible with Python versions 3.11 and higher OpenSSF Best Practices Qubitron project on PyPI Archived in Zenodo

FeaturesInstallationQuick StartDocumentationIntegrationsCommunityCiting QubitronContact

Features

Qubitron provides useful abstractions for dealing with today’s noisy intermediate-scale quantum (NISQ) computers, where the details of quantum hardware are vital to achieving state-of-the-art results. Some of its features include:

  • Flexible gate definitions and custom gates
  • Parameterized circuits with symbolic variables
  • Circuit transformation, compilation and optimization
  • Hardware device modeling
  • Noise modeling
  • Multiple built-in quantum circuit simulators
  • Integration with qsim for high-performance simulation
  • Interoperability with NumPy and SciPy
  • Cross-platform compatibility

Installation

Qubitron supports Python version 3.11 and later, and can be used on Linux, MacOS, and Windows, as well as Google Colab. For complete installation instructions, please refer to the Install section of the online Qubitron documentation.

Quick Start – “Hello Qubit” Example

Here is a simple example to get you up and running with Qubitron after you have installed it. Start a Python interpreter, and then type the following:

import qubitron

# Pick a qubit.
qubit = qubitron.GridQubit(0, 0)

# Create a circuit.
circuit = qubitron.Circuit(
    qubitron.X(qubit)**0.5,  # Square root of NOT.
    qubitron.measure(qubit, key='m')  # Measurement.
)
print("Circuit:")
print(circuit)

# Simulate the circuit several times.
simulator = qubitron.Simulator()
result = simulator.run(circuit, repetitions=20)
print("Results:")
print(result)

Python should then print output similar to this:

Circuit:
(0, 0): ───X^0.5───M('m')───
Results:
m=11000111111011001000

Congratulations! You have run your first quantum simulation in Qubitron. You can continue to learn more by exploring the many Qubitron tutorials described below.

Qubitron Documentation

The primary documentation site for Qubitron is the Qubitron home page on the Quantum AI website. There and elsewhere, a variety of documentation for Qubitron is available.

Tutorials

  • Video tutorials on YouTube are an engaging way to learn Qubitron.
  • Jupyter notebook-based tutorials let you learn Qubitron from your browser – no installation needed.
  • Text-based tutorials on the Qubitron home page are great when combined with a local installation of Qubitron on your computer. After starting with the basics, you'll be ready to dive into tutorials on circuit building and circuit simulation under the Build and Simulate tabs, respectively. Check out the other tabs for more!

Reference Documentation

  • Docs for the current stable release correspond to what you get with pip install qubitron.
  • Docs for the pre-release correspond to what you get with pip install --upgrade qubitron~=1.0.dev.

Examples

  • The examples subdirectory of the Qubitron GitHub repo has many programs illustrating the application of Qubitron to everything from common textbook algorithms to more advanced methods.
  • The Experiments page on the Qubitron documentation site has yet more examples, from simple to advanced.

Change log

Integrations

Google Quantum AI has a suite of open-source software that lets you do more with Qubitron. From high-performance simulators, to novel tools for expressing and analyzing fault-tolerant quantum algorithms, our software stack lets you develop quantum programs for a variety of applications.

Your interests Software to explore
Quantum algorithms?
Fault-tolerant quantum computing (FTQC)?
Qualtran
Large circuits and/or a lot of simulations? qsim
Circuits with thousands of qubits and millions of Clifford operations? Stim
Quantum error correction (QEC)? Stim
Chemistry and/or material science? OpenFermion
OpenFermion-FQE
OpenFermion-PySCF
OpenFermion-Psi4
Quantum machine learning (QML)? TensorFlow Quantum
Real experiments using Qubitron? ReQubitron

Community

Total number of contributors to Qubitron

Qubitron has benefited from contributions by over 200 people and counting. We are dedicated to cultivating an open and inclusive community to build software for quantum computers, and have a community code of conduct.

Announcements

Stay on top of Qubitron developments using the approach that best suits your needs:

Qubitron releases take place approximately every quarter.

Questions and Discussions

  • Have questions about Qubitron? Post them to the Quantum Computing Stack Exchange and tag them with qubitron. You can also search past questions using that tag – it's a great way to learn!
  • Want meet other Qubitron developers and participate in discussions? Join Qubitron Cynq, our biweekly virtual meeting of contributors. Sign up to qubitron-dev to get an automatic meeting invitation!

Contributions

Citing Qubitron

When publishing articles or otherwise writing about Qubitron, please cite the Qubitron version you use – it will help others reproduce your results. We use Zenodo to preserve releases. The following links let you download the bibliographic record for the latest stable release of Qubitron in some popular formats:

Download BibTeX bibliography record for latest Qubitron release   Download CSL JSON bibliography record for latest Qubitron release

For formatted citations and records in other formats, as well as records for all releases of Qubitron past and present, please visit the Qubitron page on Zenodo.

Contact

For any questions or concerns not addressed here, please email quantum-oss-maintainers@google.com.

Disclaimer

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.

Copyright 2019 The Qubitron Developers.

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

qubitron-1.6.0.dev0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

qubitron-1.6.0.dev0-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file qubitron-1.6.0.dev0.tar.gz.

File metadata

  • Download URL: qubitron-1.6.0.dev0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for qubitron-1.6.0.dev0.tar.gz
Algorithm Hash digest
SHA256 6e731c6e762b0ea75552e2ffe9bf94ae2fec7c48a60f3c4ad4dea06c45ff95ec
MD5 16ced8b5f69978b02dafdcacd35f9374
BLAKE2b-256 9c72edde67fba1a90ec5f916115d329ee0024a6e3ada69516e635cfcb5f0fc4d

See more details on using hashes here.

File details

Details for the file qubitron-1.6.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: qubitron-1.6.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for qubitron-1.6.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8421a0e4788675be7d607a43594ad37fbb32cf9de19d5ecddc5a8b02d52f285
MD5 558f7ea381536b800c67b157721fe204
BLAKE2b-256 851766a7c46a0ab2a97aed271743198335203f1b32bd16a842bf53faec35e005

See more details on using hashes here.

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