Fix CG solver
Fix CG solver

To fix #310, I made some changes to the CG solver:

* Instead of looping over the first axis of the RHS vector, we check for convergence in every time step (due to roundoff errors, convergence is not guaranteed after one full loop).
* I didn't understand how BLAS's ``gemmt`` was used here - as far as I get it, ``gemmt`` is used for matrix-matrix multiplications, and it only updates a triangular part of the resulting matrix. Since we are doing matrix-vector and vector-vector products here, I have replaced it with ``np.dot`` (which also seems to be faster in my crude benchmarks). I don't mean to step on anyone's toes here, though - it might very well be that using ``gemmt`` makes perfect sense and I just didn't see the deeper reason behind it. In that case, we should switch it back.
* I have added the desired solver tolerance as a keyword argument, and set it to the same value as the ``scipy.sparse.cg`` solver.

With this implementation, I achieve the same precision as the SciPy solver, but it is considerably slower than the SciPy (Fortran) version.
madsbk/bohrium,madsbk/bohrium,bh107/bohrium,bh107/bohrium,madsbk/bohrium,bh107/bohrium,bh107/bohrium,madsbk/bohrium