dwave.embedding.EmbeddedStructure#

class EmbeddedStructure(target_edges, embedding)[source]#

Embedding structure for a target graph and minor embedding.

Processes an embedding and a target graph to categorize target edges into those within chains and connecting chains.

This class is a dict that acts as an immutable duplicate of embedding, and is used to embed a binary quadratic model into the target graph.

Parameters:
  • target_edges (iterable[edge]) – An iterable of edges in the target graph. Each edge is an iterable of 2 hashable objects.

  • embedding (dict) – Mapping from source graph to target graph as a dict of form {s: {t, ...}, ...}, where s is a source-model variable and t is a target-model variable.

__init__(target_edges, embedding)[source]#

Methods

__init__(target_edges, embedding)

chain_edges(u)

Iterate over edges contained in the chain for variable u.

clear(*a, **k)

Raise a TypeError -- this method is not supported because EmbeddedStructure is immutable, but exists because dict is the parent class.

copy()

Return a shallow copy of the dict.

embed_bqm(source_bqm[, chain_strength, ...])

Embed a binary quadratic model onto a target graph.

fromkeys(*args, **kwargs)

Raise a NotImplementedError.

get(key[, default])

Return the value for key if key is in the dictionary, else default.

interaction_edges(u, *args)

Iterate over edges between the chains for variables u and v.

items()

Return a set-like object providing a view on the dict's items.

keys()

Return a set-like object providing a view on the dict's keys.

pop(*a, **k)

Raise a TypeError -- this method is not supported because EmbeddedStructure is immutable, but exists because dict is the parent class.

popitem(*a, **k)

Raise a TypeError -- this method is not supported because EmbeddedStructure is immutable, but exists because dict is the parent class.

setdefault(*a, **k)

Raise a TypeError -- this method is not supported because EmbeddedStructure is immutable, but exists because dict is the parent class.

update(*a, **k)

Raise a TypeError -- this method is not supported because EmbeddedStructure is immutable, but exists because dict is the parent class.

values()

Return an object providing a view on the dict's values.

Attributes

chain_strength

Return the chain strength selected for embedding.

max_chain_length

Maximum chain length in the embedding.