Qiskit transpiler to convert logical circuits to physical circuits using the [[k+2, k, 2]] Iceberg code
Project description
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]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file qiskit_iceberg_transpiler-0.1.1.tar.gz.
File metadata
- Download URL: qiskit_iceberg_transpiler-0.1.1.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
021397f4d6496910425f6db89d1b8b9123afadf2a854855a3a65599f3f03be46
|
|
| MD5 |
095c48429770922cf600ed518c1d0cab
|
|
| BLAKE2b-256 |
53b4013ef1c074888f817337b5d142a9fa78325531d0c217bfb23d7349dd82ce
|
Provenance
The following attestation bundles were made for qiskit_iceberg_transpiler-0.1.1.tar.gz:
Publisher:
release.yml on jfurches/qiskit-iceberg-transpiler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qiskit_iceberg_transpiler-0.1.1.tar.gz -
Subject digest:
021397f4d6496910425f6db89d1b8b9123afadf2a854855a3a65599f3f03be46 - Sigstore transparency entry: 149120504
- Sigstore integration time:
-
Permalink:
jfurches/qiskit-iceberg-transpiler@12dad42459a2fad5662ea7b5dee630ed8601562e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jfurches
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@12dad42459a2fad5662ea7b5dee630ed8601562e -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file qiskit_iceberg_transpiler-0.1.1-py3-none-any.whl.
File metadata
- Download URL: qiskit_iceberg_transpiler-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8b7a71c067e2c5c58c90a75318147903784ff0bb34d88b51c2bdfff0fb34f20
|
|
| MD5 |
b6760915bb59f99741de474f73ad6f54
|
|
| BLAKE2b-256 |
b47ee5fc710e8b28e531a3570070880f0f5c16528fd15acdff089a4216d0ed2d
|
Provenance
The following attestation bundles were made for qiskit_iceberg_transpiler-0.1.1-py3-none-any.whl:
Publisher:
release.yml on jfurches/qiskit-iceberg-transpiler
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qiskit_iceberg_transpiler-0.1.1-py3-none-any.whl -
Subject digest:
c8b7a71c067e2c5c58c90a75318147903784ff0bb34d88b51c2bdfff0fb34f20 - Sigstore transparency entry: 149120508
- Sigstore integration time:
-
Permalink:
jfurches/qiskit-iceberg-transpiler@12dad42459a2fad5662ea7b5dee630ed8601562e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/jfurches
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@12dad42459a2fad5662ea7b5dee630ed8601562e -
Trigger Event:
workflow_run
-
Statement type: