Closed yanxon closed 3 years ago
Explanation to issue 1: If you look at the atoms in your .traj structure, they are not sorted. For example, the first structure consists of atoms in this fashion: ['Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Pd', 'Pd', 'Au', 'Pd', 'Pd', 'Au', 'Pd', 'Au', 'Au', 'Pd', 'Pd', 'Au', 'Au', 'Pd', 'Au', 'Pd', 'O', 'C', 'O', 'H']
The PyXtal_FF read the atoms in "sorted" slice mode, meaning that your ASE atoms has to be sorted as such:
['Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'Au', 'C', 'H', 'O', 'O', 'Pd', 'Pd', 'Pd', 'Pd', 'Pd', 'Pd', 'Pd', 'Pd', 'Pd']
Although it doesn't really matter if you have all the Pd atoms before all of the Au atoms. The important thing is that all of the Au atoms has to be sorted consecutively. Now the PyXtal_FF can recognize the Au atoms in such slice [0:55]
.
Simple explanation:
Let's say you have Na2Cl2. PyXtal_FF can't recognize ASE atoms in this order: [Na, Cl, Na, Cl]
, [Cl, Na, Na, Cl]
, etc. However, [Na, Na, Cl, Cl]
and [Cl, Cl, Na, Na]
are equivalently acceptable by PyXtal_FF.
Solution to issue 1:
You can write the parse_traj
function as such:
def parse_traj(structure_file):
from ase.build import sort
from ase.io.trajectory import Trajectory
data = []
out_traj = Trajectory(structure_file)
for traj in out_traj:
structure = sort(traj)
energy = traj.get_potential_energy()
force = traj.get_forces()
xjson = {'structure':structure,
'energy':energy,
'force':force,
'stress':None,
'group':'random'}
data.append(xjson)
return data
Solution to issue 2: This is due to typo in PyXtal_FF and it is fix in d589c001ae604765ac24fe0d0ea56d4234d3e55a
@yanxon
can you add the parse_traj
to our code?
@qzhu2017
parse_traj
has been added in 3e07645062adccddfbc46950ff0d52f6f7bbdc2e.
@yanxon yes, I see, thanks.
From Fuzhu (Xi'an Jiaotong University):
But I have written a function to read my .traj file, that already works. If you try to run my python scripts, you should update the init.py file (see the attachment) in the path of "lib/python3.8/site-packages/pyxtal_ff/utilies/init.py". This will not influence the reading of other file types (json, xyz, vasp-out). I just added a new format (.traj).
I think the new file-type .traj can keep in the new version of pyxtal_ff, because the data with the .traj file is used in the Amp package.
Issue:
I assumed the package works for several elements existed systems. Run the < run_ase_pyxtal_NN.py >, RuntimeError: The size of tensor a (55) must match the size of tensor b (63) at non-singleton dimension 0.
The linear regression model works on the training.traj data, and the potential was successfully created. (just run < run_ase_pyxtal_PR.py >), but when using the Potential through ase calculator, the error is "NotImplementedError: ACSF is not implemented", seemly the descriptor was not calculated.