Dynamic Qubit Allocation

Quantinuum Helios has 98 \(_{137}\)Ba\(^{+}\) ions and leverages a built-in mechanism within its runtime to improve qubit utilization. This feature does not exist on System Model H2.

The memory/ cache region contains all 98 qubits. 16 ions are transported into the logic area from the memory/ cache area. These ions are allocated and deallocated by the Helios runtime during program execution. The user program generated in Guppy can request “virtual qubits”, i.e. qubit(). However, physical ions allocated by the Helios runtime to act as a virtual qubit are not controlled by the user. The runtime receives a request from a user program for qubit allocation. The runtime can allocate a new qubit from the memory/ cache region, or reallocate an existing ion from the other regions. Dynamic qubit allocation ensures automated management of qubit resources in a constrainted system. As a consequence, ions can be reused without the user explicitly requesting a Mid-circuit Measurement & Reset (MCMR) operation. All ions are identical which allows this mechanism for improved resource utilization.

Each virtual qubit requested by the user program correponds to a physical ion. This is a usually a non-preserving map during program execution. For example implicit MCMR will modify the virtual qubit to ion correspondence. However, this mapping can be preserved with the unified MCMR operation (measure_and_reset), which ensures the virtual qubit to physical ion mapping is equivalent pre- and post-MCMR.

The runtime allocates a qubit once guppylang.std.quantum.qubit is called or once guppylang.std.qsystem.measure_and_reset() is called by the user program.

Initialization

The program will allocate \(N\) ions upon the request for \(N\) qubits from the user program. The user can specify the number of qubits to initialize, but cannot request specific ions for allocation. The Helios runtime will access ions from the memory/ cache region via junction transport prior to initialization in the logic region.

from guppylang import guppy
from guppylang.std.builtins import array, comptime
from guppylang.std.quantum import qubit

N = 10

@guppy
def main() -> None:
    q_array = array(qubit() for _ in range(comptime(N)))

Implicit Qubit Reuse

A user program can request qubits during hardware execution. The ion corresponding to this qubit can either be a new ion allocated from the memory/ cache region or an existing ion from the logic region. This behaviour is only possible with Guppy and Helios.

For multiple independent requests for qubits, the system can implicitly reuse ions. If each subsequent request for a new qubit is preceeded by a measure request for the previously requested qubit, then the Helios runtime will reuse the same ion. The physical ion will correspond to different virtual qubits during the program execution, as shown in the table below.

Physical Ion

Virtual Qubit

A

0

A

1

A

2

A

3

from guppylang import guppy
from guppylang.std.builtins import result
from guppylang.std.quantum import qubit, measure

@guppy
def request_ancilla() -> None:
    q = qubit()
    # do something
    b = measure(q)
    result("measurement", b)

@guppy
def main() -> None:
    request_ancilla()
    # do computation
    request_ancilla()
    # do more computation
    # ...

Explicit MCMR

If MCMR is performed using the unified operation, then the physical ion to virtual qubit correspondence is a preserving map, as show in the table below.

Physical Ion

Virtual Qubit

Pre-MCMR

A

0

Post-MCMR

A

0

from guppylang import guppy
from guppylang.std.builtins import result
from guppylang.std.quantum import qubit, h
from guppylang.std.qsystem import measure_and_reset


@guppy
def main() -> None:
    q = qubit()
    h(q)
    b = measure_and_reset(q)
    result("measurements", b)
    h(q)
    # more computation