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 examples to use newer QPUs #491

Merged
merged 6 commits into from
May 12, 2023

Conversation

JoelPasvolsky
Copy link
Contributor

No description provided.

Copy link
Member

@randomir randomir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

>>> len(response) # doctest: +SKIP
246
>>> sampler = EmbeddingComposite(TilingComposite(DWaveSampler(), 1, 1, 4))
>>> sampleset = sampler.sample_ising({},{('a', 'b'): 1})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps add num_reads=1 to emphasize only one read is requested (and we get 660 samples back).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, this looks like a good use-case for argument translation in the composites (and result post-processing on the way out).

I.e. one might reasonably expect to actually set num_reads=300 in the sample call on the composed outer sampler, and that would be translated to num_reads=1 going to the QPU. The resulting sampleset (containing 660 samples in case Advantage QPU) would be truncated to the asked 300 only. Similarly, asking for num_reads=1000 would translate to num_reads=2 on QPU.

dwave/system/composites/virtual_graph.py Outdated Show resolved Hide resolved
@randomir randomir merged commit 168eda4 into dwavesystems:master May 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants