Skip to content

get list of measured bistrings from Aquila #369

@balewski

Description

@balewski

For some analysis, say evaluation of stability of the HW, one needs to see the bistrings from all shots, presented as a list.
Currently you provide only the summary in the form of dictionary of all unique bistrings and the number of occurences. It is done by get_counts():
https://amazon-braket-sdk-python.readthedocs.io/en/latest/_modules/braket/tasks/analog_hamiltonian_simulation_quantum_task_result.html#AnalogHamiltonianSimulationQuantumTaskResult.get_counts
Can you provide also new function get_shots(), which would differ very little from get_counts(), namely instead of accumulating the dictionary:

state_counts = Counter()
 for shot in self.measurements:
 ...
      state_counts.update((state,))
return dict(state_counts)

it would append a list:

state_list = []
 for shot in self.measurements:
 ...
      state_list.append(state)
return state_list

I can hack it for now, but this type of functionality is of general use. E.g. it is available in Qiskit or TKet.
Thanks, Jan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions