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.0.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.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for qiskit_iceberg_transpiler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9400ad7e9d62db6ab4f7dea23826e2794b14f5464e88ae14c0f7311f7803a51
MD5 7e4f85943689fb2915d78cf6b458786a
BLAKE2b-256 ab1870820c509025d296a251f0b4cc6790d57d022f5aab3306dc071b32a45531

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for qiskit_iceberg_transpiler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1091e04a53416eb66750ff92c2be5ba130e9d59a576a4307943267d641dbb035
MD5 42156a8b266863591426a460985ddb2b
BLAKE2b-256 0b2a35f89ffe08fdddbca6fc293f63ca9f3051cfd7a508387e981b9f015aad17

See more details on using hashes here.

Provenance

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