Qiskit Iceberg Transpiler
This is an experimental module for encoding logical circuits defined in Qiskit with the Iceberg quantum error detection code. It largely follows the implementation details from the Quantinuum demonstration [1].
The Iceberg code is a $[[k+2, k, 2]]$ detection code, meaning it encodes $k$ logical qubits using $k+2$ physical qubits (and technically 2 more ancillas) [2]. Its logical operations require long-range gates, which makes it more suited for trapped-ion devices with all-to-all coupling maps.
[1] C. Self, M. Benedetti, and D. Amaro, 2024. https://arxiv.org/abs/2211.06703
[2] Error correction zoo. https://errorcorrectionzoo.org/c/iceberg
Installation
The package can be installed from pip with
pip install qiskit-iceberg-transpiler
As it uses some newer features of Qiskit like classical variables, it requires Qiskit 1.2.x or higher.
Usage
To get started, you'll need a QuantumCircuit, which can be manually constructed, loaded from QASM, or whatever. Everything in this QuantumCircuit will be treated as logical operations.
To produce the physical circuit, we can simply use the function transpile. We also need to specify where to put syndrome checks. This is demonstrated below,
# Import with a different name to not mix up with qiskit
from qiskit_iceberg_transpiler import transpile as ib_transpile
logical_circuit = QuantumCircuit(...)
# We can put syndrome checks after every `n` logical layers
add_syndrome_every_n_layers = 16
# Or we can choose to evenly space `n` checks. Note that only
# one of these flags should be set.
syndrome_checks = 3
# Transpile to get our circuit made of physical operators, including
# logical state preparation and measurement
physical_circuit = ib_transpile(
logical_circuit,
add_syndrome_every_n_layers=add_syndrome_every_n_layers,
syndrome_checks=syndrome_checks,
)
If these default options don't fit your application and you want finer control over the syndrome placement, you can manually add the Syndrome placeholder to your circuit, which the transpiler will later replace with real checks.
from qiskit import ClassicalRegister, QuantumCircuit, QuantumRegister
from qiskit_iceberg_transpiler import Syndrome
# Define our logical circuit
k = QuantumRegister(4, 'k')
cl_k = ClassicalRegister(4, 'k')
qc = QuantumCircuit(k, cl_k)
# Start of GHZ circuit
qc.h(k[0])
qc.cx(k[0], k[1])
# Manual syndrome check. Note that all syndrome checks must operate on the same set of qubits (in the same order)
qc.append(Syndrome(4), k)
# Rest of circuit
qc.cx(k[1], k[2])
qc.cx(k[2], k[3])
qc.measure(k, cl_k)
See more in the examples.
Todo
[ ] Make it work as a qiskit transpiler plugin
[ ] Add more tests
[ ] Simulate with noisy models
[ ] Replicate QV tests from [1]
Metadata
Release files for qiskit-iceberg-transpiler 0.2.0
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 |
|---|---|---|---|---|
| qiskit_iceberg_transpiler-0.2.0.tar.gz | 12.9 kB | With provenance | Details for qiskit_iceberg_transpiler-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qiskit_iceberg_transpiler-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for qiskit_iceberg_transpiler-0.2.0-py3-none-any.whl |
Total release size: 26.8 kB
Release files / qiskit_iceberg_transpiler-0.2.0.tar.gz
| Download URL | qiskit_iceberg_transpiler-0.2.0.tar.gz |
|---|---|
| Size | 12.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61a6fcdcc222ac91db9a420f3dcfbddde5c83491634ad2eb6a54905fa513f4e6
|
|
BLAKE2b-256 checksum How to use checksums |
ebfad35cd90763b6212a5f3c63ea7336d2cf0a86674695a21d9ba6b2e8bf3a26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.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 Nov 22, 2024.
Transparency logRelease files / qiskit_iceberg_transpiler-0.2.0-py3-none-any.whl
| Download URL | qiskit_iceberg_transpiler-0.2.0-py3-none-any.whl |
|---|---|
| Size | 13.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
63c7a91edc4b2136a0998231f8e9bb1d4cc5e35b8f8006d16a11bcf1ce4b258b
|
|
BLAKE2b-256 checksum How to use checksums |
a3f95e6631dcf5b5513dc12f28242140477bd82b94cdac60ee7772da934ca8a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.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 Nov 22, 2024.
Transparency logSecurity for qiskit-iceberg-transpiler 0.2.0
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 qiskit_iceberg_transpiler-0.2.0.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 Nov 22, 2024.
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.