hybrid.decomposers.make_origin_embeddings¶
- make_origin_embeddings(qpu_sampler=None, lattice_type=None)[source]¶
Creates optimal embeddings for a lattice.
The embeddings created are compatible with the topology and shape of a specified
qpu_sampler
.- Parameters
qpu_sampler (
dimod.Sampler
, optional) – Quantum sampler such as a D-Wave system. If not specified, theDWaveSampler
sampler class is used to select a QPU solver with a topology compatible with the specifiedlattice_type
(e.g. an Advantage system for a ‘pegasus’ lattice type).lattice_type (str, optional, default=qpu_sampler.properties['topology']['type']) –
- Options are:
- ”cubic”
Embeddings compatible with the schemes arXiv:2009.12479 and arXiv:2003.00133 are created for a
qpu_sampler
of topology type either ‘pegasus’ or ‘chimera’.
- ”pegasus”
Embeddings are chain length one (minimal and native). If
qpu_sampler
topology type is ‘pegasus’, maximum scale subgraphs are embedded using thenice_coordinates
vector labeling scheme for variables.
- ”chimera”
Embeddings are chain length one (minimal and native). If
qpu_sampler
topology type is ‘chimera’, maximum scale chimera subgraphs are embedded using the chimera vector labeling scheme for variables.
- Returns
A list of embeddings. Each embedding is a dictionary, mapping geometric problem keys to sets of qubits (chains) compatible with the
qpu_sampler
.
Examples
This example creates a list of three cubic lattice embeddings compatible with the default online system. These three embeddings are related by rotation of the lattice: for a Pegasus P16 system the embeddings are for lattices of size (15,15,12), (12,15,15) and (15,12,15) respectively.
>>> from dwave.system.samplers import DWaveSampler >>> sampler = DWaveSampler() >>> embeddings = make_origin_embeddings(qpu_sampler=sampler, ... lattice_type='cubic')