Package: pysipfenn
pySIPFENNSummaryThis repository containspy(Structure-InformedPrediction ofFormationEnergy usingNeuralNetworks) software
package allowing efficient predictions of the energetics of
atomic configurations. The underlying methodology and implementation
is given inAdam M. Krajewski, Jonathan W. Siegel, Jinchao Xu, Zi-Kui Liu,Extensible Structure-Informed Prediction of Formation Energy with improved accuracy and usability employing neural networks, Computational Materials Science, Volume 208, 2022, 111254, DOI:10.1016/j.commatsci.2022.111254While functionalities are similar to the software released along the
paper, this package contains improved methods for featurizing atomic
configurations. Notably, all of them are now written completely in
Python, removing reliance on Java and making extensions of the software
much easier thanks to improved readability. A fuller description of capabilities is
given in documentation athttps://pysipfenn.organd at PSU Phases
Research Lab webpage underhttps://phaseslab.com/sipfenn.Major News:(v0.15.0)A new descriptor (feature vector) calculatordescriptorDefinitions.KS2022_randomSolutionshas been implemented. It is used for structure informed featurization of compositions randomly occupying a lattice, spiritually similar to SQS generation, but also taking into account (1) chemical differences between elements and (2) structural effects. A full description will be given in the upcoming manuscript.(v0.14.0)Users can now take advantage of aPrototype Libraryto obtain common structures from anyCalculatorinstancecwith a simplec.prototypeLibrary['BCC']['structure']. It can be easilyupdatedorappendedwith high-level API or by manually modifyig its YAMLhere.(v0.13.0)Model exports (and more!) to PyTorch, CoreML, and ONNX are now effortless thanks tocore.modelExportersmodule. Please note you need to install pySIPFENN withdevoption (e.g.,pip install "pysipfenn[dev]") to use it. Seedocs here.(v0.12.2)Swith to LGPLv3 allowing for integration with proprietary software developed by CALPHAD community, while supporting the development of new pySIPFENN features for all. Many thanks to our colleagues fromGTT-Technologiesand other participants ofCALPHAD 2023for fruitful discussions.(March 2023 Workshop)We would like to thank all of our amazing attendees for making our workshop, co-organized with theMaterials Genome Foundation, such a success! Over 100 of you simultaneously followed
all exercises and, at the peak, we loaded over 1,200GB of models into the HPC's RAM.ApplicationspySIPFENN is a very flexible tool that can, in principle, be used for
the prediction of any property of interest that depends on an atomic
configuration with very few modifications. The models shipped by
default are trained to predict formation energy because that is what our
research group is interested in; however, if one wanted to predict
Poisson’s ratio and trained a model based on the same features, adding
it would take minutes. Simply add the model in open ONNX format and link
it using themodels.jsonfile, as described in the documentation.Real-World ExamplesIn our line of work, pySIPFENN and the formation energies it predicts are usually used
as a computational engine that generates proto-data for creation of thermodynamic
databases (TDBs) using ESPEI (https://espei.org). The TDBs are then used through
pycalphad (https://pycalphad.org) to predict phase diagrams and other thermodynamic
properties.Another of its uses in our research is guiding the Density Functional Theory (DFT)
calculations as a low-cost screening tool. Their efficient conjunction then drives the
experiments leading to discovery of new materials, as presented in these two papers:Sanghyeok Im, Shun-Li Shang, Nathan D. Smith, Adam M. Krajewski, Timothy
Lichtenstein, Hui Sun, Brandon J. Bocklund, Zi-Kui Liu, Hojong Kim, Thermodynamic
properties of the Nd-Bi system via emf measurements, DFT calculations, machine
learning, and CALPHAD modeling, Acta Materialia, Volume 223,
2022, 117448,https://doi.org/10.1016/j.actamat.2021.117448.Shun-Li Shang, Hui Sun, Bo Pan, Yi Wang, Adam M. Krajewski,
Mihaela Banu, Jingjing Li & Zi-Kui Liu, Forming mechanism of equilibrium and
non-equilibrium metallurgical phases in dissimilar aluminum/steel (Al–Fe) joints.
Nature Scientific Reports 11, 24251 (2021).https://doi.org/10.1038/s41598-021-03578-0InstallationInstalling pySIPFENN is simple and easy by utilizingPyPIpackage repository,conda-forgepackage repository, or by cloning fromGitHubdirectly.
While not required, it is recommended to first set up a virtual environment using venv or Conda. This ensures that (a) one of the required
versions of Python (3.9+) is used and (b) there are no dependency conflicts. If you have Conda installed on your system (seeminicondainstall instructions), you can create a new environment with a simple:conda create -n pysipfenn python=3.10 jupyter numpy 
conda activate pysipfennIf you are managing a large set of dependencies in your project, you may consider usingmambain place ofconda. It is a less mature, but much faster drop-in replacement compatible with existing environments. Seemicromambainstall instructions.StandardIf your main goal is to run pySIPFENN models, provided by us or any other vendor, you need only a subset of the capabilities of our code, so
you can follow with the following install. Simply install pySIPFENN:fromPyPIwithpip:pipinstallpysipfennfromconda-forgewithconda:condainstall-cconda-forgepysipfennfromconda-forgewithmicromamba:micromambainstall-cconda-forgepysipfennfrom source, by cloning. To get a stable version, you can specify a version tag after the URL with--branch <tag_name> --single-branch, or omit it to get the development version (which may have bugs!):gitclonehttps://github.com/PhasesResearchLab/pySIPFENN.gitthen move topySIPFENNdirectory and install in editable (-e) mode.cdpySIPFENN
pipinstall-e.Developer InstallIf you want to utilize pySIPFENN beyond its core functionalities, for instance, to train new models on custom datasets or to export models in different
formats or precisions, you need to install several other dependencies. This can be done by following thefrom sourceinstructions above but appending
the last instruction withdevextrasmarker.pipinstall-e".[dev]"Note:pip install "pysipfenn[dev]"will also work, but will be less conveninet for model modifications (which you likely want to do), as all persisted
files will be located outside your working directory. You can quickly find where, by callingimport pysipfenn; c = pysipfenn.Calculator(); print(c)andCalculatorwill tell you (amongst other things) where they are.ContributingWhat to ContributeIf you wish to contribute to the development of pySIPFENN you are more than welcome to do so by forking the repository and creating a pull request. As of Spring
2024, we are actively developing the code and we should get back to you within a few days. We are also open to collaborations and partnerships, so if you have
an idea for a new feature or a new model, please do not hesitate to contact us through the GitHub issues or byemail.In particular, we are seeking contributions in the following areas:New Models: We are always looking for new models to add to the repository. We have several (yet) unpublished ones for several different properties, so there is a good chance it will work for your case as well. We are happy to provide basic support for training, including using the default model fortransfer learning on small datasets.New Featurizers / Descriptor Sets: We are always looking for new ways to featurize atomic configurations.We areparticularly interestedin including more domain-specific knowledge for different niches of materials science. Our KS2022 does a good job for most materials, but we look to expand it.We arenot looking forfeaturizers that (a) cannot embed a structure into the feature space (e.g., most of the graph representations, which became popular in the last two years) or (b) do not encode physics into the feature space (e.g., raw atomic coordinates or 3D voxel representations).Note: Autoencoders which utilize graph or 3D voxel representations to encode latent space position to predict property/properties fall into the first category andare very welcome.Quality of Life Improvements: We are always looking for ways to make the software easier to use and more efficient for users. If you have an idea for a new data parsing method, or a new way to visualize the results, we would love to hear about it.Rules for ContributingWe are currently very flexible with the rules for contributing, despite being quite opinionated :)Some general guidelines are:Thecoremodule is the only one that should be used by our typical end user. Alltop-level APIs should be defined in thepysipfenn.pythrough theCalculatorclass. APIs operatingontheCalculatorclass, to export or retrain models, should be defined outside it, but withinpysipfenn.coremodule.Allfeaturizers / descriptor calculatorsmustbe self-contained in a single submodule(file or directory) ofpysipfenn.descriptorDefinitions(i.e., not spread around the codebase) and depend only on standard Python library and current pySIPFENN dependencies, includingnumpy,torch,pymatgen,onnx,tqdm. If you need to add a new dependency, please discuss it with us first.All modelsmustbe ONNX models, which can be obtained from almost any machine learning framework. We are happy to help with this process.All new classes, attributes, and methodsmustbe type-annotated. We are happy to help with this process.All new classes, attributes, and methodsmusthave a well-styled docstring. We are happy to help with this process.All functions, classes, and methodsshouldhave explicit inputs, rather than passing a dictionary of parameters (*kwargs). This does require a bit more typing, but it makes the code much easier to use for the end user, who can see in the IDE exactly what parameters are available and what they do.All functions, classes, and methodsshouldexplainwhythey are doing something, not justwhatthey are doing. This is critical for end-users who did not write the code and are trying to understand it. In particular, the default values of parameters should be explained in the docstring.All new featuresmustbe tested with thepytestframework.Coverageshouldbe 100%for new code or close to it for good reasons. We are happy to help with this process.CiteIf you usepySIPFENNsoftware, please consider citing:Adam M. Krajewski, Jonathan W. Siegel, Jinchao Xu, Zi-Kui Liu,Extensible Structure-Informed Prediction of Formation Energy with improved accuracy and usability employing neural networks, Computational Materials Science, Volume 208, 2022, 111254, DOI:10.1016/j.commatsci.2022.111254If you are using predictions from pySIPFENN models accessed throughOPTIMADEfromMPDD, please additionally cite:Matthew L. Evans, Johan Bergsma, ..., Adam M. Krajewski, ..., Zi-Kui Liu, ..., et al.,Developments and applications of the OPTIMADE API for materials discovery, design, and data exchange, 2024,arXiv:2402.00572