DWaveSampler does not return requested number of samples

Hi!

I am currently running the DWAVE QPU on AWS Braket. I am using the BraketSampler (but I saw the same issue also with the BraketDWaveSampler)

from braket.ocean_plugin import BraketSampler
from dwave.system.composites import EmbeddingComposite
device = "arn:aws:braket:::device/qpu/d-wave/DW_2000Q_6"
s3_location = (aws_bucket, aws_folder)
sampler = EmbeddingComposite(BraketSampler(s3_location, device))

I am running a Quantum Boltzmann Machine Reinforcement Learning project, i.e. generating samples in a training loop of around 500 steps. At every step, I would like to generate 100 shots (samples) on the QPU. Unfortunately, the sampler does not always return the number of requested shots, which is puzzling me.

qubo_dict = { ... }
num_reads = 100

sampler.sample_qubo(
Q=qubo_dict, shots=num_reads, beta=0.5,
postprocessingType='SAMPLING').samples()

For example, instead of 100, I might only get 80 in some cases in the beginning, or even much less (just 20, or even 10 out of 100 requested) and it slows down the training loop so much that I cannot run it to the end. It seems that this behaviour appears only after some iterations in my training loop, so I was wondering what the reason could be. I already tried to reduce the issue by increasing the thermalization time to the maximum (10 ms) and setting the intersample correlation flag to true (to have more cool-down time between anneals).

Do you know what the reason could be for this behaviour? Am I missing something very basic here?

Thank you!

Michael

 

0

Comments

2 comments
  • Michael,

    I haven't worked with the BraketSamplers or reinforcement learning (I usually work on optimization problems), so I am not sure of all of the defaults and other settings, but it sounds like you may be getting your results as a histogram which merges duplicate solutions, and also includes the number of occurrences of that solution. From what you have described, you may want to set the answer_mode (https://docs.dwavesys.com/docs/latest/c_solver_parameters.html#answer-mode) to raw to get all of the responses, not just a summary in histogram form.

    If this is not the case, post back here and someone else may have some other ideas to try.

    Good luck.

    Ed

     

    1
    Comment actions Permalink
  • Hi Ed,

    thank you so much for your quick reply. Indeed, your answer solved our problem, thank you very much :) !!

    All the best,

    Michael

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post