Answered

Can I determine the embedding from the response?

Given this code:

sampler = EmbeddingComposite(DWaveSampler(endpoint=URL, token=TOKEN, solver=SOLVER))
response = sampler.sample(bqm, num_reads=60)

Is there a way to determine (from the response variable) the embedding that was used?

 

0

Comments

2 comments
  • Hi Thomas,

    Right now there is no way to get the embedding, though there is a feature request on github to return it as part of the response https://github.com/dwavesystems/dwave-system/issues/76 . Note that we use github issues for feature requests and bugs specific to the open source tools, for questions (like yours) this community is the correct place.

    The current 'best practice' for those who wish to work with embeddings is to use the FixedEmbeddingComposite. See the below code snippet:

    import minorminer
    from dwave.system.samplers import DWaveSampler
    from dwave.system.composites import FixedEmbeddingComposite

    dwave_sampler = DWaveSampler()

    target_edgelist = dwave_sampler.edgelist
    source_edgelist = list(bqm.quadratic) # the edges in the binary quadratic model

    embedding = minorminer.find_embedding(source_edgelist, target_edgelist)

    sampler = FixedEmbeddingComposite(dwave_sampler, embedding)


     

    1
    Comment actions Permalink
  • Very helpful - thanks!

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post