Skip to content

Commit

Permalink
fix some tiny issue on PR model with stress
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhu committed Dec 19, 2022
1 parent d4710fd commit 95ae214
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
# -- Project information -----------------------------------------------------

project = 'PyXtal_FF'
copyright = '2019-2021, Qiang Zhu, Howard Yanxon, David Zagaceta'
copyright = '2019-, Qiang Zhu, Howard Yanxon, David Zagaceta'
author = 'Qiang Zhu, Howard Yanxon, David Zagaceta'

# The short X.Y version
version = '0.2.1'
version = '0.2.2'
# The full version, including alpha/beta/rc tags
release = 'May 2022'
release = 'Dec 2022'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PyXtal_FF
======================================
The aim of PyXtalFF project is to provide an automated computational infrastructure to train the interatomic potentials for inorganic periodic systems from high-end quantum mechanical calculations.

The current version is ``0.2.1`` at `GitHub <https://github.com/qzhu2017/pyxtal_ff>`_.
The current version is ``0.2.2`` at `GitHub <https://github.com/qzhu2017/pyxtal_ff>`_.

Expect updates upon request by `Qiang Zhu\'s group <https://qzhu2017.github.io>`_ at University of Nevada Las Vegas.

Expand Down
1 change: 1 addition & 0 deletions pyxtal_ff/calculator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def calculate(self, atoms=None,

# pyxtal_ff and lammps uses: xx, yy, zz, xy, xz, yz
# ase uses: xx, yy, zz, yz, xz, xy
# vasp uses: xx, yy, zz, xy, yz, zx
# from eV/A^3 to GPa
self.results['stress_zbl'] = base_stress/units.GPa
self.results['energy_zbl'] = base_energy
Expand Down
9 changes: 7 additions & 2 deletions pyxtal_ff/models/polynomialregression.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def evaluate(self, data, figname):
_force.append(Force[m])

if self.stress_coefficient and (db[str(i)]['group'] in self.stress_group):
true_stress = np.array(db[str(i)]['stress'])#.flat[[0,3,5,3,1,4,5,4,2]]
true_stress = np.ravel(db[str(i)]['stress'])#.flat[[0,3,5,3,1,4,5,4,2]]
Stress = np.ravel(Stress)
for m in range(len(true_stress)):
stress.append(true_stress[m])
Expand Down Expand Up @@ -707,6 +707,11 @@ def parse_features(self, data):

for i in range(self.no_of_structures):
data = db[str(i)]
#for key in data.keys():
# if key in ['x', 'dxdr', 'rdxdr', 'seq', 'force']:
# print(key, data[key].shape)
# else:
# print(key, data[key])
#energy = np.array([data['energy']/len(data['elements'])])
energy = np.array([data['energy']])
w_energy = np.array([1.])
Expand All @@ -716,7 +721,7 @@ def parse_features(self, data):
w_force = np.array([self.force_coefficient]*len(force))

if self.stress_coefficient and (data['group'] in self.stress_group): # energy + forces + stress
stress = np.array(data['stress'])#.flat[[0,3,5,3,1,4,5,4,2]]
stress = np.array(data['stress']).ravel()#.flat[[0,3,5,3,1,4,5,4,2]]
w_stress = np.array([self.stress_coefficient]*len(stress))
self.stress_components += 6

Expand Down
2 changes: 1 addition & 1 deletion pyxtal_ff/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.1'
__version__ = '0.2.2'

0 comments on commit 95ae214

Please sign in to comment.