Skip to content

Results are limited to QUBO Solver v0.9.1

Product news
You are reading QUBO Solver v0.9.1, an older version of this documentation. Go to the latest version (v0.10.0)

Local-Energy-Scale Drive

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.


For a QUBO matrix QQ, the target detuning associated with variable ii is

di=āˆ’Qii2. d_i = -\frac{Q_{ii}}{2}.

These values are taken directly from the matrix received by the drive shaper.


The DMM is used only when:

  • dmm=True;
  • the selected device exposes a DMM detuning range;
  • the target detunings are not all equal.

Let

dmin⁔=min⁔idi,dmax⁔=max⁔idi,Ī”d=dmaxā”āˆ’dmin⁔. d_{\min}=\min_i d_i, \qquad d_{\max}=\max_i d_i, \qquad \Delta d=d_{\max}-d_{\min}.

When Ī”d>10āˆ’15\Delta d>10^{-15}, the code sets

Ī“g(T)=dmax⁔, \delta_g(T)=d_{\max}, Ī“dmm(T)=āˆ’Ī”d, \delta_{\mathrm{dmm}}(T)=-\Delta d,

and

wi=dmaxā”āˆ’diĪ”d. w_i= \frac{d_{\max}-d_i}{\Delta d}.

The weights are clipped to [0,1][0,1]. The resulting local final detuning is

Γi(T)=Γg(T)+Γdmm(T)wi. \delta_i(T) = \delta_g(T) + \delta_{\mathrm{dmm}}(T)w_i.

With the unscaled target detunings, this gives

Γi(T)=di. \delta_i(T)=d_i.

If DMM is not used, the code applies one global final detuning:

Ī“g(T)=1Nāˆ‘i=1Ndi. \delta_g(T) = \frac{1}{N} \sum_{i=1}^{N}d_i.

In that case,

Γi(T)=Γg(T) \delta_i(T)=\delta_g(T)

for every qubit.


Let VijV_{ij} denote the interaction value returned by

register.interactions()

for qubits ii and jj.

For each qubit, the code accumulates

Ii=āˆ‘j≠i∣Vij∣. I_i = \sum_{j\neq i}|V_{ij}|.

The local energy scale is

Ei=∣Γi(T)∣+Ii. E_i = |\delta_i(T)| + I_i.

The mean local energy scale is

E‾=1Nāˆ‘i=1NEi. \overline{E} = \frac{1}{N} \sum_{i=1}^{N}E_i.

The raw peak Rabi frequency is

Ī©max⁔raw=ĪŗE‾. \Omega_{\max}^{\mathrm{raw}} = \kappa\overline{E}.

The default value is

local_energy_scale_kappa = 0.25

The code obtains the maximum compilable amplitude for the selected device and register through max_virtual_amplitude(...).

If

Ωmax⁔raw>Ωmax⁔device, \Omega_{\max}^{\mathrm{raw}} > \Omega_{\max}^{\mathrm{device}},

the amplitude is clamped:

Ωmax⁔=Ωmax⁔device. \Omega_{\max} = \Omega_{\max}^{\mathrm{device}}.

Otherwise,

Ωmax⁔=Ωmax⁔raw. \Omega_{\max} = \Omega_{\max}^{\mathrm{raw}}.

A warning is emitted when clamping occurs.

The code defines the allowed detuning magnitude as

dallowed=ρ Ωmax⁔(1āˆ’10āˆ’3), d_{\mathrm{allowed}} = \rho\,\Omega_{\max}(1-10^{-3}),

where ρ\rho is returned by detuning_amplitude_ratio(device).

If

max⁔i∣di∣>dallowed, \max_i |d_i| > d_{\mathrm{allowed}},

all target detunings are multiplied by

dallowedmax⁔i∣di∣. \frac{d_{\mathrm{allowed}}} {\max_i |d_i|}.

The global detuning and DMM encoding are then recomputed from the scaled target detunings.

The local energy scale and Ωmax⁔\Omega_{\max} are not recomputed after this detuning rescaling.


The sequence duration is

device.specs["max_duration"] or 1000.0

The amplitude waveform is

[ε,Ī©max⁔,Ī©max⁔,ε],ε=10āˆ’9. \left[ \varepsilon, \Omega_{\max}, \Omega_{\max}, \varepsilon \right], \qquad \varepsilon=10^{-9}.

The initial detuning is

Ī“0=āˆ’max⁔i∣di∣, \delta_0 = -\max_i |d_i|,

using the possibly rescaled target detunings.

The global detuning waveform is

[Γ0,Γ0,Γg(T),Γg(T)]. \left[ \delta_0, \delta_0, \delta_g(T), \delta_g(T) \right].

Both waveforms are created with qoolqit.InterpolatedWaveform.

When DMM is active, the weighted detuning waveform is created with constant_weighted_dmm(...).


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

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)