Skip to main content

Qamomile

PyPI version License

[!WARNING] This repository is actively developed. APIs may still change, including breaking changes, while active development continues.

Qamomile is a typed quantum programming SDK for writing quantum kernels in Python, inspecting them as Qamomile IR, estimating resources symbolically, and transpiling them to concrete execution quantum SDK such as Qiskit, QURI Parts, CUDA-Q. Furthermore, as a backend for Qiskit, we support qBraid.

The current workflow is:

@qkernel define -> draw() / estimate_resources() -> transpile() -> sample() / run() -> .result()

Why Qamomile?

  • Write quantum programs as typed Python functions with @qkernel.
  • Use typed handles such as Qubit, Bit, Float, UInt, and Observable.
  • Inspect kernels before execution with draw() and estimate_resources().
  • Build parameterized circuits and reuse a transpiled executable with different runtime bindings.
  • Run measured programs with sample() and expectation-value programs with run().
  • Express circuit structure with classical control flow such as qmc.range(), qmc.items(), if, and while.
  • Reuse circuit logic with helper kernels and @composite_gate.

Installation

This README describes the current source tree, not the older PyPI release. If you want this version, install from source.

Requirements:

  • Python 3.11+
  • uv

Clone the repository:

git clone https://github.com/Jij-Inc/Qamomile.git
cd Qamomile

Choose the installation style that matches your use case.

Full development environment:

uv sync

This installs the default development dependency group. In the current pyproject.toml, that gives you Qiskit, circuit visualization, documentation, and test tooling. Optional backend integrations such as QURI Parts, qBraid, and CUDA-Q still need their corresponding extras.

Runtime-only environment from source:

uv sync --no-dev

The compiler core is backend-independent. To run the Qiskit-based Quick Start and render draw() output in a runtime-only environment, install the matching extras:

uv sync --no-dev --extra qiskit --extra visualization

Runtime-only environment from source with QURI Parts support:

uv sync --no-dev --extra quri_parts

Runtime-only environment from source with qBraid support:

uv sync --no-dev --extra qbraid

Runtime-only environment from source with CUDA-Q v0.14.0 support:

uv sync --no-dev --extra cudaq-cu12   # for CUDA 12.x
uv sync --no-dev --extra cudaq-cu13   # for CUDA 13.x (or MacOS)

CUDA-Q v0.14.0 currently supports Linux, macOS ARM64 (Apple Silicon), and Windows via WSL2. For MacOS, please use cudaq-cu13.

[!NOTE] Why cudaq-cu12 / cudaq-cu13 instead of cudaq?

The upstream cudaq meta-package provides only an sdist whose setup.py dynamically computes install_requires. This causes uv pip install cudaq to silently install the package without its dependencies on the first attempt (astral-sh/uv#12759, NVIDIA/cuda-quantum#3616). To avoid this issue, Qamomile specifies the concrete wheel packages cuda-quantum-cu12 / cuda-quantum-cu13 directly as optional dependencies, split by CUDA version.

If you prefer an explicit editable install inside your environment, this also works from the cloned repository:

pip install -e .
pip install -e ".[qiskit,visualization]"  # Qiskit Quick Start + draw()
pip install -e ".[quri_parts]"   # optional
pip install -e ".[qbraid]"       # optional
pip install -e ".[cudaq-cu12]"   # optional, CUDA 12.x
pip install -e ".[cudaq-cu13]"   # optional, CUDA 13.x

If you intentionally want the latest published release instead, pip install qamomile installs the PyPI package, not this work-in-progress branch.

Quick Start

import math

import qamomile.circuit as qmc
from qamomile.qiskit import QiskitTranspiler


@qmc.qkernel
def biased_coin(theta: qmc.Float) -> qmc.Bit:
    q = qmc.qubit(name="q")
    q = qmc.ry(q, theta)
    return qmc.measure(q)


# Inspect the kernel before execution
biased_coin.draw(theta=0.6)
est = biased_coin.estimate_resources()
print("qubits:", est.qubits)
print("total gates:", est.gates.total)

# Transpile once, keep theta as a runtime parameter
transpiler = QiskitTranspiler()
exe = transpiler.transpile(biased_coin, parameters=["theta"])

# Execute with a concrete binding
result = exe.sample(
    transpiler.executor(),
    shots=256,
    bindings={"theta": math.pi / 4},
).result()

print(result.results)

If a kernel returns measured bits, use sample(). If it returns a qmc.Float from qmc.expval(...), use run() instead.

Main Packages

  • qamomile.circuit: the main entry point for typed quantum kernels, gates, control flow, drawing, and resource estimation
  • qamomile.observable: Hamiltonians and Pauli observables used with expectation-value workflows
  • qamomile.qiskit: Qiskit transpiler and executor support
  • qamomile.cudaq: optional CUDA-Q transpiler, executor, and observable conversion (supports both static sampling and runtime control-flow modes)
  • qamomile.qbraid: optional qBraid executor support for running Qiskit circuits on qBraid-supported devices
  • qamomile.quri_parts: optional QURI Parts transpiler and executor support
  • qamomile.optimization: optimization-oriented functionality retained for continuity with older Qamomile workflows

Optimization Support

Qamomile still supports the optimization-oriented workflow that older versions focused on. That functionality lives under qamomile.optimization, including QAOA, FQAOA, and QRAO-related modules. This README focuses on the current circuit-first API, but optimization support remains part of the project.

Learn More

Contributing

Contributions, bug reports, and feedback are welcome via GitHub Issues and pull requests.

Notes for Windows developers

This repository uses git symlinks (e.g., AGENTS.mdCLAUDE.md). On Windows, Git for Windows does not create real symlinks by default, and a symlinked file will be checked out as a plain text file containing the target path. To get real symlinks, enable core.symlinks before cloning and make sure your environment allows symlink creation (either run in Developer Mode, available since Windows 10 Creators Update, or run as administrator):

git config --global core.symlinks true
git clone https://github.com/Jij-Inc/Qamomile.git

If you already cloned without this setting, you can re-checkout the affected paths after enabling it:

git config core.symlinks true
git checkout -- AGENTS.md

On macOS, Linux, and WSL2 this is handled automatically — no action needed.

License

Qamomile is released under the Apache 2.0 License.

Citation

If you use Qamomile in your research, please cite:

@INPROCEEDINGS{11249901,
  author={Huang, Wei-Hao and Matsuyama, Hiromichi and Tam, Wai-Hong and Sato, Keisuke and Yamashiro, Yu},
  booktitle={2025 IEEE International Conference on Quantum Computing and Engineering (QCE)},
  title={Qamomile: A Cross-SDK Bridge for Quantum Optimization},
  year={2025},
  volume={02},
  pages={516-517},
  doi={10.1109/QCE65121.2025.10423}
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qamomile-0.14.0.tar.gz (8.4 MB view details)

Uploaded Source

Built Distribution

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

qamomile-0.14.0-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file qamomile-0.14.0.tar.gz.

File metadata

  • Download URL: qamomile-0.14.0.tar.gz
  • Upload date:
  • Size: 8.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for qamomile-0.14.0.tar.gz
Algorithm Hash digest
SHA256 aa74ec2e0ddf8cfe6fe0a159e33d77ab9d042baba1fc881422f4af1dbc8e2938
MD5 42eb28e23e351b95ff999d9359e0f61c
BLAKE2b-256 f3f0189edda5045c6bc11d54038ded1ec8f6004adec5aa0cd2ecd24ce921c6e0

See more details on using hashes here.

File details

Details for the file qamomile-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: qamomile-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for qamomile-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f5604d9eab805f078611a73c47794011ac4b1bdd0d3c70f978940e682516a9b3
MD5 f7dbbea7d5084c548962f92c2f728cec
BLAKE2b-256 775f98245c78f8bf73e6b847a561e9288d46745bf1768200acb2e70dfec65476

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.14.0 This release

2 files

0.13.0

2 files

0.12.7

2 files

0.12.6

2 files

0.12.5

2 files

0.12.4

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.1

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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