Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Documentation to Note to import before sample call #54

Closed
davage opened this issue Feb 11, 2020 · 1 comment
Closed

Update Documentation to Note to import before sample call #54

davage opened this issue Feb 11, 2020 · 1 comment
Assignees
Labels

Comments

@davage
Copy link

davage commented Feb 11, 2020

In order for the inspector show function to work properly, the import statement must be called before the sampler sample function call, followed by which the inspector show function can be called.
i.e.:
import dwave.inspector
...
sampler.sample(Q)
...
dwave.inspector.show(Q, response)

This is not entirely obvious based on context and current documentation.

@randomir
Copy link
Member

That is not entirely correct, since you do not have to activate the full data capture (done on import) to use show(), but it certainly makes the usage easier.

Data captured includes the problem sent to the QPU (including parameters) and the samples returned. It also captures warnings generated during embedding, and the embedding context (the map, and the chain strength).

So for completeness, the alternative to:

import dwave.inspector
sampleset = sampler.sample(bqm)
dwave.inspector.show(sampleset)

looks something like:

sampleset = sampler.sample(bqm, return_embedding=True, warnings='SAVE')
import dwave.inspector
dwave.inspector.show(bqm, sampleset, sampler)

To be clear, data capture is encouraged, because going forward it'll include much more data (like nested embeddings #40, but also other problem transformations), so we want to emphasize it our docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants