dimod.reference.composites.PolyScaleComposite.sample_poly

PolyScaleComposite.sample_poly(poly, scalar=None, bias_range=1, poly_range=None, ignored_terms=None, **parameters)[source]

Scale and sample from the given binary polynomial.

If scalar is not given, problem is scaled based on bias and polynomial ranges. See BinaryPolynomial.scale() and BinaryPolynomial.normalize()

Parameters:
  • (obj (poly) – .BinaryPolynomial): A binary polynomial.
  • scalar (number, optional) – Value by which to scale the energy range of the binary polynomial.
  • bias_range (number/pair, optional, default=1) – Value/range by which to normalize the all the biases, or if poly_range is provided, just the linear biases.
  • poly_range (number/pair, optional) – Value/range by which to normalize the higher order biases.
  • ignored_terms (iterable, optional) – Biases associated with these terms are not scaled.
  • **parameters – Other parameters for the sampling method, specified by the child sampler.