Skip to main content

Defining Models

Dynex SDK supports three model types, each suited to a different class of problems. All models wrap a dimod object and pass through to DynexSampler.

Model Selection Guide


BQM — Binary Quadratic Model

The most common model type. Represents an objective function over binary variables (0/1 or ±1).

Using PyQUBO

Working with named variables


CQM — Constrained Quadratic Model

For problems where constraints are first-class: equality and inequality constraints are encoded directly without penalty terms.
CQM is ideal when constraints cannot be easily penalized. The SDK handles constraint-to-QUBO conversion internally.

DQM — Discrete Quadratic Model

For problems with multi-valued variables — where each variable can take one of several discrete values.

Preprocessing

For QPU backends, preprocessing can improve solution quality by scaling and normalizing coefficients: