Alphaharrius / Zipper.jl

Implementation of Zipper Entanglement Renormalization on Julia platform.
GNU General Public License v3.0
1 stars 0 forks source link

Fourier transform is invalid for special `CrystalFockMap`. #12

Closed Alphaharrius closed 8 months ago

Alphaharrius commented 8 months ago

Fourier transform for restricting a CrystalFockMap to a regional SparseFockMap is sometimes not working even with the correct calls to fourier.

Alphaharrius commented 8 months ago

Fixed the issue by implementing a new type FourierMap and InvFourierMap, generated from function fourier, and removing the previous logic of hijacking *(::CrystalFockMap, ::CrystalFockMap) to compute Fourier transform which is the cause of this issue.

Alphaharrius commented 8 months ago

Since FourierMap requires a special handling for its arithmetics, we have introduced a new parallel API paralleldivideconquer which uses multithreaded divide and conquer to speed up execution involves merging large amount of elements, and we have applied this to some functions related to CrystalFockMap.

Yet when using this approach we have encountered segmentation fault in the Julia REPL, most likely due to the result passed from one thread of previous conquer stage is access by another thread, so we added a temporary fix to collect all the result generated by parallel to prevent it from happening, after that the issue seems to be lifted. Due to the issue is happening randomly, we cannot track down the source, thus we encourage users to report if similar issue happens.

Alphaharrius commented 8 months ago

Some of the methods of FourierMap have not been implemented.