I, foolishly, thought a simulation of a quantum computer implementation of Shor's Algorithm would be a good idea for a self designed project for my computer science class. It is too late to turn back, luckily, however, I have most of the components programmed. My problem lies with the use of the "Quantum Fourier Transform". I know, basically, what a fourier transform does; i.e. it can decompose a function into a series of sinusoids.

Could someone please explain what the Qauntum Fourier Transform is doing to the each state as outlined here:

I don't really understand how the QFT makes the value more likely to be nq/r