Closed peterstangl closed 6 years ago
Similarly to #7, this is due essentially to a crazily large WC ... in this case, the determination of the Higgs potential parameters fails. In this case there is even a try ... except
block in lines 67-70, but the error thrown here is not caught; this is why the error message is not very enlightening.
Ok, so my comment in #7 also applies here.
I will keep the issue open as a reminder to perhaps catch the error and add a corresponding error message.
The NoConvergence
error actually also appears with far less crazily large WCs.
E.g.
mywilson = Wilson({'phiD': 9.678e-06}, 1e3, 'SMEFT', 'Warsaw')
and
mywilson = Wilson({'phiD': 9.679e-06}, 1e3, 'SMEFT', 'Warsaw')
yield an error when trying to run the WCs.
However, for slightly smaller or larger values
mywilson = Wilson({'phiD': 9.677e-06}, 1e3, 'SMEFT', 'Warsaw')
and
mywilson = Wilson({'phiD': 9.680e-06}, 1e3, 'SMEFT', 'Warsaw')
the optimization algorithm does converge.
Changing the algorithm in https://github.com/wilson-eft/wilson/blob/a4bb7946218e2f569470ff080e7ec28805d661c7/wilson/run/smeft/smpar.py#L68 from the standard method='lgmres'
to method='gmres'
leads to convergence in all of the above cases. This is kind of unexpected as according to https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.sparse.linalg.lgmres.html,
The LGMRES algorithm [BJM] [BPh] is designed to avoid some problems in the convergence in restarted GMRES, and often converges in fewer iterations.
An opposite behaviour is observed here.
Only changing the method from method='lgmres'
to method='gmres'
leads to some tests failing (test_Cphi0
with AssertionError: 246.00000012925454 != 246 within 7 places
and test_smpar_roundtrip
with AssertionError: 0.9999936694445539 != 1 within 1e-06 delta : Failed for m_e
). However, this can be resolved by also reducing the tolerance in the optimization by adding f_tol=1e-7
, which does not significantly increase the computing time for the four above cases.
I've tried the other available algorithms ‘bicgstab’, ‘cgs’, ‘minres’
but they lead to non-convergence or other errors when running the tests.
So only method='lgmres'
and method='gmres', f_tol=1e-7
pass all tests, while the latter also leads to convergence in all of the four above cases. I would thus suggest to either replace the former version by the latter one or to modify the try ... except
block such that in case of non-convergence of LGMRES, the GMRES algorithm is tried before throwing an error.
Thanks, very interesting. I would avoid modifying the default chosen by scipy unless necessary, so indeed I think the best way to solve this would be to nest another try ... except
into the original except
that tries with gmres
. Your examples could be added as unit tests.
I have solved this issue in PR #10.
The nested try/except construction may lead to a doubling of computing time. To see how often this actually happens, a warning is issued if the standard algorithm fails to converge. If this should happen frequently, the computational speed could be increased by always using the LGMRES algorithm.
Perfect!
When trying to run Wilson coefficients containing a non-zero value of
phiD
, I receive the following error I am not sure where it is coming from:This error is generated by the following code: