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

get list of measured bistrings from Aquila #369

Open
balewski opened this issue Sep 29, 2023 · 3 comments
Open

get list of measured bistrings from Aquila #369

balewski opened this issue Sep 29, 2023 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@balewski
Copy link

balewski commented Sep 29, 2023

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

@balewski balewski added the enhancement New feature or request label Sep 29, 2023
@kshitijc
Copy link
Contributor

Thank you for raising this issue @balewski! We would be glad to include this functionality. Since you have already hacked it together, would you like to contribute it to the SDK?

@balewski
Copy link
Author

balewski commented Sep 29, 2023 via email

@kshitijc
Copy link
Contributor

Thanks a lot Jan! This is super helpful. Since this doesn't block you, I'll keep this open if someone else would like to contribute this to the SDK.

@kshitijc kshitijc added the good first issue Good for newcomers label Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants