Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add example of pre-computing an embedding #67

@JoelPasvolsky

Description

@JoelPasvolsky

Request from Cathy, "Hey tools support, novice user here(!) Each QPU has a largest clique that can be embedded in the working graph -- is that clique pre-computed and available to me through ocean? I would like to avoid using a bunch of trial-and-error calls to MinorMiner to find the embedding."

Add to somewhere like https://docs.ocean.dwavesys.com/en/latest/examples/topology_samplers.html#topology-samplers an example like:

from dwave.system import DWaveSampler, FixedEmbeddingComposite
from dwave.embedding.chimera import find_clique_embedding

qpu = DWaveSampler(solver=dict(qpu=True))

embedding = find_clique_embedding(K, 16, target_edges=qpu.edgelist)

sampler = FixedEmbeddingComposite(qpu, embedding)

sampleset = sampler.sample_ising(h, J)
print(sampleset)

CC @arcondello

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions