Skip to main content

light orange oval with a hissing black cat in the center with UCC written across the bottom Unitary Compiler Collection

Repository PyPI version Downloads License Unitary Foundation Documentation Status codecov Discord Chat

The Unitary Compiler Collection (UCC) is a Python library for frontend-agnostic, high performance compilation of quantum circuits. UCC's goal is to gather together the best of open source compilation to make quantum programming simpler, faster, and more scalable.

By leveraging qBraid, UCC interfaces automatically with multiple quantum computing frameworks, including Qiskit, Cirq, and PyTKET and supports programs in OpenQASM 2 and OpenQASM 3. For the full list, just call ucc.supported_circuit_formats.

We use the Merit Terminal to pay contributors who implement new compiler passes in our repo! Check out our open issues tagged with #merit-bounty to see which are eligible for compensation.

Want to know more?

Resource Description
Documentation Check out our documentation for more information on using and contributing to UCC.
Discussions For code, repo, or ecosystem questions.
Discord For casual or time-sensitive questions, including weekly community calls.
Research Publications Explore academic work utilizing UCC.

Quickstart

Installation

Note: UCC requires Python version ≥ 3.12.

For normal users of UCC, you can install via pip as

pip install ucc

If developing, including if building custom transpiler passes, please install uv, which is used to managed dependencies and ensure a reproducible development enviroment. Once uv is installed, setup your development environment via

git clone https://github.com/unitaryfoundation/ucc.git
cd ucc
uv sync --all-extras --all-groups

This uv sync command ensures the optional developer and documentation dependences are installed. For development with uv, we assume you either prefix each command with uv run, or you first activate the uv managed virtual environment by running source .venv/bin/activate in your shell.

For more details on using uv, refer to its documentation or this tutorial.

Example with Qiskit, Cirq, and PyTKET

Define a circuit with your preferred quantum SDK and compile it!

from ucc import compile

from pytket import Circuit as TketCircuit
from cirq import Circuit as CirqCircuit
from qiskit import QuantumCircuit as QiskitCircuit
from cirq import H, CNOT, LineQubit

def test_tket_compile():
    circuit = TketCircuit(2)
    circuit.H(0)
    circuit.CX(0, 1)
    compile(circuit)

def test_qiskit_compile():
    circuit = QiskitCircuit(2)
    circuit.h(0)
    circuit.cx(0, 1)
    compile(circuit)

def test_cirq_compile():
    qubits = LineQubit.range(2)
    circuit = CirqCircuit(
        H(qubits[0]),
        CNOT(qubits[0], qubits[1]))
    compile(circuit)

How does UCC stack up?

UCC seeks to provide an end-to-end compiler that works well for the majority of the users out of the box. Today, this is achieved by running a particular subset of Qiskit transpiler passes. To ensure we continue to improve performance and meet user needs, we regularly run benchmarks comparing UCC against the latest versions of leading quantum compiler frameworks across a range of circuits. Here’s the latest: alt text

And here you can see progress over time, with new package versions labeled for each compiler: alt text where pytket-peep indicates the FullPeepHoleOptimize function of PyTKET.

The benchmark code, configurations and raw results from running on specific hardware are maintined in the companion repository of ucc-bench.

To learn more about running these benchmarks, the overall benchmark philosophy, or how to contribute to improving the benchmarking methodology, check out the benchmarking section in the docs or the README.md in ucc-bench.

Contributing

We’re building UCC as a community-driven project. Your contributions help improve the tool for everyone! There are many ways you can contribute, such as

  • 💸 Create a Custom Compiler Pass:💸 Learn how in the User Guide. Eligible for compensation through the Merit Terminal!
  • Submit a bug report or feature request: Submit a bug report or feature request on GitHub.
  • Contribute Code: Follow the Contribution Guide to submit new passes and improvements.

If you have questions about contributing please ask on the Unitary Foundation Discord.

License

UCC is distributed under GNU Affero General Public License version 3.0(AGPLv3). Parts of ucc contain code or modified code that is part of Qiskit or Qiskit Benchpress, which are distributed under the Apache 2.0 license.

Contributors ✨

Thank you to all of the wonderful people that have made this project possible. Non-code contributors are also much appreciated, and are listed here. Thank you to:

Contributions of any kind are welcome!

Metadata

Release files for ucc 0.4.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ucc 0.4.12
File Size Uploaded Provenance
ucc-0.4.12.tar.gz 413.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ucc 0.4.12
File Interpreter ABI Platform
ucc-0.4.12-py3-none-any.whl Python 3 none any Details

Total release size: 449.5 kB

Release files / ucc-0.4.12.tar.gz

Download URL ucc-0.4.12.tar.gz
Size 413.4 kB
Tags Source
SHA-256 checksum
How to use checksums
62048c180089dd6d49ced311092b4b98445177c15995baf43c64fdb0daeb4e3b
BLAKE2b-256 checksum
How to use checksums
806353fcb0327df99a701d871e029db8bb18d18baa7258ca9d0fb82cc1d6168a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 18, 2025.

Transparency log

Release files / ucc-0.4.12-py3-none-any.whl

Download URL ucc-0.4.12-py3-none-any.whl
Size 36.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df90146b69c6fa0e10e85401a7eaec0bcc550e065a12e89f5638f1ffb5982dbc
BLAKE2b-256 checksum
How to use checksums
c318a57f6e1d29584932304e28665ac488a73998db30376a7dff02e1348cc42d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 18, 2025.

Transparency log

Security for ucc 0.4.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ucc-0.4.12.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 18, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page