-
Notifications
You must be signed in to change notification settings - Fork 8
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
Possible error in mapping states to integers #11
Comments
Thank you very much for this contribution. I must admit: it has been a while since I have taken a look at this code. I do remember however Qiskit’s reversed order of qubits and having to fiddle around with that. I appreciate your thoughts on this, and I would suggest you create a merge request of your solution so that I can merge it! |
awesome, I will look into it. |
knodelgino
added a commit
to knodelgino/qiskit-quantum-knn
that referenced
this issue
Sep 11, 2021
Related to: GroenteLepel#11
@GroenteLepel created a PR here: #12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When computing fidelities/contrasts, there is a step where we map the states of the computational basis (e.g. '10010101') back to integers using
However, I read in the documentation of Qiskit that the ordering they use for tensor product states is the opposite of most physics textbooks:
I think this means we might have to change the code to
I played around with this a little bit in a juptyer notebook, where I tried to explicitly compute the fidelities of some sample states, and found that without this change, a lot of them get swapped around. Reversing the order as above seems to fix the issue.
If what I'm saying is correct, we'd have to make 2 changes:
qiskit-quantum-knn/qiskit_quantum_knn/qknn/qkneighborsclassifier.py
Line 366 in 2b38208
qiskit-quantum-knn/qiskit_quantum_knn/qknn/qkneighborsclassifier.py
Line 441 in 2b38208
The text was updated successfully, but these errors were encountered: