Qualtran
Qualtran copied to clipboard
FFT QSP method uses too much memory
The implementation of the FFT QSP method described by this paper uses a lot of memory at high precision. The number of Fourier modes needed to maintain a target precision is dependent on the degree of the polynomial and the target precision itself. The target precision is the largest contributor to the number of needed Fourier modes as the number increases roughly by O(1/target_precision).
Even with a low degree polynomials, a modest precision of 1e-4 can have 1e7 Fourier modes. As each mode is represented as an element of a numpy array, this uses a lot of memory for downstream operations which can cause the program to crash (typically between 1e7 and 1e8 modes).
This method needs to be optimized to use less memory.
After performing some spot checks, I found the maximum precision (order of 10) for each degree that yields < 1e8 Fourier modes:
degree | precision |
---|---|
3 | 1e-4 |
5 | 1e-4 |
10 | 1e-3 |
20 | 1e-2 |
50 | 1e-2 |