logicalΒΆ

Guppy types and logical operations for the C4-Helix QEC architecture.

A Block contains two logical qubits, indexed 0 and 1. All code operations act on blocks. TState is an opaque, consumable magic resource.

Classes

Block()

A block of two logical qubits, prepared as |00> by construction.

TState()

A consumable T-state resource with backend-selected encoding.

Functions

cx(block)

CX from logical qubit 0 to 1.

cx_between_blocks(control, target, i, j)

Targeted CX from the first block to the second.

cx_transversal(control, target)

Apply CX from each logical qubit in the first block to the corresponding logical qubit in the second block.

cz(block)

Logical CZ.

free(block)

Discard a block.

free_t_state(resource)

Discard an unused T-state resource.

h_all(block)

Hadamard on each logical qubit.

inject_t(block, i, resource)

Consume a T-state resource and apply T to the logical qubit selected by a runtime index.

inject_tdg(block, i, resource)

Consume a T-state resource and apply Tdg to the logical qubit selected by a runtime index.

measure_x_all(block)

Destructively measure both logical qubits in the X basis.

measure_z_all(block)

Destructively measure both logical qubits in the Z basis.

prep_plus()

Prepare the |++> state on a block.

prep_t_state()

Create a resource that can be consumed to generate a T or Tdg operation on a logical qubit.

prep_zero()

Prepare the all-zero state on a block.

qec_cycle(block)

Perform syndrome extraction and recovery (or a Pauli-frame update).

ss(block)

Logical S on both qubits.

swap(block)

Swap the two qubits in the block.

t(block, i)

Apply T by preparing and consuming a magic resource.

tdg(block, i)

Apply Tdg by preparing and consuming a magic resource.

x(block, i)

Apply X to the logical qubit selected by a runtime index.

y(block, i)

Apply Y to the logical qubit selected by a runtime index.

z(block, i)

Apply Z to the logical qubit selected by a runtime index.