tket Intermediate Free 5/8 in series 30 min read

Getting Started with Quantinuum H-Series

Run circuits on Quantinuum's H-series trapped-ion processors using pytket. Covers hardware access, qubit connectivity, mid-circuit measurement, and error mitigation strategies that exploit H-series strengths.

What you'll learn

  • Quantinuum
  • H-series
  • trapped-ion
  • pytket
  • mid-circuit measurement
  • all-to-all connectivity
  • Azure Quantum

Prerequisites

  • Python proficiency
  • Beginner quantum computing concepts (superposition, entanglement)
  • Linear algebra basics

Quantinuum’s H-series (H1, H2) are trapped-ion quantum processors with two features that set them apart from superconducting hardware: all-to-all qubit connectivity and native mid-circuit measurement with qubit reuse. Understanding these properties, and how to exploit them, is the key to getting good results on H-series hardware.

Why H-Series Is Different

All-to-all connectivity. Every qubit can directly interact with every other qubit. There is no coupling map, no SWAP insertion, and no qubit routing overhead. A two-qubit gate between qubit 0 and qubit 11 costs exactly the same as a gate between adjacent qubits. This fundamentally changes how you should design circuits for H-series: qubit placement strategies developed for superconducting hardware are irrelevant here.

High native gate fidelity. H2 achieves median two-qubit gate fidelity above 99.8% and single-qubit fidelity above 99.9%. These are among the highest fidelities of any publicly available quantum processor as of 2025.

Mid-circuit measurement and reset. H-series supports measuring qubits in the middle of a circuit and using the result to control subsequent gates (feed-forward). Measured qubits can be reset and reused within the same circuit, allowing circuits that need more logical qubits than the device has physical qubits to run by reusing ancillas.

Smaller qubit count. H2 has 56 qubits. H1 had 20. The high fidelity compensates substantially for the smaller scale.

Hardware Access

Quantinuum H-series is accessible through two channels:

  1. Quantinuum’s Nexus platform (direct API): nexus.quantinuum.com - sign up for a free account with monthly credits
  2. Microsoft Azure Quantum: H-series targets available in the Azure Quantum portal via quantinuum.hqs-lt-s2-apival (emulator) and quantinuum.hqs-lt-s2-sim (H2 emulator)

Installation

pip install pytket pytket-quantinuum

For Azure Quantum access:

pip install pytket-quantinuum azure-quantum

Verify installation:

from pytket.extensions.quantinuum import QuantinuumBackend
print("pytket-quantinuum ready")

Connecting to the Backend

from pytket.extensions.quantinuum import QuantinuumBackend

# List available backends (emulators + real hardware)
backends = QuantinuumBackend.available_devices()
for b in backends:
    print(b.device_name)

Available device names include:

  • H1-1E - H1 emulator (fast, free in API tier)
  • H2-1E - H2 emulator (matches H2 noise characteristics)
  • H1-1 - H1 real hardware
  • H2-1 - H2 real hardware (56 qubits, best fidelity)
# Connect to the H2 emulator for testing
backend = QuantinuumBackend(device_name="H2-1E")

# Authenticate (opens browser login or reads saved credentials)
backend.login()

Your First H-Series Circuit

Because there is no coupling map, circuit design is simpler than for superconducting hardware. Build the circuit directly in pytket:

from pytket import Circuit
from pytket.extensions.quantinuum import QuantinuumBackend

# A 5-qubit GHZ state: entangle all qubits without any SWAP overhead
c = Circuit(5, 5)
c.H(0)
c.CX(0, 1)
c.CX(0, 2)
c.CX(0, 3)
c.CX(0, 4)
c.measure_all()

# Compile for H-series
backend = QuantinuumBackend(device_name="H2-1E")
backend.login()

compiled = backend.get_compiled_circuit(c, optimisation_level=2)
print(f"Gate count after compilation: {compiled.n_gates}")
print(f"Two-qubit gate count: {compiled.n_gates_of_type(OpType.ZZMax)}")

H-series native two-qubit gate is ZZMax (maximally entangling ZZ gate, equivalent to a CX up to single-qubit rotations). The compiler automatically converts your CX gates to this native form.

Submitting and Retrieving Results

from pytket.extensions.quantinuum import QuantinuumBackend

backend = QuantinuumBackend(device_name="H2-1E")
backend.login()

c = Circuit(5, 5)
c.H(0)
for i in range(1, 5):
    c.CX(0, i)
c.measure_all()

compiled = backend.get_compiled_circuit(c, optimisation_level=2)

# Submit job (emulator runs immediately; real hardware queues)
handle = backend.process_circuit(compiled, n_shots=1000)

# Wait for results (for emulator, usually seconds)
result = backend.get_result(handle)
counts = result.get_counts()
print(counts)
# Expected: mostly {'00000': ~500, '11111': ~500}

Exploiting Mid-Circuit Measurement

Mid-circuit measurement is a distinctive H-series feature. This example implements a simple error detection scheme: encode a logical qubit in 3 physical qubits, measure syndrome qubits without disturbing the data, and branch on the result.

from pytket import Circuit, Bit
from pytket.circuit import if_using_condition, Conditional

def repetition_code_with_syndrome_readout() -> Circuit:
    """
    3-qubit repetition code with mid-circuit syndrome measurement.
    Qubits 0, 1, 2: data + redundant copies.
    Bits 0, 1: syndrome measurement results.
    Bit 2: final logical measurement.
    """
    c = Circuit(3, 3)
    
    # Encode: spread state of qubit 0 across 0, 1, 2
    c.CX(0, 1)
    c.CX(0, 2)
    
    # -- Syndrome measurement (mid-circuit) --
    # Measure parity of qubits 0 and 1 into bit 0
    # Using ancilla-free syndrome via direct parity check
    c.CX(0, 1)
    c.Measure(1, 0)   # bit 0 = parity check
    c.Reset(1)        # reset and reuse qubit 1
    c.CX(0, 1)        # restore qubit 1 to encoded state
    
    # Measure parity of qubits 0 and 2 into bit 1
    c.CX(0, 2)
    c.Measure(2, 1)   # bit 1 = parity check
    c.Reset(2)
    c.CX(0, 2)
    
    # Correct based on syndrome (simplified: flip qubit 1 if parity mismatch)
    c.X(1).conditional(Bit(0), 1)  # if syndrome bit 0 = 1, apply correction
    
    # Final measurement
    c.Measure(0, 2)
    
    return c

Note: Mid-circuit measurement requires the pytket-quantinuum extension and real H-series hardware or the H-series emulator. Qiskit Aer and most other simulators do not support feed-forward conditional gates natively.

Understanding the H-Series Native Gate Set

H-series natively supports:

GateDescriptionNotes
U1qArbitrary single-qubit rotationParameterized by spherical angles
ZZMaxMaximally entangling ZZ gateNative two-qubit gate
ZZPhase(theta)Partial ZZ rotationMore efficient for small angles
MeasureMid-circuit or final measurementCan feed-forward
ResetReset qubit to |0>Enables qubit reuse

All CX, CZ, SWAP, Toffoli, and other gates compile into combinations of these. The key insight: since there is no SWAP overhead, the two-qubit gate count of your compiled circuit is determined almost entirely by the logical two-qubit gate count of your algorithm.

All-to-All Connectivity: Practical Impact

On a 5-qubit superconducting device with linear connectivity, implementing a circuit with long-range interactions requires many SWAP gates:

# On superconducting (linear coupling: 0-1-2-3-4):
# A CX gate between qubit 0 and qubit 4 needs 3 SWAPs first
# Each SWAP = 3 CX gates -> 9 extra two-qubit gates for one long-range gate

# On H-series:
# A ZZMax between qubit 0 and qubit 4 costs exactly 1 two-qubit gate
# No overhead, regardless of qubit distance

This means H-series is particularly efficient for:

  • All-to-all QAOA circuits (each problem clause may connect non-adjacent qubits)
  • Quantum Fourier Transform (QFT has long-range connections that are expensive on superconducting hardware)
  • Quantum phase estimation (uses QFT as a subroutine)
  • Simulation of all-to-all coupled spin systems

For algorithms with only nearest-neighbor interactions (like 1D Trotter steps), the advantage is smaller.

Checking Hardware Cost Before Submitting

Quantinuum charges in HQC (Quantinuum Quantum Credits). Estimate the cost before submitting to real hardware:

from pytket.extensions.quantinuum import QuantinuumBackend
from pytket import Circuit

backend = QuantinuumBackend(device_name="H2-1E")
backend.login()

c = Circuit(10)
c.H(0)
for i in range(1, 10):
    c.CX(0, i)
c.measure_all()

compiled = backend.get_compiled_circuit(c, optimisation_level=2)

# Get cost estimate (in HQC) before submitting
cost = backend.cost(compiled, n_shots=100, syntax_checker="H2-1SC")
print(f"Estimated cost: {cost} HQC")
# A single H1 shot costs ~1-2 HQC depending on circuit complexity

Use the syntax checker (H2-1SC) to validate the compiled circuit and get cost estimates without consuming hardware shots.

When to Use H-Series vs Superconducting Hardware

CriterionH-SeriesSuperconducting
Circuit with long-range 2Q gatesMuch betterNeeds many SWAPs
Shallow circuit, high qubit countLimited (56 qubits max)Better (1000+ qubits)
Mid-circuit measurementNative, fastLimited support
Pure NISQ experimentsHigh fidelityFaster clock speeds
Fault-tolerant logical qubitsStrong candidateStrong candidate
Cost per shotHigher HQCIBM free tier available

H-series shines for circuits that would require many SWAP gates on superconducting hardware, algorithms that need mid-circuit measurement for error correction or adaptive protocols, and any experiment where achieving the highest possible fidelity matters more than maximizing qubit count.

Was this tutorial helpful?