rmjarvis / TreeCorr

Code for efficiently computing 2-point and 3-point correlation functions. For documentation, go to
http://rmjarvis.github.io/TreeCorr/
Other
98 stars 37 forks source link

Make multipole the default algorithm for LogSAS #171

Closed rmjarvis closed 7 months ago

rmjarvis commented 7 months ago

This PR does a few remaining things related to the new multipole 3pt algorithm.

  1. Adds an optional algo parameter for 3pt process calls. The options are 'triangle' and 'multipole'. The former is the old algorithm that recurses down to triangles of 3 cells (or points) and accumulates the triangles directly. The latter is the new multipole algorithm of Porth et al. For LogSAS, it makes a temporary LogMultipole object, runs process on that, and then calls toSAS to get back to the LogSAS binning.
  2. Makes the default algo be 'multipole' when possible and 'triangle' when not possible. I.e. for LogRUV binning, it defaults to the old algorithm, since that's the only one that is possible for that binning. But for LogSAS (the new default binning), it automatically uses the multipole algorithm, unless you explicitly specify algo='triangle'.
  3. Fixes some errors in the shot noise variance estimates for KKK and GGG for LogSAS. There is a factor of 2 required that I don't understand currently. The variance is coming out 2x larger than the normal (vark)^3 / weight formula, but I don't really understand why. It's as though the weight is 2x larger than it should be. Anyway, I'm currently just multiplying the numerator by 2 to fix it, but it would be nice to understand why that is necessary.
  4. Adds a bunch of tests of the variance and fixes some additional bits that weren't quite correct related to patch-based variances for the 3pt functions.