The current implementation of applyQuantumFourierTransform() merely effects the canonical gates of the QFT in-turn. An optimised routine is possible, whereby we merge contiguous phase gates into a single, diagonal operator. In QuEST v3, this was implemented using the (now deprecated and absolutely awful) applyPhaseFunc() routine.
In QuEST v4, an equivalent diagonal operator could be effected by a applyFullStateDiagMatr using a temporarily allocated applyFullStateDiagMatr. However, this incurs gratuitous memory allocation costs given that the elements are compile-time known.
We should instead implement the necessary diagonal operator as a bespoke routine. This requires re-deriving it (since removed last-minute from the distributed manuscript) and updating applyQuantumFourierTransform() to make use of it. The algorithm is very cute, compatible with both distribution, and density matrices, and non-contiguous arbitrarily-ordered target qubits. As such, it may be a superior solution to performing the FFT upon the constituent amplitudes directly.
This may serve as an excellent project for a student and worthy of publication 🙌
The current implementation of
applyQuantumFourierTransform()merely effects the canonical gates of the QFT in-turn. An optimised routine is possible, whereby we merge contiguous phase gates into a single, diagonal operator. In QuESTv3, this was implemented using the (now deprecated and absolutely awful)applyPhaseFunc()routine.In QuEST
v4, an equivalent diagonal operator could be effected by aapplyFullStateDiagMatrusing a temporarily allocatedapplyFullStateDiagMatr. However, this incurs gratuitous memory allocation costs given that the elements are compile-time known.We should instead implement the necessary diagonal operator as a bespoke routine. This requires re-deriving it (since removed last-minute from the distributed manuscript) and updating
applyQuantumFourierTransform()to make use of it. The algorithm is very cute, compatible with both distribution, and density matrices, and non-contiguous arbitrarily-ordered target qubits. As such, it may be a superior solution to performing the FFT upon the constituent amplitudes directly.