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

Add ability to report state in simulation backends #687

Open
jake-arkinstall opened this issue Dec 4, 2024 · 1 comment
Open

Add ability to report state in simulation backends #687

jake-arkinstall opened this issue Dec 4, 2024 · 1 comment

Comments

@jake-arkinstall
Copy link
Contributor

Simulators know their underlying state. Users should be able to query this state within guppy code for debugging purposes.

Because of the following:

  • a point in guppy code one might not be aware of all of the currently allocated qubits, e.g. in recursion (the number of allocated qubits might depend on the current recursion level)
  • the user will also want to specify some ordering of qubits
  • it isn't generally valid to trace out unrequested qubits

Then it makes sense to make the call look like:

q1, q2 = qubit(), qubit()
do_the_thing(q1, q2)
report_state("some_tag", [q1, q2])

This should output the state with the Most* Significant Bit representing q1, the second Most Significant Bit representing q2. Any other qubits will occupy further bits.

*or least, I have no preference.

@cqc-alec
Copy link
Contributor

cqc-alec commented Dec 4, 2024

If we are representing the state as a dictionary rather than a vector then the MSB/LSB question becomes moot. We just preserve the order of the qubits in each of the keys of the dictionary.

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

No branches or pull requests

2 participants