ICAMS / python-ace

Other
57 stars 15 forks source link

Special case for training data that would cause error during active set generation #24

Closed siamak-attarian closed 1 year ago

siamak-attarian commented 1 year ago

This is not actually a question, just something that I came across and thought might be interesting to the users.

I have a system of four species (F, Li, Be and Cr) where Cr is an impurity and there is only one of it in the unit cell. My unit cell size is about 11 angstrom and I'm using cutoff radius of 10 angstrom for training (so the atoms won't see their own periodic images). Since there is only 1 atom of Cr in the system, the the parameters for Cr-Cr end up being zero after the training due to no information about their interaction, which is fine. The problem is when I'm trying to generate an active set I'm getting the following error:

########################### Traceback (most recent call last): File "/home/sattarian/.local/bin/pace_activeset", line 169, in A_active_set_dict = compute_active_set(A0_proj_dict, tol=gamma_tolerance, max_iters=maxvol_iters, verbose=True) File "/home/sattarian/.local/lib/python3.8/site-packages/pyace/activelearning.py", line 285, in compute_active_set selectedrows, = maxvol(cur_A0, tol=tol, max_iters=max_iters) File "/home/sattarian/.local/lib/python3.8/site-packages/maxvolpy/maxvol.py", line 285, in maxvol return maxvol_func(A, tol=tol, max_iters=max_iters, File "maxvolpy/_maxvol.pyx", line 114, in maxvolpy._maxvol.c_maxvol File "maxvolpy/_maxvol.pyx", line 103, in maxvolpy._maxvol.c_maxvol File "maxvolpy/_maxvol.pyx", line 376, in maxvolpy._maxvol.dmaxvol ValueError: Input matrix must not be singular ###########################

After playing with the values in the output_potential.yaml, I learned that I need to increase the cutoff radius for Cr-Cr interactions to something higher than 11 (15 for example) temporarily when doing the active set generation to overcome this issue.

you may want to add a warning or something to check for such scenario before hand so the user won't be confused when facing this error

Thanks, Siamak

yury-lysogorskiy commented 1 year ago

Thank you for noting this. It was fixed in #32