Package: pantea
DescriptionPantea is an optimized Python library on basis of GoogleJAXthat enables
development of machine learning inter-atomic potentials
for use in computational physics.
These potentials are necessary for conducting large-scale molecular
dynamics simulations of complex materials with ab initio accuracy.Seedocumentationfor more information.FeaturesThe design of Pantea issimpleandflexible, which makes it easy to incorporate atomic descriptors and potentials.It usesautomatic differentiationto make defining new descriptors straightforward.Pantea is written purely in Python and optimized withjust-in-time(JIT) compilation.It also supportsGPU-acceleratedcomputing, which can significantly speed up preprocessing and model training.WarningThis package is under heavy development and the current focus is on the implementation of high-dimensional
neural network potential (HDNNP) proposed by Behler et al.
(2007).InstallationTo install Pantea, run this command in your terminal:$pipinstallpanteaFor machines with an NVIDIAGPUplease follow theinstallationinstruction on the documentation.ExamplesDefining an ACSF descriptorThis script demonstrates the process of evaluating an array of atomic-centered symmetry functions (ACSF)
for a specific element, which can be utilized to evaluate the descriptor values for any structure.
The resulting values can then be used to construct a machine learning potential.frompantea.datasetsimportDatasetfrompantea.descriptorsimportACSFfrompantea.descriptors.acsfimportCutoffFunction,G2,G3# Read atomic structure dataset (e.g. water molecules)structures=Dataset.from_runner('input.data')structure=structures[0]print(structure)# >> Structure(natoms=12, elements=('H', 'O'), dtype=float64)# Define an ACSF descriptor for hydrogen# It includes two radial (G2) and angular (G3) symmetry functionsdescriptor=ACSF('H')cfn=CutoffFunction.from_cutoff_type(r_cutoff=12.0,cutoff_type='tanh')descriptor.add(G2(cfn,eta=0.5,r_shift=0.0),'H')descriptor.add(G3(cfn,eta=0.001,zeta=2.0,lambda0=1.0,r_shift=12.0),'H','O')print(descriptor)# >> ACSF(central_element='H', symmetry_functions=2)values=descriptor(structure)print("Descriptor values:\n",values)# >> Descriptor values:# [[0.01952943 1.13103234]#  [0.01952756 1.04312263]# ...#  [0.00228752 0.41445455]]gradient=descriptor.grad(structure,atom_index=0)print("Descriptor gradient:\n",gradient)# >> Descriptor gradient:# [[ 0.04645236 -0.05037861 -0.06146214]# [-0.10481855 -0.01841708  0.04760214]]Training an NNP potentialThis example illustrates how to quickly create ahigh-dimensional neural network
potential(HDNNP) instance from an in input setting files and train it on input structures.
The trained potential can then be used to evaluate the energy and force components for new structures.frompantea.datasetsimportDatasetfrompantea.potentialsimportNeuralNetworkPotentialstructures=Dataset.from_runner("input.data")structure=structures[0]nnp=NeuralNetworkPotential.from_file("input.nn")nnp.fit_scaler(structures)nnp.fit_model(structures)total_energy=nnp(structure)print(total_energy)forces=nnp.compute_forces(structure)print(forces)Example files:input.dataandinput.nnLicenseThis project is licensed under the GNU General Public License (GPL) version 3 -
see theLICENSEfile for details.