From f05d4abb46e7248bceb1d76138617df5febb55f7 Mon Sep 17 00:00:00 2001 From: Phillip Weinberg Date: Mon, 29 Jan 2024 15:29:08 -0500 Subject: [PATCH] adding check to make sure AHS is compiled with local detuning capabilities. (#893) --- src/bloqade/compiler/passes/hardware/define.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/bloqade/compiler/passes/hardware/define.py b/src/bloqade/compiler/passes/hardware/define.py index c7fbcacfc..b17898749 100644 --- a/src/bloqade/compiler/passes/hardware/define.py +++ b/src/bloqade/compiler/passes/hardware/define.py @@ -230,6 +230,12 @@ def generate_ahs_code( extra_sm = set(level_couplings[sequence.rydberg][pulse.detuning]) - {field.Uniform} if extra_sm: + if capabilities is not None and capabilities.capabilities.rydberg.local is None: + raise ValueError( + "Device does not support local detuning, but the program has a " + "non-uniform spatial modulation for detuning." + ) + sm = extra_sm.pop() lattice_site_coefficients = GenerateLatticeSiteCoefficients(