Skip to main content

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


Download files

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

Source Distribution

qiskit_iceberg_transpiler-0.1.1.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

qiskit_iceberg_transpiler-0.1.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file qiskit_iceberg_transpiler-0.1.1.tar.gz.

File metadata

File hashes

Hashes for qiskit_iceberg_transpiler-0.1.1.tar.gz
Algorithm Hash digest
SHA256 021397f4d6496910425f6db89d1b8b9123afadf2a854855a3a65599f3f03be46
MD5 095c48429770922cf600ed518c1d0cab
BLAKE2b-256 53b4013ef1c074888f817337b5d142a9fa78325531d0c217bfb23d7349dd82ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for qiskit_iceberg_transpiler-0.1.1.tar.gz:

Publisher: release.yml on jfurches/qiskit-iceberg-transpiler

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qiskit_iceberg_transpiler-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_iceberg_transpiler-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c8b7a71c067e2c5c58c90a75318147903784ff0bb34d88b51c2bdfff0fb34f20
MD5 b6760915bb59f99741de474f73ad6f54
BLAKE2b-256 b47ee5fc710e8b28e531a3570070880f0f5c16528fd15acdff089a4216d0ed2d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page