clifft-cirq
clifft-cirq converts parameter-resolved qubit cirq.Circuit instances into
Clifft circuit text and provides a small Cirq-style sampler facade on top of
Clifft. Parameter-resolved means the circuit has no symbolic parameters left,
for example after cirq.resolve_parameters.
See Clifft's front-end integrations guide for how this adapter fits with other Clifft front ends.
import cirq
import clifft_cirq
q0, q1 = cirq.LineQubit.range(2)
circuit = cirq.Circuit(
cirq.H(q0),
cirq.CNOT(q0, q1),
cirq.measure(q0, q1, key="m"),
)
converted = clifft_cirq.to_clifft_text(circuit)
print(converted.clifft_text)
sampler = clifft_cirq.ClifftSampler(seed=123)
result = sampler.run(circuit, repetitions=1000)
The converter returns:
clifft_text: text accepted by Clifft's parser.qubit_map: the deterministic mapping from Cirq qubits to Clifft integer qubits.measurement_map: measurement-key metadata used to rebuild acirq.Result.
Supported
- Qubit circuits with parameter-resolved operations.
- Sampling behavior and measurement distributions up to unconditional global phase.
- Mid-circuit measurements and resets.
- Measurement keys that appear once each.
- Common one-, two-, and three-qubit gates, including
H, Pauli gates, special-angle axis powers,CX,CZ,SWAP,ISWAP,CH,CCX,CCZ, and Clifft half-turn rotations such asR_XandR_ZZ. - Operations that Cirq can decompose into supported operations.
The converter uses rotations instead of same-named Clifft sqrt gates when
Clifft and Cirq conventions differ. Unsupported operations raise
UnsupportedCirqOperationError with the failing operation.
Unsupported
- Qudits.
- Unresolved symbolic parameters at the
to_clifft_textboundary. - Repeated measurement keys, such as
cirq.measure(q0, key="m")followed bycirq.measure(q1, key="m"). - Arbitrary classical control.
- Measurement confusion maps.
- Cirq noise channels.
- Device, timing, calibration, duration, and tag semantics.
- Stochastic noise, leakage, loss, and other noncomputational models.
Development
uv sync --group dev
uv run pytest
uv run ruff check .
uv run ruff format --check .
The package depends on clifft>=0.8 and uses its symbolic compiler and sampler
APIs. CI should keep testing both the Cirq floor and the latest allowed
cirq-core<2 range.
Metadata
Release files for clifft-cirq 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| clifft_cirq-0.1.2.tar.gz | 88.5 kB | With provenance | Details for clifft_cirq-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| clifft_cirq-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for clifft_cirq-0.1.2-py3-none-any.whl |
Total release size: 100.9 kB
Release files / clifft_cirq-0.1.2.tar.gz
| Download URL | clifft_cirq-0.1.2.tar.gz |
|---|---|
| Size | 88.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d888c3ed4af6943b1ea9f9fb82cf757a7227753acd9ad244921d1d1df3611ab6
|
|
BLAKE2b-256 checksum How to use checksums |
5f731b1d12b1fa97aeeefcf0dec92eacb04e9e5648547e8d810bf8bfb703b992
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 24, 2026.
Transparency logRelease files / clifft_cirq-0.1.2-py3-none-any.whl
| Download URL | clifft_cirq-0.1.2-py3-none-any.whl |
|---|---|
| Size | 12.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
919f7ada1e73a92ed4a163bad3b3ea675ba99e70b51daa6f4150060feb576bfa
|
|
BLAKE2b-256 checksum How to use checksums |
6a33a4c769c3042902d1519c866303c839c3b896fad9ae23da133cc56cad6a8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Aug 24, 2026.
Transparency logSecurity for clifft-cirq 0.1.2
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.
Attestation for clifft_cirq-0.1.2.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 Aug 24, 2026.
Transparency logA 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.