dwave-system icon indicating copy to clipboard operation
dwave-system copied to clipboard

Compose embedding when returning it

Open randomir opened this issue 5 years ago • 3 comments

See: https://github.com/dwavesystems/dwave-inspector/issues/39.

When return_embedding=True (on embedding composite sample call), only the top-level embedding is returned, not the composed embedding of all children and the parent.

randomir avatar Jan 28 '20 15:01 randomir

This gets complicated quickly. The embedding itself is easy to compose, but things like chain strength and unembedding method and other context parameters lose their meaning. We could add embedding_contexts and have that point to a list of dicts, but then probably we'll need to store the individual embeddings in addition to the overall composed embedding. We can implement it but I think at this point a logging/events approach starts to make more sense.

Further, that still won't be enough to undo the problem transformation in all cases, e.g. FixedEmbeddingComposite(SpinReversalTransformComposite(EmbeddingComposite(...))), or worse FixVariablesComposite.

arcondello avatar Jan 28 '20 15:01 arcondello

I agree.

Capturing all intermediate results with event hooks was my intent originally. Just need to figure out how to handle incorrect (uncomposed) embeddings until we support events Ocean-wide.

randomir avatar Jan 28 '20 18:01 randomir

Ill definitely write a compose_embeddings() function regardless, it's a useful utility.

arcondello avatar Jan 28 '20 18:01 arcondello