A framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Project description
Python package for writing, manipulating, and running quantum circuits on quantum computers and simulators.
Features – Installation – Quick Start – Documentation – Integrations – Community – Citing Qubitron – Contact
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
- The Qubitron releases page on GitHub lists the changes in each release.
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
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:
- For releases and major announcements: sign up to the low-volume mailing list
qubitron-announce. - For releases only:
- Via GitHub notifications: configure repository notifications for Qubitron.
- Via Atom/RSS from GitHub: subscribe to the GitHub Qubitron releases Atom feed.
- Via RSS from PyPI: subscribe to the PyPI releases RSS feed for Qubitron.
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
- Have a feature request or bug report? Open an issue on GitHub!
- Want to develop Qubitron code? Look at the list of good first issues to tackle, read our contribution guidelines, and then start opening pull requests!
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:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e731c6e762b0ea75552e2ffe9bf94ae2fec7c48a60f3c4ad4dea06c45ff95ec
|
|
| MD5 |
16ced8b5f69978b02dafdcacd35f9374
|
|
| BLAKE2b-256 |
9c72edde67fba1a90ec5f916115d329ee0024a6e3ada69516e635cfcb5f0fc4d
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8421a0e4788675be7d607a43594ad37fbb32cf9de19d5ecddc5a8b02d52f285
|
|
| MD5 |
558f7ea381536b800c67b157721fe204
|
|
| BLAKE2b-256 |
851766a7c46a0ab2a97aed271743198335203f1b32bd16a842bf53faec35e005
|