qubosolver.solving.hybrid
qubosolver.solving.hybrid
Hybrid quantum-classical solvers combining Pasqal devices with classical optimization.
Modules:
-
drive_bayesian_searchβHybrid quantum-classical QUBO solver using Bayesian optimization of drive schedules.
drive_bayesian_search
Hybrid quantum-classical QUBO solver using Bayesian optimization of drive schedules.
Runs a Bayesian search (via
skopt.gp_minimize)
over analog drive waveform parameters, executing a quantum simulation at each evaluation
and minimizing a configurable objective of the resulting solution. Can
be used as a standalone hybrid solving algorithm, or as a drive-shaping
method to produce a tuned qoolqit.Drive for another solver.
Classes:
-
ConfigβConfiguration for the Bayesian-optimization hybrid solver / drive shaper.
Functions:
-
solveβSolve a QUBO instance via Bayesian optimization of a drive schedule.
Config
dataclass
Config(initial_amplitude_knots: list[float] = (lambda: [0.5, 0.9, 0.5])(), initial_detuning_knots: list[float] = (lambda: [-0.8, 0.0, 0.8])(), n_evaluations: int = 20, seed: int | None = None, objective_fn: Callable[[Solution], float] = _default_objective, default_sequence_duration: int = 50000)
Configuration for the Bayesian-optimization hybrid solver / drive shaper.
Attributes:
-
initial_amplitude_knots(list[float]) βInitial guess for the amplitude waveform's three interior knots, each normalized in
[0, 1]. -
initial_detuning_knots(list[float]) βInitial guess for the detuning waveform's three knots, each normalized in
[-1, 1]. -
n_evaluations(int) βNumber of Bayesian optimization evaluations.
-
seed(int | None) βRandom seed for reproducibility.
-
objective_fn(Callable[[Solution], float]) βFunction to minimize: takes a
Solutionand returns a number. Defaults to the minimum cost among the sampled bitstrings; override to minimize something else, e.g. the average cost. -
default_sequence_duration(int) βFallback maximum sequence duration (ns) injected when the target device has no
max_durationcap.
solve
solve(instance: Instance, register: qoolqit.Register, *, backend: protocols.Backend, device: qoolqit.Device, dmm: bool = True, config: Config | None = None) -> tuple[Solution, qoolqit.Drive]
Solve a QUBO instance via Bayesian optimization of a drive schedule.
Uses skopt.gp_minimize
to search over waveform parameters, running a
quantum simulation at each evaluation and minimizing config.objective_fn
of the resulting Solution. This is a hybrid quantum-classical solving
algorithm in its own right, and its returned drive can also be reused as
the output of a drive-shaping step for another solver.
Parameters:
-
instance(Instance) βThe QUBO
Instanceto solve. -
register(qoolqit.Register) βThe physical atom register.
-
backend(protocols.Backend) βExecution backend for running simulations during optimization.
-
device(qoolqit.Device) βTarget quantum device.
-
dmm(bool, default:True) βWhether to use the Detuning Map Modulator.
-
config(Config | None, default:None) βOptimization parameters, including the initial waveform knots, number of evaluations, and objective function.
Returns:
-
tuple[Solution, qoolqit.Drive]βA tuple of the best
qoolqit.Drivefound and the correspondingSolution.
Source code in qubosolver/solving/hybrid/drive_bayesian_search.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | |