Improve sampling efficiency.
Explain sampling algorithm.
Calculate multiple qn simultaneously.
Flatten input arrays.
Speed up correlations with linalg routines.
todo list.