Solvers
DecomposeQuboSolver(instance, config, solver_factory)
Bases: BaseSolver
Solver that leverages qubo decomposition techniques to solve subproblems and merge subsolutions to propose solutions of the original instance. Note, the QUBO instance is seen as a graph where variables are vertices, and coefficients represents weighted edges.
Scope: the decomposition only accepts qubo with positive coefficients off-diagonal coefficients.
Algorithm
- Initialize global solution and vertices to place.
- While we can apply decomposition:
- Select a random vertex to place using device layout.
- Apply a geometric search to obtain a set of vertices that can be placed on a device to form a subproblem.
- Solve the subproblem with a solver.
- Update the global solution and the vertices left to place.
- For remaining variables, we solve classically.
Note, only one bitstring solution is returned.
Initialize the DecomposeQuboSolver with the given problem and configuration.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The QUBO problem to solve.
TYPE:
|
config
|
Solver settings including backend and device.
TYPE:
|
solver_factory
|
solver class for subproblems.
TYPE:
|
Source code in qubosolver/solver.py
solve()
Execute a solver by decomposing the instance. Note, the QUBO instance is seen as a graph where variables are vertices, and coefficients represents weighted edges.
Algorithm
- Initialize global solution and vertices to place.
- While we can apply decomposition:
- Select a random vertex to place using device layout.
- Apply a geometric search to obtain a set of vertices that can be placed on a device to form a subproblem.
- Solve the subproblem with a solver.
- Update the global solution and the vertices left to place.
- For remaining variables, we solve classically.
| RETURNS | DESCRIPTION |
|---|---|
QUBOSolution
|
Final result after execution and postprocessing. Note, only one bitstring solution is returned.
TYPE:
|
Source code in qubosolver/solver.py
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 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | |
QuboSolver(instance, config=None)
Bases: BaseSolver
Dispatcher that selects the appropriate solver (quantum or classical) based on the SolverConfig and delegates execution to it.
Source code in qubosolver/solver.py
QuboSolverClassical(instance, config=None)
Bases: BaseSolver
Classical solver for QUBO problems. This implementation delegates the classical solving task to the external classical solver module (e.g., CPLEX, D-Wave SA, or D-Wave Tabu), as selected via the SolverConfig.
After obtaining the raw solution, postprocessing (e.g., bit-flip local search) is applied.
Source code in qubosolver/solver.py
QuboSolverQuantum(instance, config=None)
Bases: BaseSolver
Quantum solver that orchestrates the solving of a QUBO problem using embedding, drive shaping, and quantum execution pipelines.
Note: Negative off-diagonal coefficients are not supported.
Initialize the QuboSolver with the given problem and configuration.
| PARAMETER | DESCRIPTION |
|---|---|
instance
|
The QUBO problem to solve.
TYPE:
|
config
|
Solver settings including backend and device.
TYPE:
|
Source code in qubosolver/solver.py
drive(embedding)
Generate the drive sequence based on the given embedding.
| PARAMETER | DESCRIPTION |
|---|---|
embedding
|
The embedded register layout.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple
|
A tuple of - Drive: Drive schedule for quantum execution. - QUBOSolution: Initial solution of generated from drive shaper
TYPE:
|
Source code in qubosolver/solver.py
embedding()
Generate a physical embedding (register) for the QUBO variables.
| RETURNS | DESCRIPTION |
|---|---|
Register
|
Atom layout suitable for quantum hardware.
TYPE:
|
Source code in qubosolver/solver.py
solve()
Execute the full quantum pipeline: preprocess, embed, drive, execute, postprocess.
| RETURNS | DESCRIPTION |
|---|---|
QUBOSolution
|
Final result after execution and postprocessing.
TYPE:
|