From 3f0292b59ef43ea817d88bd299a4e3bec021266c Mon Sep 17 00:00:00 2001 From: Mathias Soeken Date: Fri, 22 May 2026 12:11:11 +0000 Subject: [PATCH 1/4] Update T gate time in neutral atoms. --- source/qdk_package/qdk/qre/models/qubits/_neutral_atoms.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/qdk_package/qdk/qre/models/qubits/_neutral_atoms.py b/source/qdk_package/qdk/qre/models/qubits/_neutral_atoms.py index db60ce216e..706694ae98 100644 --- a/source/qdk_package/qdk/qre/models/qubits/_neutral_atoms.py +++ b/source/qdk_package/qdk/qre/models/qubits/_neutral_atoms.py @@ -121,7 +121,11 @@ def provided_isa(self, ctx: ISAContext) -> ISA: T, encoding=Encoding.PHYSICAL, arity=1, - time=0, + # NOTE: We assume a time of 0, however, some transforms may use + # the time in arithmetic expressions, which require its value to + # be non-zero. Setting it to 1 leads to no or at most + # negligible contributions to the overall resource estimates. + time=1, error_rate=0.00001, ), ctx.add_instruction( From 2fb27a66d72ea2892714c711c6f6538e8647f361 Mon Sep 17 00:00:00 2001 From: Mathias Soeken Date: Fri, 22 May 2026 12:11:38 +0000 Subject: [PATCH 2/4] Make measurement time configurable in Majorana qubits. --- .../qdk/qre/models/qubits/_msft.py | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/source/qdk_package/qdk/qre/models/qubits/_msft.py b/source/qdk_package/qdk/qre/models/qubits/_msft.py index 1d74300e3e..c0a4a4e08e 100644 --- a/source/qdk_package/qdk/qre/models/qubits/_msft.py +++ b/source/qdk_package/qdk/qre/models/qubits/_msft.py @@ -20,15 +20,22 @@ class Majorana(Architecture): """ This class models physical instructions that may be relevant for future - Majorana qubits. For these qubits, we assume that measurements - and the physical T gate each take 1 µs. Owing to topological protection in - the hardware, we assume single and two-qubit measurement error rates - (Clifford error rates) in $10^{-4}$, $10^{-5}$, and $10^{-6}$ as a range - between realistic and optimistic targets. Non-Clifford operations in this + Majorana qubits. For these qubits, we assume that measurements and the + physical T gate each take 1 µs. Owing to topological protection in the + hardware, we assume single and two-qubit measurement error rates (Clifford + error rates) in $10^{-4}$, $10^{-5}$, and $10^{-6}$ as a range between + realistic and optimistic targets. Non-Clifford operations in this architecture do not have topological protection, so we assume a 5%, 1.5%, and 1% error rate for non-Clifford physical T gates for the three cases, respectively. + Attributes: + error_rate: The error rate for physical Clifford operations (state + preparation and measurement). Defaults to 1e-5, with a domain of + [1e-4, 1e-5, 1e-6] for use in design space exploration. + time: The time (in ns) for physical Clifford operations and the T gate. + Defaults to 1000 ns (1 µs). + References: - Torsten Karzig, Christina Knapp, Roman M. Lutchyn, Parsa Bonderson, @@ -46,6 +53,7 @@ class Majorana(Architecture): _: KW_ONLY error_rate: float = field(default=1e-5, metadata={"domain": [1e-4, 1e-5, 1e-6]}) + time: int = 1_000 def provided_isa(self, ctx: ISAContext) -> ISA: if abs(self.error_rate - 1e-4) <= 1e-8: @@ -56,15 +64,15 @@ def provided_isa(self, ctx: ISAContext) -> ISA: t_error_rate = 0.01 return ctx.make_isa( - ctx.add_instruction(PREP_X, time=1000, error_rate=self.error_rate), - ctx.add_instruction(PREP_Z, time=1000, error_rate=self.error_rate), + ctx.add_instruction(PREP_X, time=self.time, error_rate=self.error_rate), + ctx.add_instruction(PREP_Z, time=self.time, error_rate=self.error_rate), ctx.add_instruction( - MEAS_XX, arity=2, time=1000, error_rate=self.error_rate + MEAS_XX, arity=2, time=self.time, error_rate=self.error_rate ), ctx.add_instruction( - MEAS_ZZ, arity=2, time=1000, error_rate=self.error_rate + MEAS_ZZ, arity=2, time=self.time, error_rate=self.error_rate ), - ctx.add_instruction(MEAS_X, time=1000, error_rate=self.error_rate), - ctx.add_instruction(MEAS_Z, time=1000, error_rate=self.error_rate), - ctx.add_instruction(T, time=1000, error_rate=t_error_rate), + ctx.add_instruction(MEAS_X, time=self.time, error_rate=self.error_rate), + ctx.add_instruction(MEAS_Z, time=self.time, error_rate=self.error_rate), + ctx.add_instruction(T, time=self.time, error_rate=t_error_rate), ) From 4304b5cf956f1961cbd906115c9560bf58a18b69 Mon Sep 17 00:00:00 2001 From: Mathias Soeken Date: Tue, 26 May 2026 18:13:45 +0000 Subject: [PATCH 3/4] Allow to override t_error_rate. --- .../qdk/qre/models/qubits/_msft.py | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/source/qdk_package/qdk/qre/models/qubits/_msft.py b/source/qdk_package/qdk/qre/models/qubits/_msft.py index c0a4a4e08e..0266f5484d 100644 --- a/source/qdk_package/qdk/qre/models/qubits/_msft.py +++ b/source/qdk_package/qdk/qre/models/qubits/_msft.py @@ -2,6 +2,7 @@ # Licensed under the MIT License. from dataclasses import KW_ONLY, dataclass, field +from typing import cast, Optional from ..._architecture import Architecture, ISAContext from ...instruction_ids import ( @@ -54,15 +55,22 @@ class Majorana(Architecture): _: KW_ONLY error_rate: float = field(default=1e-5, metadata={"domain": [1e-4, 1e-5, 1e-6]}) time: int = 1_000 + t_error_rate: Optional[float] = None - def provided_isa(self, ctx: ISAContext) -> ISA: - if abs(self.error_rate - 1e-4) <= 1e-8: - t_error_rate = 0.05 - elif abs(self.error_rate - 1e-5) <= 1e-8: - t_error_rate = 0.015 - elif abs(self.error_rate - 1e-6) <= 1e-8: - t_error_rate = 0.01 + def __post_init__(self) -> None: + if self.t_error_rate is None: + if abs(self.error_rate - 1e-4) <= 1e-8: + self.t_error_rate = 0.05 + elif abs(self.error_rate - 1e-5) <= 1e-8: + self.t_error_rate = 0.015 + elif abs(self.error_rate - 1e-6) <= 1e-8: + self.t_error_rate = 0.01 + else: + raise ValueError( + "Invalid error_rate value. Must be one of [1e-4, 1e-5, 1e-6]." + ) + def provided_isa(self, ctx: ISAContext) -> ISA: return ctx.make_isa( ctx.add_instruction(PREP_X, time=self.time, error_rate=self.error_rate), ctx.add_instruction(PREP_Z, time=self.time, error_rate=self.error_rate), @@ -74,5 +82,9 @@ def provided_isa(self, ctx: ISAContext) -> ISA: ), ctx.add_instruction(MEAS_X, time=self.time, error_rate=self.error_rate), ctx.add_instruction(MEAS_Z, time=self.time, error_rate=self.error_rate), - ctx.add_instruction(T, time=self.time, error_rate=t_error_rate), + # NOTE From __post_init__, t_error_rate is guaranteed to be non-None + # if error_rate is valid, so we can safely cast it to float here. + ctx.add_instruction( + T, time=self.time, error_rate=cast(float, self.t_error_rate) + ), ) From 03893f44e26f8bfaf7c2c22932004716eb449090 Mon Sep 17 00:00:00 2001 From: Mathias Soeken Date: Wed, 27 May 2026 16:11:23 +0000 Subject: [PATCH 4/4] Added properties. --- source/qdk_package/qdk/qre/property_keys.pyi | 5 +++-- source/qdk_package/src/qre.rs | 5 +++-- source/qre/src/isa/property_keys.rs | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/source/qdk_package/qdk/qre/property_keys.pyi b/source/qdk_package/qdk/qre/property_keys.pyi index ae1f8f32ea..e9df7d84a4 100644 --- a/source/qdk_package/qdk/qre/property_keys.pyi +++ b/source/qdk_package/qdk/qre/property_keys.pyi @@ -5,8 +5,6 @@ DISTANCE: int SURFACE_CODE_ONE_QUBIT_TIME_FACTOR: int SURFACE_CODE_TWO_QUBIT_TIME_FACTOR: int ACCELERATION: int -ATOM_SPACING: int -VELOCITY: int NUM_TS_PER_ROTATION: int EXPECTED_SHOTS: int RUNTIME_SINGLE_SHOT: int @@ -23,6 +21,9 @@ NAME: int LOSS: int LOGICAL_CYCLE_TIME: int CODE_CYCLE_TIME: int +ATOM_SPACING: int +VELOCITY: int ASSUMPTIONS: int FEASIBILITY: int TARGET_YEAR: int +BLOCK_SIZE: int diff --git a/source/qdk_package/src/qre.rs b/source/qdk_package/src/qre.rs index 64b4ad743e..170c539de0 100644 --- a/source/qdk_package/src/qre.rs +++ b/source/qdk_package/src/qre.rs @@ -1623,8 +1623,6 @@ fn add_property_keys(m: &Bound<'_, PyModule>) -> PyResult<()> { SURFACE_CODE_ONE_QUBIT_TIME_FACTOR, SURFACE_CODE_TWO_QUBIT_TIME_FACTOR, ACCELERATION, - ATOM_SPACING, - VELOCITY, NUM_TS_PER_ROTATION, EXPECTED_SHOTS, RUNTIME_SINGLE_SHOT, @@ -1641,9 +1639,12 @@ fn add_property_keys(m: &Bound<'_, PyModule>) -> PyResult<()> { LOSS, LOGICAL_CYCLE_TIME, CODE_CYCLE_TIME, + ATOM_SPACING, + VELOCITY, ASSUMPTIONS, FEASIBILITY, TARGET_YEAR, + BLOCK_SIZE, ); m.add_submodule(&property_keys)?; diff --git a/source/qre/src/isa/property_keys.rs b/source/qre/src/isa/property_keys.rs index 98b5bde15a..5c9fb56e95 100644 --- a/source/qre/src/isa/property_keys.rs +++ b/source/qre/src/isa/property_keys.rs @@ -50,8 +50,6 @@ define_properties! { SURFACE_CODE_ONE_QUBIT_TIME_FACTOR, SURFACE_CODE_TWO_QUBIT_TIME_FACTOR, ACCELERATION, - ATOM_SPACING, - VELOCITY, NUM_TS_PER_ROTATION, RUNTIME_SINGLE_SHOT, EXPECTED_SHOTS, @@ -68,7 +66,10 @@ define_properties! { LOSS, LOGICAL_CYCLE_TIME, CODE_CYCLE_TIME, + ATOM_SPACING, + VELOCITY, ASSUMPTIONS, FEASIBILITY, TARGET_YEAR, + BLOCK_SIZE, }