dwave.embedding.chain_strength.scaled#

scaled(bqm, embedding=None, prefactor=1.0)[source]#

Set chain strength that is scaled to the problem’s bias range.

Parameters:
  • bqm (BinaryQuadraticModel) – A binary quadratic model.

  • embedding (dict/EmbeddedStructure, default=None) – Included to satisfy the chain_strength callable specifications for the embed_bqm() function.

  • prefactor (float, optional, default=1.0) – Prefactor used for scaling.

Returns:

Chain strength, or 1 if chain strength is not applicable.

Return type:

float

Examples

>>> import dimod
>>> from dwave.embedding.chain_strength import scaled
...
>>> bqm = dimod.BinaryQuadraticModel({'a': -1.7, 'b': 1.2}, {('a', 'b'): 0.5}, 0, dimod.SPIN)
>>> print(scaled(bqm, prefactor=2))
3.4