Giter Site home page Giter Site logo

Comments (3)

stylewarning avatar stylewarning commented on August 28, 2024 1

No problem. I might add that this is a good convention to follow because, were we to do it left-to-right, the basis elements would change if you add a qubit to the system. The index of the |1> state in a 1-qubit system is the same as the index of the |0001> state in a 4-qubit system. In the left-to-right scheme, we would have |1> be indexed by 1, but |1000> be indexed by 8, which seems silly. :)

from pyquil.

stylewarning avatar stylewarning commented on August 28, 2024

Hello! Thanks for the report.

The qubit indexes in Quil correspond to the exponents in the binary expansion of the basis index. Or, in other words, you should read the binary numbers right-to-left. So

X 0
X 1

would be the |011> state, because

011 (binary) = 3 (decimal) = 0*2^2 + 1*2^1 + 1*2^0

The exponents of the radix 2 are precisely the qubit indexes.

It is important to note that some sciences do use other conventions here, which is important to be mindful of when writing Quil.

from pyquil.

vontell avatar vontell commented on August 28, 2024

Ah of course; thanks for the clarification!

from pyquil.

Related Issues (20)

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.