Giter VIP home page Giter VIP logo

qiskit-quantum-knn's People

Contributors

1ucian0 avatar ermachenkoboris avatar groentelepel avatar knodelgino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

qiskit-quantum-knn's Issues

Possible error in mapping states to integers

When computing fidelities/contrasts, there is a step where we map the states of the computational basis (e.g. '10010101') back to integers using

index_state = int(comp_state, 2)

However, I read in the documentation of Qiskit that the ordering they use for tensor product states is the opposite of most physics textbooks:

When representing the state of a multi-qubit system, the tensor order used in Qiskit is different than that used in most physics textbooks. Suppose there are 𝑛 qubits, and qubit 𝑗 is labeled as 𝑄𝑗. Qiskit uses an ordering in which the 𝑛th qubit is on the left side of the tensor product, so that the basis vectors are labeled as π‘„π‘›βˆ’1βŠ—β‹―βŠ—π‘„1βŠ—π‘„0.

For example, if qubit zero is in state 0, qubit 1 is in state 0, and qubit 2 is in state 1, Qiskit would represent this state as |100⟩, whereas many physics textbooks would represent it as |001⟩.

I think this means we might have to change the code to

index_state = int(comp_state[::-1], 2)

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:

This is not working now!!

Since the qiskit aqua is depricated now, this code is not working anymore. Can somebody please help me in implementing this QKNN with latest qiskit libraries.

New Release for pypi.org

Hello !
It would be great if you released a new patched version so that your library can be easily accessed.
Now it doesn't work because of aqua.
Have a nice day!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.