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.2.0.tar.gz (12.9 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.2.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for qiskit_iceberg_transpiler-0.2.0.tar.gz
Algorithm Hash digest
SHA256 61a6fcdcc222ac91db9a420f3dcfbddde5c83491634ad2eb6a54905fa513f4e6
MD5 a7d87a8291706f7d71c8465db1e6fe3c
BLAKE2b-256 ebfad35cd90763b6212a5f3c63ea7336d2cf0a86674695a21d9ba6b2e8bf3a26

See more details on using hashes here.

Provenance

The following attestation bundles were made for qiskit_iceberg_transpiler-0.2.0.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.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_iceberg_transpiler-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 63c7a91edc4b2136a0998231f8e9bb1d4cc5e35b8f8006d16a11bcf1ce4b258b
MD5 2db4e1bb8d8d966b895676f45a6b67b0
BLAKE2b-256 a3f95e6631dcf5b5513dc12f28242140477bd82b94cdac60ee7772da934ca8a7

See more details on using hashes here.

Provenance

The following attestation bundles were made for qiskit_iceberg_transpiler-0.2.0-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