• This repository has been archived on 26/Jan/2023
  • Stars
    star
    912
  • Rank 50,077 (Top 1.0 %)
  • Language q
  • License
    Apache License 2.0
  • Created almost 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Qbsolv,a decomposing solver, finds a minimum value of a large quadratic unconstrained binary optimization (QUBO) problem by splitting it into pieces solved either via a D-Wave system or a classical tabu solver. (Note that qbsolv by default uses its internal classical solver. Access to a D-Wave system must be arranged separately.)
https://travis-ci.org/dwavesystems/qbsolv.svg?branch=master https://ci.appveyor.com/api/projects/status/y2f7rqxvepn4ak4b/branch/master?svg=true https://readthedocs.com/projects/d-wave-systems-qbsolv/badge/?version=latest https://circleci.com/gh/dwavesystems/qbsolv.svg?style=svg

Qbsolv

NOTICE: This repository is deprecated as of the end of 2021. Support will be discontinued after March 2022. Please update your code to use Ocean's dwave-hybrid or Leap's quantum-classical hybrid solvers instead.

A decomposing solver that finds a minimum value of a large quadratic unconstrained binary optimization (QUBO) problem by splitting it into pieces. The pieces are solved using a classical solver running the tabu algorithm. qbsolv also enables configuring a D-Wave system as the solver.

Note

Access to a D-Wave system must be arranged separately.

Installation or Building

Python

A wheel might be available for your system on PyPI. Source distributions are provided as well.

pip install dwave-qbsolv

Alternatively, you can build the library with setuptools.

pip install -r python/requirements.txt
python setup.py install

C

To build the C library use cmake to generate a build command for your system. On Linux the commands would be something like this:

mkdir build; cd build
cmake ..
make

To build the command line interface turn the cmake option QBSOLV_BUILD_CMD on. The command line option for cmake to do this would be -DQBSOLV_BUILD_CMD=ON. To build the tests turn the cmake option QBSOLV_BUILD_TESTS on. The command line option for cmake to do this would be -DQBSOLV_BUILD_TESTS=ON.

Command Line Usage

qbsolv -i infile [-o outfile] [-m] [-T] [-n] [-S SubMatrix] [-w]
    [-h] [-a algorithm] [-v verbosityLevel] [-V] [-q] [-t seconds]

Description

qbsolv executes a quadratic unconstrained binary optimization (QUBO) problem represented in a file. It returns bit-vector results that minimizes---or optionally, maximizes---the value of the objective function represented by the QUBO. The problem is represented in QUBO(5) file format.

The QUBO input problem is not limited to the graph size or connectivity of a sampler, for example the D-Wave system.

Options are as follows:

-i infile
    Name of the file for the input QUBO. This option is mandatory.
-o outfile
    Optional output filename.
    Default is the standard output.
-a algorithm
    Optional selection for the outer loop algorithm.  Default is o.
    'o' for original qbsolv method. Submatrix based upon change in energy.
    'p' for path relinking.  Submatrix based upon differences of solutions
-m
    Optional selection of finding the maximum instead of the minimum.
-T target
    Optional argument target value of the objective function. Stops execution when found.
-t timeout
    Optional timeout value. Stops execution when the elapsed CPU time equals or
    exceeds it. Timeout is only checked after completion of the main
    loop. Other halt values such as 'target' and 'repeats' halt before 'timeout'.
    Default value is 2592000.0.
-n repeats
    Optional number of times the main loop of the algorithm is repeated with
    no change in optimal value found before stopping.
    Default value is 50.
-S subproblemSize
    Optional size of the sub-problems into which the QUBO is decomposed.
    If no "-S 0" or "-S" argument is present, uses the size specified in the
    embedding file found in the workspace set up by DW. If no DW environment is
    established, value defaults to 47 and uses the tabu solver on subproblems.
    If a value is specified, subproblems based on that size are solved with the
    tabu solver.
-w
    If present, the QUBO matrix and result are printed in .csv format.
-h
    If present, prints the help or usage message for qbsolv and exits without execution.
-v verbosityLevel
    Optional setting of the verbosity of output. The default verbosityLevel of
    0 outputs the number of bits in the solution, the solution,
    and the energy of the solution.  A verbosityLevel of 1 outputs the same
    information for multiple solutions, if found. A verbosityLevel of 2
    also outputs more detailed information at each step of the algorithm. The
    information increases for verbosity levels of up to 4.
-V
    If present, prints the version number of the qbsolv program and exits without execution.
-q
    If present, prints the format of the QUBO file.
-r seed
    Used to reset the seed for the random number generation.

qbsolv QUBO Input File Format

A .qubo file contains data that describes an unconstrained quadratic binary optimization problem. It is an ASCII file comprising four types of lines:

  1. Comments defined by a "c" in column 1. Comments may appear anywhere in the file, and are ignored.

  2. Program line defined by a "p" in the first column. A single program line must be the first non-comment line in the file. The program line has six required fields separated by space(s), as in this example:

    p   qubo  topology   maxNodes   nNodes   nCouplers
    

    where:

    p          Problem line sentinel.
    qubo       File type identifier.
    topology   String that identifies the topology of the problem and the specific
               problem type. For an unconstrained problem, target is "0" or
               "unconstrained." In future implementations, valid strings
               might include "chimera128" or "chimera512" (among others).
    maxNodes   Number of nodes in the topology.
    nNodes     Number of nodes in the problem (nNodes <= maxNodes).
               Each node has a unique number and must take a value in the range
               {0 - (maxNodes-1)}. A duplicate node number is an error. Node
               numbers need not be in order, and need not be contiguous.
    nCouplers  Number of couplers in the problem. Each coupler is a unique connection
               between two different nodes. The maximum number of couplers is (nNodes)^2.
               A duplicate coupler is an error.
    
  3. nNodes clauses. Each clause is made up of three numbers, separated by one or more blanks. The first two numbers must be integers and are the number for this node (repeated). The node number must be in range {0 , (maxNodes-1)}. The third value is the weight associated with the node. Weight may be an integer or float, and can take on any positive or negative value, or be set to zero.

  4. nCouplers clauses. Each clause is made up of three numbers, separated by one or more blanks. The first two numbers, (i and j), are the node numbers for this coupler and must be different integers, where (i < j).Each number must be one of the nNodes valid node numbers (and thus in range {0, (maxNodes-1)}). The third value is the strength associated with the coupler. Strength may be an integer or float, and can take on any positive or negative value, but not zero. Every node must connect with at least one other node (thus must have at least one coupler connected to it).

Here is a simple QUBO file example for an unconstrained QUBO with 4 nodes and 6 couplers. This example is provided to illustrate the elements of a QUBO benchmark file, not to represent a real problem.

| <--- column 1
c
c  This is a sample .qubo file
c  with 4 nodes and 6 couplers
c
p  qubo  0  4  4  6
c ------------------
0  0   3.4
1  1   4.5
2  2   2.1
3  3   -2.4
c ------------------
0  1   2.2
0  2   3.4
1  2   4.5
0  3   -2
1  3   4.5678
2  3   -3.22

Library usage

TODO

More Repositories

1

dwave-ocean-sdk

Installer for D-Wave's Ocean tools
Python
388
star
2

dimod

A shared API for QUBO/Ising samplers.
Python
120
star
3

dwave-networkx

D-Wave Systems extension of the NetworkX Python package for graphs and graph algorithms.
Python
88
star
4

dwave-system

An API for easily incorporating the D-Wave system as a sampler, either directly or through Leap's cloud-based hybrid samplers
Python
87
star
5

dwave-hybrid

Hybrid Asynchronous Decomposition Sampler prototype framework.
Python
79
star
6

dwave-cloud-client

A minimal implementation of the REST interface used to communicate with D-Wave Solver API (SAPI) servers.
Python
57
star
7

dwave-neal

An implementation of a simulated annealing sampler for general Ising model graphs in C++ with a dimod Python wrapper.
Python
48
star
8

docs

D-Wave Ocean Documentation
Python
46
star
9

minorminer

minorminer is a heuristic tool for minor embedding: given a minor and target graph, it tries to find a mapping that embeds the minor into the target.
C++
46
star
10

demos

WARNING: This repo is obsolete. For D-Wave Ocean code examples, go to the `dwave-examples` GitHub account.
36
star
11

dwave-qiskit-plugin

D-Wave Ocean plugin for IBM Qiskit.
Python
31
star
12

chimera-embedding

Python
27
star
13

dwave-tabu

Tabu solver for QUBO/Ising problems.
C++
20
star
14

dwavebinarycsp

Map constraint satisfaction problems with binary variables to binary quadratic models.
Python
20
star
15

dw_sa_chi

Simulated annealing solvers
C++
19
star
16

penaltymodel

Utilities and interfaces for using penalty models.
Python
19
star
17

dwave-pimc

C++
19
star
18

qboost

WARNING: The Qboost demo is now maintained in a different GitHub account. To find this repo, please visit dwave-examples/qboost.
Python
15
star
19

dwave-gate

dwave-gate is a software package for constructing, modifying and running quantum circuits on the provided state-vector simulator.
Python
14
star
20

dwave-scikit-learn-plugin

A plugin to scikit-learn for quantum-classical hybrid solving
Python
13
star
21

dwave_embedding_utilities

Provides utilities for mapping between source and target models.
Python
9
star
22

dwave_micro_client_dimod

dimod wrapper for the D-Wave Micro Client
Python
7
star
23

dwave_sapi_dimod

dimod wrapper for D-Wave's SAPI Client Library
Python
7
star
24

dwave-inspector

D-Wave Problem Inspector
Python
5
star
25

dwave-samplers

Classical algorithms for solving binary quadratic models
C++
5
star
26

beartooth-demo

Python
5
star
27

homebase

platform independent access to user data folders.
Python
4
star
28

spin-boson-chain

Python
4
star
29

leapide-docs

LeapIDE documentation
4
star
30

dwave-preprocessing

Common preprocessing tools that can aid in solving binary quadratic models (BQM).
C++
4
star
31

ocean-docker

Ocean docker images generator
Python
3
star
32

hss-overview-benchmarks

Benchmarks for the whitepaper D-Wave Hybrid Solver: An Overview (2020-02-25)
3
star
33

dwave-greedy

Greedy binary quadratic model solvers.
Python
2
star
34

shimming-tutorial

Python
2
star