Akash sharma
Akash sharma

Reputation: 59

In quantum computing is there a preference to usage of little endian or big endian?

I've been learning quantum computing related concepts over the past few months. We've generally used the big endian notation while solving problems on paper.

Recently on starting to code I find that at a lot of places the little endian notation is used. I see the same in Quantum Katas by Microsoft and also in Qiskit. On paper, however, thinking in terms of Little endian reverses the order of tensor products, etc. So sometimes it gets confusing.

Is there any particular trend on using little endian in quantum computing softwares (QDK, Qiskit, etc) or any reason for the same?

Any suggestions in terms of what is the best way to think (in the above context), that can help while developing quantum algos to problems and smoothly translating them into code are welcome.

Upvotes: 0

Views: 451

Answers (1)

Mariia Mykhailova
Mariia Mykhailova

Reputation: 2032

I believe the preference in the user code is mostly dictated by the notation used by two sources: the libraries and the books/papers detailing the topic; and the preference in the libraries is dictated by the notation in the books/papers used to implement the libraries.

For example, quantum Fourier transform as described in Nielsen and Chuang uses big endian notation for input/output registers; so if a library uses this book as a reference (as the first part of the QFT kata does), it is likely to use big endian notation as well.

I don't think there is a quantum-specific reason to prefer little endian over big endian or vice versa, at some level it's an arbitrary choice informed by the notation preferred by the sources.

Upvotes: 2

Related Questions