-
Notifications
You must be signed in to change notification settings - Fork 25
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
Improve documentation regarding how states are printed. #90
Comments
You can check the amplitudes here. |
The order of output states is determined by
Then the state will be printed as On a related note, we may want to print some kind of index-mapping for the user since the "final" qubits can be interspersed with the others; e.g. with 6 qubits and final qubits at indices 1, 2, and 4, the output is: |
As user, I would prefer to specify the final state as one would expect (|012345>) and having qFlex figure out how to rearrange the user-provided string to do the right calculation. Otherwise, I need to understand how the mapping is done. Since the ordering is known since the beginning, it shouldn't be hard to do. Any thoughts? |
The issue here is that there are two sources for final state: the explicit Using the example above, if we assume that qubit 0, 3, and 5 each have final state |0> then the states we'll return (and how we print them) are:
At this point, the question becomes: is it clearer to maintain the qubit ordering, or to extract the qubits that change between states? |
I think it's about taste, but in my case I prefer to keep the qubit ordering. |
There is something that puzzles me here. Following your reasoning, in #88 I should expect |
On a related issue, I've noticed that my convention for |
For instance, I'm running:
(where
where I assume that the last qubit is |
Found the problem. For some strange reasons, Quirk invert the qubits order :( Here an example. The state |
For now, let's improve the documentation explaining how the qubits are ordered once states are printed. |
Currently, the coordinate system is zero indexed with the top left corner as the origin. I added a note on this in the branch documentation_fixes, but it still is confusing and not the normal assumption. Are you suggesting that we change our coordinate system entirely? I think Orion and I were discussing that this will no longer be an issue once we move away from requiring a square grid. |
Don't worry, I just fixed the |
This is correct, but instead of documenting the inconsistency we should first try to adjust the output (by modifying |
That would be nice, thanks! |
Do we still want to create an outputs_format.md file? |
In #88, I would expect that
amplitude[0].second
correspond to the quantum state|11000>
(wherequbit=5
is in last position). However, it corresponds to the state|00011>
. Similarly,amplitude[1].second
should correspond to|11001>
, and instead correspond to|10011>
. Am I doing/assuming something wrong?The text was updated successfully, but these errors were encountered: