How do we know the value embedded in the actual devices of the interaction that was thrown into D-Wave?

How do we know the value embedded in the actual devices of the interaction that was thrown into D-Wave?

0

Comments

2 comments
  • Hello,

    That all depends on how you are using the libraries to interact with the D-Wave QPU.

    It is possible to provide the values to the QPU directly.

    It is also possible to use different libraries to assist in calculating the values to provide.

    Can you provide a simple example of how you are using the QPU?

    Thanks!

    0
    Comment actions Permalink
  • Hello Yu,

    D-Wave's composite samplers (such as EmbeddingComposite and FixedEmbeddingComposite) do the embedding and unembedding steps automatically when you use these tools. This is why the embedded weightings and couplings (h and J or QUBO values) are not visible.

    If you want to see the final weightings and couplings that are sent to the QPU, you can break the problem into parts. For example:

    import dimod
    from dwave.system import DWaveSampler
    from minorminer import find_embedding
    from dwave.embedding import embed_ising, unembed_sampleset

    #Build the problem in Ising (or QUBO) format
    source_h = {}
    source_J = {('a', 'b'): 1, ('b', 'c'): 1, ('a', 'c'): 1}
    source_graph = [('a','b'),('b','c'),('a','c')]
    source_BQM = dimod.BinaryQuadraticModel(source_h,source_J,0.0,dimod.SPIN)

    #Create the sampler and record its adjacency graph
    sampler = DWaveSampler()
    target_graph = sampler.edgelist
    target_adjacency = sampler.adjacency

    #Find an embedding from source to target graphs
    emb = find_embedding(source_graph,target_graph)

    #Embed the h and J values
    target_h, target_J = embed_ising(source_h,source_J,emb,target_adjacency)

    #Sample the QPU
    raw_samples = sampler.sample_ising(target_h,target_J,num_reads=100)

    #Unembed the response
    formatted_samples = unembed_sampleset(raw_samples,emb,source_BQM)

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post