Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Qamomile

PyPI version License

Documentation: English | 日本語

Qamomile is a source-compiled, type-safe functional quantum programming language embedded in Python. One program can be inspected, estimated symbolically, executed by the native reference runtime, or compiled for an SDK backend without rewriting the algorithm.

Python is the familiar source language; Rust owns the compiler semantics, verification, canonical QCore representation, resource analysis, target planning, and reference execution. Quantum values are linear values rather than mutable circuit handles, so ownership mistakes are rejected before a backend artifact exists.

Python source -> verified QCore -> symbolic resources
                              -> Reference execution
                              -> Qiskit / Cirq / QURI Parts / CUDA-Q / Braket / HUGR

Installation

Qamomile requires Python 3.11 or newer. The distribution includes the native compiler in one ABI3 wheel (a binary package compatible with Python 3.11 and newer):

uv add qamomile

or

pip install qamomile

Install an SDK integration only when it is needed:

pip install "qamomile[qiskit]"
pip install "qamomile[quri_parts]"
pip install "qamomile[braket]"
pip install "qamomile[cudaq-cu13]"  # Apple Silicon or CUDA 13 on Linux
pip install "qamomile[hugr]"
pip install "qamomile[quration]"
pip install "qamomile[qir]"

For repository development, install the prerequisites in Development first. uv builds Qamomile and its bundled Rust compiler as part of the locked environment:

git clone https://github.com/Jij-Inc/Qamomile.git
cd Qamomile
uv sync --frozen --group dev

Alternatively, install the source checkout with pip from the repository root. The same build prerequisites apply. This command installs Qamomile and its bundled Rust compiler together:

pip install -e .

Coding agent skill

The installed package includes a Qamomile authoring plugin, local marketplace catalogs, and a CLI. The skill path, plugin path, and marketplace path commands only print local paths; they do not install, register, or enable integrations. Coding agents must inspect the resources and obtain the user's approval before installing skills, registering marketplaces, or enabling plugins. After approval, register the marketplace and install the plugin:

codex plugin marketplace add "$(uv run qamomile marketplace path)"
codex plugin add qamomile@qamomile

For Claude Code:

claude plugin marketplace add "$(uv run qamomile marketplace path)"
claude plugin install qamomile@qamomile

uv run qamomile plugin path prints the plugin directory. Both marketplaces and direct skill installation use the same packaged skill. The agent's plugin manager owns marketplace installations; the Qamomile CLI owns only copies made with skill install. Choose one installation method per agent to avoid duplicate discovery. Read or install the skill directly with:

uv run qamomile skill show
uv run qamomile skill show references/authoring.md
uv run qamomile skill install --agent codex
uv run qamomile skill status --agent codex

Use --agent claude-code for Claude Code and --project PATH to select another existing project directory. Codex uses .agents/skills/qamomile/; Claude Code uses .claude/skills/qamomile/. Reload the agent's project/session if needed for discovery. Commands also work as python -m qamomile.

After upgrading Qamomile, use skill update with the same agent and project. Local edits and unmanaged copies are protected. Update and remove preserve the previous copy outside skill discovery. skill path prints the bundled skills directory; skill show references/skill-cli.md explains every command and exit status. The CLI operates on local files without a remote catalog.

Quick start

Qamomile compiles function bodies from Python source without executing them. Save the program in a source file such as bell.py:

import qamomile as qm


@qm.qkernel
def bell() -> qm.Bits[2]:
    state = qm.qubits(2)
    state = qm.h(state, target=0)
    state = qm.cx(state, control=0, target=1)
    return qm.measure(state)

The same function can be estimated and executed directly:

import qamomile as qm

from bell import bell


study = qm.resources.logical(bell)
print(study.metric(qm.resources.LOGICAL_GATES))

record = qm.run(bell, on=qm.Reference(), shots=128, seed=7)
print(record.result.counts)

There is no hidden mutable circuit. Each operation consumes an owned quantum value and returns its successor. For example, writing qm.h(state) without rebinding the result is rejected instead of silently discarding a state transition.

Hamiltonian construction can remain algorithmic while instance coefficients stay ordinary classical data:

from __future__ import annotations

import qamomile as qm


@qm.qkernel
def transverse_field(
    n: qm.Const[qm.Int],
    coefficients: qm.Const[qm.Vector[qm.Real, n]],
) -> qm.Observable:
    hamiltonian = qm.zero_observable(n)
    for index in range(n):
        hamiltonian = hamiltonian + coefficients[index] * qm.X(index)
    return hamiltonian

The for remains a structured QCore loop in the reusable recipe. Binding n and coefficients materializes one canonical Hamiltonian through the Rust observable algebra; SDK backends receive the same result without owning another expression evaluator. Observable recipes are Const in this first surface: launch-time Param coefficients are rejected before an artifact is created.

n in Vector[Real, n] is Qamomile compiler syntax for a dependent dimension, rather than a standard Python type variable. Keep the future import when this source file may be imported by Python so the interpreter does not eagerly evaluate n; qm.build("file.py") parses the annotation directly. Ruff and Zuban can check a Qamomile source module without cluttering each dependent annotation by placing these module-wide directives at the top of that module:

# ruff: noqa: F821 -- dimensions are Qamomile dependent shape binders.
# mypy: disable-error-code="valid-type"

These are module-wide checker accommodations, so reserve them for Qamomile source modules. Qamomile still validates the dimension binding and its uses in the Rust compiler.

Explicit compiler lifecycle

Interactive code can use qm.run(...). Tools that need durable boundaries can use the complete lifecycle:

source -> Module -> ProgramFamily -> Program -> Artifact -> RunRecord
import qamomile as qm


module = qm.build("bell.py")
program = qm.specialize(module["bell"])
study = qm.resources.logical(program)
artifact = qm.compile(study, to=qm.Reference())
job = qm.submit(artifact, on=qm.Reference(), shots=128, seed=7)
result = job.result()

Module, program, resource-study, and artifact boundaries use deterministic, validated representations. Submitting an existing artifact never reparses or recompiles Python source. The lower-level submit(...) path returns a Job when asynchronous control is needed; run(...) retains the completed artifact, invocation, and result together as a RunRecord.

Backend namespaces

  • qamomile: language surface, compiler lifecycle, reference runtime, observables, standard library, optimization helpers, and symbolic resources
  • qamomile.qiskit: Qiskit lowering and Aer execution
  • qamomile.quration: concrete PyQret circuits, local simulation, and Quration FTQC compilation
  • qamomile.qir: QIR 1.0 Base Profile export as LLVM text and bitcode
  • qamomile.cirq: Cirq JSON, local/noisy simulation, and Google endpoints
  • qamomile.quri_parts: QURI Parts lowering and Qulacs execution
  • qamomile.cudaq: CUDA-Q lowering and local execution
  • qamomile.braket: OpenQASM 3 lowering and Amazon Braket execution
  • qamomile.hugr: structured QCore lowering to HUGR and Selene

Backend integrations exist only under the nested qamomile.<backend> namespaces.

With qamomile[qir], export a static measurement entry to QIR for an external consumer. Using bell from the quick start:

from pathlib import Path

import qamomile as qm
from bell import bell

from qamomile.qir import QIR, load_bitcode, load_ir

artifact = qm.compile(bell, to=QIR())
Path("bell.ll").write_text(load_ir(artifact), encoding="utf-8")
Path("bell.bc").write_bytes(load_bitcode(artifact))

Specialize Const inputs before export. The initial Base Profile supports terminal measurements and records a flat bit array in logical source order. Runtime parameters, measurement-dependent control, reset, discard, gates after measurement, and computed classical outputs are rejected. The artifact retains the typed result ABI and supports qamomile.persistence.serialize/deserialize; the .bc file is the standalone module for the external QIR runtime.

The repository contains one Qamomile source implementation. Compiler semantics and execution live in Rust; Python contains the source adapter, public values, and SDK-specific integration boundaries.

Development

Run these commands from the repository root. Source checkouts require:

  • Git and uv for the locked Python environment.
  • Python 3.11 or newer; Python 3.12 matches the documentation build environment.
  • rustup, which selects Rust 1.98.0, Clippy, and rustfmt from rust-toolchain.toml.
  • A native linker/toolchain: Xcode Command Line Tools on macOS, C/C++ build tools on Linux, or the MSVC C++ build tools on Windows.

A separate Protobuf compiler is unnecessary: normal builds use checked-in wire bindings, and schema tests use the vendored compiler.

rustc --version
uv sync --frozen --group dev
uv run --no-sync python -c "import qamomile, qamomile._qamomile_native"
uv run --no-sync pytest
uv run --no-sync ruff check qamomile tests
uv run --no-sync ruff format --check qamomile tests
uv run --no-sync zuban check qamomile tests/typecheck
uv run --no-sync cargo test --workspace --locked

uv sync installs Qamomile in editable mode and builds its bundled native compiler. After changing Rust code, rebuild before testing Python:

uv sync --frozen --group dev --reinstall-package qamomile
uv run --no-sync pytest rust/qamomile-python/tests

The default pytest profile excludes docs, several optional SDKs, and slow suites. A test filename alone does not override these exclusions. For example, run QURI Parts coverage with:

uv sync --frozen --group dev --extra quri_parts
uv run --no-sync pytest -m "quri_parts and not backend_slow" tests/qamomile/test_quri_parts_backend.py

Keep the selected extras/groups when syncing again, or use uv run --no-sync in the prepared environment. The HUGR and Guppy extras require separate syncs or environments.

Repository map

Path Responsibility
qamomile/ Python source capture, immutable public facades, library composition, SDK adapters.
rust/qamomile-compiler/ Compiler semantics, verified QCore, lowering, resource analysis, reference execution.
rust/qamomile-python/ PyO3 conversion and projection boundary; no independent compiler semantics.
tests/ Python API, backend, architecture, and documentation checks.
docs/ English/Japanese documentation sources, notebooks, and build tools.

Learn the language and lifecycle in the tutorials. Package and crate documentation describe implementation boundaries alongside the code.

Writing documentation

Documentation authors also need Bash and Node.js 24 (the version selected by Read the Docs). From the repository root:

uv sync --frozen --group docs
UV_NO_SYNC=1 ./docs/build.sh build-en
UV_NO_SYNC=1 ./docs/build.sh serve-en

This first preview uses committed notebook outputs. For executable changes, edit the Jupytext .py source, then sync and execute the selected page with page-build. See the documentation quick start for kernel setup, Japanese previews, and page validation.

Contributing

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

License

Qamomile is released under the Apache 2.0 License.

QCE 2026 Tutorial

The Qamomile team delivered Introduction to Qamomile: Estimating Symbolically & Executing Concretely at IEEE Quantum Week (QCE 2026) on September 14, 2026. See the official program for Part 1 and Part 2.

Citation

If you use Qamomile in 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}
}

Metadata

Release files for qamomile 0.16.0rc1

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

Source distribution (sdist)

Source distribution for qamomile 0.16.0rc1
File Size Uploaded Provenance Actions
qamomile-0.16.0rc1.tar.gz 1.3 MB Without provenance Details for qamomile-0.16.0rc1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for qamomile 0.16.0rc1
File Interpreter ABI Platform Actions
qamomile-0.16.0rc1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for qamomile-0.16.0rc1-cp311-abi3-win_amd64.whl
qamomile-0.16.0rc1-cp311-abi3-manylinux_2_28_x86_64.whl CPython 3.11 abi3 Linux glibc 2.28+ x86-64 Details for qamomile-0.16.0rc1-cp311-abi3-manylinux_2_28_x86_64.whl
qamomile-0.16.0rc1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for qamomile-0.16.0rc1-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 14.4 MB

Release files / qamomile-0.16.0rc1.tar.gz

Download URL qamomile-0.16.0rc1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
df35677f724b57ac0453531bfb882d3a32cb1a4cdaebc33f31c9ec202633b4c5
BLAKE2b-256 checksum
How to use checksums
6dde6dd882b944a1ae720fdd8d9b0ad11f8e4b11664a3047f10449c9c941f845
Upload date
Uploaded using Trusted Publishing?
What is 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":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qamomile-0.16.0rc1-cp311-abi3-win_amd64.whl

Download URL qamomile-0.16.0rc1-cp311-abi3-win_amd64.whl
Size 4.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
922361f915777a56323ca73e580771c9078292ba7eda427e08422b6caca8b2ef
BLAKE2b-256 checksum
How to use checksums
1824472fff7b84c0821dc1bbe8f1b2db540af483749ae5b607ba8cf48b37a6f1
Upload date
Uploaded using Trusted Publishing?
What is 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":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qamomile-0.16.0rc1-cp311-abi3-manylinux_2_28_x86_64.whl

Download URL qamomile-0.16.0rc1-cp311-abi3-manylinux_2_28_x86_64.whl
Size 4.6 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
b885598716b6de737ff6504b57c7a7388bf291df6e7f392f20d419adca948266
BLAKE2b-256 checksum
How to use checksums
79d2bd32ff5808d52ad06dc1555ecb9a232b426ded35379221f9fb1a391d1e3d
Upload date
Uploaded using Trusted Publishing?
What is 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":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / qamomile-0.16.0rc1-cp311-abi3-macosx_11_0_arm64.whl

Download URL qamomile-0.16.0rc1-cp311-abi3-macosx_11_0_arm64.whl
Size 4.2 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
88e676dddc822766dea1d6d3bf8de35888fc4b5e9df9f001b404b02fdf2aabae
BLAKE2b-256 checksum
How to use checksums
d883866dfb2cbf69eb2b6bd7d96c570a814acff99033bdc8edd0d727791c156b
Upload date
Uploaded using Trusted Publishing?
What is 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":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for qamomile 0.16.0rc1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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