muon-spectroscopy-computational-project / muspinsim

Full quantum simulation of muon experiments
https://muon-spectroscopy-computational-project.github.io/muspinsim/
MIT License
1 stars 0 forks source link

Implement Celio's method #19

Closed joelvdavies closed 1 year ago

joelvdavies commented 2 years ago

This PR implements Celio's method as described https://github.com/muon-spectroscopy-computational-project/Developer-notes/files/9674894/PhysRevLett.56.2720.pdf and here https://undi.readthedocs.io/en/latest/.

There are two variants implemented

Method 1

In general this should be faster than before in cases where the matrix generated is sufficiently sparse which is typically the case for large spins with simple interactions. In these cases it also avoids excessive memory usage as we no longer need to compute any eigenvectors.

To use this, simply add a line in the input file like

celio
    10

The number indicates the order of the Trotter expansion used in the calculation. Passing a value of 0 will revert back to using the old method. Higher values are generally more accurate but in more complex calculations can make the matrix less sparse slowing the calculation down. I have comfortably used values of k = 10000 in testing but values that are too large also risk increasing potential errors in the calculation. The best value of k will be dependent on the exact system.

Additional notes:

Method 2

For an additional speedup also specify a number of averages e.g.

celio
    10 8

Initial states are then randomised and the whole process run 8 times and averaged. This is a lot faster, and again uses less memory. It is also a lot less susceptible to a slowdown when the interactions are more complex. Values of k have a much greater effect on performance however.

Other