Local-Energy-Scale Drive
Local-Energy-Scale Drive Shaper
LocalEnergyScaleDriveShaper generates a fixed analog drive from:
- the diagonal of the QUBO matrix;
- the interactions returned by the embedded register;
- a scaling parameter \(\kappa\).
It does not run a pulse-parameter optimization loop.
The shaper returns the generated Drive and an empty Solution. Samples and
QUBO costs are produced when the drive is executed.
Target Detunings
For a QUBO matrix \(Q\), the target detuning associated with variable \(i\) is
These values are taken directly from the matrix received by the drive shaper.
DMM Encoding
The DMM is used only when:
dmm=True;- the selected device exposes a DMM detuning range;
- the target detunings are not all equal.
Let
When \(\Delta d>10^{-15}\), the code sets
and
The weights are clipped to \([0,1]\). The resulting local final detuning is
With the unscaled target detunings, this gives
If DMM is not used, the code applies one global final detuning:
In that case,
for every qubit.
Local Energy Scale
Let \(V_{ij}\) denote the interaction value returned by
for qubits \(i\) and \(j\).
For each qubit, the code accumulates
The local energy scale is
The mean local energy scale is
The raw peak Rabi frequency is
The default value is
Hardware Adjustments
Amplitude
The code obtains the maximum compilable amplitude for the selected device and
register through max_virtual_amplitude(...).
If
the amplitude is clamped:
Otherwise,
A warning is emitted when clamping occurs.
Detunings
The code defines the allowed detuning magnitude as
where \(\rho\) is returned by detuning_amplitude_ratio(device).
If
all target detunings are multiplied by
The global detuning and DMM encoding are then recomputed from the scaled target detunings.
The local energy scale and \(\Omega_{\max}\) are not recomputed after this detuning rescaling.
Waveforms
The sequence duration is
The amplitude waveform is
The initial detuning is
using the possibly rescaled target detunings.
The global detuning waveform is
Both waveforms are created with qoolqit.InterpolatedWaveform.
When DMM is active, the weighted detuning waveform is created with
constant_weighted_dmm(...).
Configuration
| Field | Type | Description |
|---|---|---|
drive_shaping_method |
DriveType \| str |
DriveType.LOCAL_ENERGY_SCALE or "local_energy_scale" |
dmm |
bool |
Requests DMM encoding when supported by the device |
local_energy_scale_kappa |
float |
Multiplies the mean local energy scale; default: 0.25 |
Example
from qubosolver import (
DriveShapingConfig,
DriveType,
Instance,
Solver,
SolverConfig,
matrix,
)
qubo = matrix.tensor(
[
[-6.0, 2.0, 2.0, 2.0],
[2.0, -7.5, 2.0, 2.0],
[2.0, 2.0, -7.5, 2.0],
[2.0, 2.0, 2.0, -7.0],
]
)
instance = Instance(matrix=qubo)
config = SolverConfig(
use_quantum=True,
drive_shaping=DriveShapingConfig(
drive_shaping_method=DriveType.LOCAL_ENERGY_SCALE,
dmm=True,
local_energy_scale_kappa=0.25,
),
)
solver = Solver(instance, config)
solution = solver.solve()
print(solution)