dwave.system.composites.AutoEmbeddingComposite.sample#

AutoEmbeddingComposite.sample(bqm, **parameters)[source]#

Sample from the provided binary quadratic model.

Parameters:
  • bqm (BinaryQuadraticModel) – Binary quadratic model to be sampled from.

  • chain_strength (float/mapping/callable, optional) – Sets the coupling strength between qubits representing variables that form a chain. Mappings should specify the required chain strength for each variable. Callables should accept the BQM and embedding and return a float or mapping. By default, chain_strength is calculated with uniform_torque_compensation().

  • chain_break_method (function/list, optional) – Method or methods used to resolve chain breaks. If multiple methods are given, the results are concatenated and a new field called chain_break_method specifying the index of the method is appended to the sample set. See unembed_sampleset() and chain_breaks.

  • chain_break_fraction (bool, optional, default=True) – Add a chain_break_fraction field to the unembedded response with the fraction of chains broken before unembedding.

  • embedding_parameters (dict, optional) – If provided, parameters are passed to the embedding method as keyword arguments. Overrides any embedding parameters passed to the constructor.

  • return_embedding (bool, optional) – If True, the embedding, chain strength, chain break method and embedding parameters are added to the info field of the returned sample set. The default behavior is defined by the return_embedding_default attribute, which by default is False.

  • warnings (WarningAction, optional) – Defines what warning action to take, if any (see the Warnings section). The default behavior is defined by the warnings_default attribute, which by default is IGNORE

  • **parameters – Parameters for the sampling method, specified by the child sampler.

Returns:

SampleSet

Examples

See the example in EmbeddingComposite.