Sampler.sample_counts() is inconsistent with tutorial

I’m trying to setup some batch jobs to run on qpu:ascella and I run into some errors in replicating the tutorial found here:

The line of the tutorial that generates the error is in the last snippet where one tries to display the results obtained from the batch job ( local or remote)

results_list = sample_count["results_list"]  # Note that all the results are stored in the "results_list" field

for r in results_list:

    print(r["iteration"]['circuit_params'])  # Iteration params are available along with the other result fields


Apparently the results of the iteration found in sample_count["results_list"] have no “iteration” key.

From what I’ve found in Perceval code these result dictionary are ultimately produced by Processor.samples() in Sampler._probs_iterate_locally()


This error is consisted with Processor.samples() result statement that cites no “iteration” whatsoever:

return {'results': output, 'physical_perf': physical_perf, 'logical_perf': logical_perf}

Is this “iteration” key planned to be part of the interface?
Personally I would find it really useful
I’m running a freshly updated version of Perceval 0.10.3

Hello Emilio,

Local iterations were implemented in order to support the same feature in both local and remote computations. But actually, you found a glitch: remote jobs give you back the iteration data in each result dictionary, but not local ones. We definitely want to support that, so that’s a bug you’ve found.

I’m going to plan the fix for the next Perceval release.

Thanks again, and sorry for the inconvenience,