Compose embedding when returning it
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.
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.
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.
Ill definitely write a compose_embeddings() function regardless, it's a useful utility.