raise a LinearAlgebraError when a solver fails
move some stuff out of pathsample_rates.py and into utils.py