Skip to main content

DynexSampler

DynexSampler is the core interface for running quantum annealing computations on the Dynex platform. It accepts any model type (BQM, CQM, DQM), submits jobs via gRPC, and returns a dimod SampleSet.

Constructor

Parameters

BQM | CQM | DQM
required
The problem model to sample. Must be a Dynex model wrapper — not a raw dimod object.
DynexConfig
required
Configuration object specifying the compute backend, credentials, and SDK settings.
str
Human-readable job description. Appears in the Dynex job dashboard and network explorer.
bool
default:"True"
Whether to emit SDK log messages during sampling. Set to False for parallel workers or automated pipelines.

sample() method

Parameters

int
required
Number of independent parallel samples. Higher values give broader coverage of the solution space.
int
required
ODE integration depth (number of integration steps). Higher values allow the system more time to find lower-energy states.
int
default:"1"
For network backends, the minimum number of solutions to collect from workers before returning. Use shots > 1 when you need multiple diverse solutions. Current recommended maximum: 5.
float
default:"9.0"
Maximum allowed absolute value for BQM coefficients when using a QPU backend. If any linear or quadratic coefficient exceeds this threshold, the entire BQM is automatically scaled down proportionally so the maximum coefficient equals qpu_max_coeff. Solutions are returned in the original variable space. Has no effect on GPU/CPU/LOCAL backends or on circuit BQMs (QASM), where scaling is handled by the Apollo API.
bool
default:"False"
Apply automatic preprocessing (coefficient scaling, normalization). Recommended for QPU backends to stay within hardware bounds.
bool
default:"False"
Show verbose progress output including worker responses and integration metrics.
float
Upper bound for automatic alpha parameter tuning in ODE integration. Range: [0.00000001, 100.0].
float
Upper bound for automatic beta parameter tuning. Range: [0.00000001, 100.0].
float
Upper bound for automatic gamma parameter tuning. Range: [0.0, 1.0].
float
Upper bound for automatic delta parameter tuning. Range: [0.0, 1.0].
float
Upper bound for automatic epsilon parameter tuning. Range: [0.0, 1.0].
float
Upper bound for automatic zeta parameter tuning. Range: [0.0, 1.0].
float
Minimum adaptive ODE step size. Range: [1e-16, 1.0]. Smaller values increase precision but slow computation.
int
Priority fee in nanoDNX (1 DNX = 1,000,000,000 nanoDNX). Higher fees prioritize your job on the network. If not specified, the current average network fee is used.

Returns

Returns a dimod SampleSet:

Thread safety

DynexSampler is thread-safe and can be used from multiple threads or processes simultaneously. See Parallel Sampling for examples.

Full example