Warnings#
Settings for raising warnings may be configured by tools such as composites or dwave-inspector.
This example configures warnings for an instance of the
EmbeddingComposite()
class used on a sampler
structured to represent variable a
with a long chain.
>>> import networkx as nx
>>> import dimod
>>> import greedy
...
>>> G = nx.Graph()
>>> G.add_edges_from([(n, n + 1) for n in range(10)])
>>> sampler = dimod.StructureComposite(greedy.SteepestDescentSampler(), G.nodes, G.edges)
>>> sampleset = EmbeddingComposite(sampler).sample_ising({}, {("a", "b"): -1},
... return_embedding=True,
... embedding_parameters={"fixed_chains": {"a": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]}},
... warnings=dwave.system.warnings.SAVE)
>>> "warnings" in sampleset.info
True
- class ChainBreakWarning[source]#
Raised if a chain’s qubits are in different states for lowest-energy samples.
- class TooFewSamplesWarning[source]#
Raised if lowest-energy samples are a small fraction of the total samples.