Skip to content
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

[QFT-Issue] Quantum Fourier Transform needs SWAP gates. #1

Open
JaySpazio opened this issue Feb 16, 2023 · 1 comment
Open

[QFT-Issue] Quantum Fourier Transform needs SWAP gates. #1

JaySpazio opened this issue Feb 16, 2023 · 1 comment
Assignees

Comments

@JaySpazio
Copy link

To complete the algorithm it's necessary to apply a SWAP gate between pairs of qubits after all the H and CPhase gate.

You will find more information explained in the next link:
https://qiskit.org/textbook/ch-algorithms/quantum-fourier-transform.html

@edwinsolisf edwinsolisf self-assigned this Feb 17, 2023
@edwinsolisf
Copy link
Collaborator

AQS uses Big Endian for the order of quantum registers/qubits.
That is, to represent 12 in a 4 qubit register with Big Endian you will have $0011$ (states $\ket{0}$ for qubit $0$, $\ket{0}$ for qubit $1$, $\ket{1}$ for qubit $2$, and $\ket{1}$ for qubit $3$); meanwhile with Little Endian, you would have $1100$. This means that qubit $0$ will have the least significance, while the last qubit has the most significance.

After the QFT algorithm implemented is run, it modifies the state of the quantum computer in such a way that in the Fourier basis, the first qubit just stores its own value in its rotation (the least significant amount of information), while the last qubit encodes the values of all the other qubit in its rotation (the most significant amount of information).

You can observe this fact in the representation of the Fourier Basis using qubits in the link you provided. In the qubit $0$ they show that you have to do a lot of small rotations to represent each subsequent number, while the last qubit just does a half turn.

The reason for our QFT not having SWAPs is to keep it consistent with the endianness of our implementation. If you want to change to Little Endian, you may do so by adding the SWAP gates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants