# dwave.embedding.unembed_sampleset¶

unembed_sampleset(target_sampleset, embedding, source_bqm, chain_break_method=None, chain_break_fraction=False, return_embedding=False)[source]

Unembed a sample set.

Given samples from a target binary quadratic model (BQM), construct a sample set for a source BQM by unembedding.

Parameters: target_sampleset (dimod.SampleSet) – Sample set from the target BQM. embedding (dict) – Mapping from source graph to target graph as a dict of form {s: {t, …}, …}, where s is a source variable and t is a target variable. source_bqm (BinaryQuadraticModel) – Source BQM. 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. Defaults to majority_vote(). See dwave.embedding.chain_breaks. chain_break_fraction (bool, optional, default=False) – Add a chain_break_fraction field to the unembedded dimod.SampleSet with the fraction of chains broken before unembedding. return_embedding (bool, optional, default=False) – If True, the embedding is added to dimod.SampleSet.info of the returned sample set. Note that if an embedding key already exists in the sample set then it is overwritten. Sample set in the source BQM. SampleSet

Examples

This example unembeds from a square target graph samples of a triangular source BQM.

>>> # Triangular binary quadratic model and an embedding
>>> J = {('a', 'b'): -1, ('b', 'c'): -1, ('a', 'c'): -1}