SPaiNN
Combining SchNet, PaiNN and SHARC – Bridging the Gap between Machine Learning and Photoinduced Dynamics
Install / Use
/learn @CompPhotoChem/SPaiNNREADME
SPaiNN - Equivariant Message Passing for Excited-State Nonadiabatic Molecular Dynamics
<p align="center"> <img src="docs/_static/spainn.svg"> </p>An Interface between SchNetPack and SHARC for performing Machine Learning-accelerated Photodynamics Simulations
Documentation
SPaiNN
SPaiNN is a Python package that provides a flexible and efficient interface to the SchNetPack 2.0<sup>1</sup> package a toolbox for the development and application of deep neural networks to the prediction of potential energy surfaces and other quantum-chemical properties of molecules and materials. SPaiNN allows users to predict energies, forces, dipoles, and non-adiabatic couplings for multiple electronic states, and additionally provides an interface to the SHARC<sup>2</sup> (Surface Hopping including Arbitrary Couplings) software for running excited-state dynamics simulations. SPaiNN is an extension to the SchNarc<sup>3</sup> software, i.e., a python software that combines SchNetPack 1.0<sup>4-7</sup> and SHARC<sup>2</sup>.
Features
- Predict potential energy surfaces of multiple electronic states (SchNet<sup>4-7</sup>, PaiNN<sup>8</sup>)
- Predict vector-properties of multiple electronic states, such as non-adiabatic couplings or dipole moments (SchNet<sup>4-7</sup>, PaiNN<sup>8</sup>)
- Interface to the SHARC<sup>2</sup> software for running excited state dynamics simulations
- Flexible implementation in Python
Requirements
- python 3.8
- SchNetPack 2.0
- Atomic Simulation Environment (ASE) 3.21
- NumPy
- PyTorch 1.9
- PyTorch Lightning 1.9.0
- Hydra 1.1
- SHARC 2.1
Usage
For a quick start, see the tutorials directory, which contains Jupyter Notebooks showing the workflow for predicting PES for multiple electronic states or NACs as vectorial property. You can also consult the documentation for detailed information about the workflows, API and general usage of SPaiNN.
src/
├── spainn/
│ ├── __init__.py
│ ├── calculator.py
│ ├── cli.py
│ ├── loss.py
│ ├── metric.py
│ ├── model.py
│ ├── multidatamodule.py
│ ├── plotting.py
│ ├── properties.py
│ ├── asetools/
│ │ ├── __init__.py
│ │ ├── aseutils.py
│ │ ├── convert_db.py
│ │ └── generate_db.py
│ ├── configs/
│ │ ├── __init__.py
│ │ └── train.yaml
│ └── interface/
│ ├── __init__.py
│ ├── aseinterface.py
│ └── sharcinterface.py
└── scripts/
├── aselen
├── spainn-db
└── spainn-train
tutorials/
├── tut_01_preparing_data.ipynb
├── tut_02_MLFF.ipynb
├── tut_03_MLFF_phase_prop.ipynb
├── tut_04_predictions.ipynbNNpot_butene.ipynb
└── data/
├── schnarc_ch2nh2+.db
└── spainn_ch2nh2+.db
Installation
SPaiNN
SPaiNN can be installed using pip in two ways, either directly
pip install spainn
or from the source code (cloning the repository):
git clone https://github.com/CompPhotoChem/SPaiNN.git
cd SPaiNN
pip install .
SHARC and pySHARC
Install SHARC with pysharc (see SHARC manual; version 2.1.1)
IMPORTANT
Currently there is a not yet fixed bug in pySHARC.
Open source/input_list.f90 and change line 96 from
read(nunit,'(A)', iostat=io) line
to
read(nunit,'(A)', iostat=stat) line
Then open pysharc/sharc/__init__.py there and make the following changes:
#import sharc as sharc
Contributing
Contributions to SPaiNN are welcome! Please refer to the contributing guidelines for more information.
License
SPaiNN is released under the MIT License.
References
- [1] K.T. Schütt, S. S. P. Hessmann, N. W. A. Gebauer, J. Lederer, M. Gastegger, Journal of Chemical Physics 2023, 158, 144801–144801, 10.1063/5.0138367
- [2] S. Mai, M. Richter, M. Heindl, M. F. S. J. Menger, A. Atkins, M. Ruckenbauer, F. Plasser, L.M. Ibele, S. Kropf, M. Oppel, P. Marquetand, L. González, SHARC2.1: Surface Hopping Including Arbitrary Couplings – Program Package for Non-Adiabatic Dynamics 2019, SHARC 2.1
- [3] J. Westermayr, M. Gastegger, P. Marquetand, Phys. Chem. Lett. 2020, 11, 10, 3828–3834, 10.1021/acs.jpclett.0c00527
- [4] K.T. Schütt, P. Kessel, M. Gastegger, K. Nicoli, A. Tkatchenko, K.-R. Müller, J. Chem. Theory Comput. 2019, 15, 1, 448–455, 10.1021/acs.jctc.8b00908
- [5] K.T. Schütt. F. Arbabzadah. S. Chmiela, K.-R. Müller, A. Tkatchenko, Nat. Comm. 2017, 8, 13890, 10.1038/ncomms13890
- [6] K.T. Schütt. P.-J. Kindermans, H. E. Sauceda, S. Chmiela, A. Tkatchenko, K.-R. Müller, Advances in Neural Information Processing Systems 2017, 30, 992-1002, Paper
- [7] K.T. Schütt. P.-J. Kindermans, H. E. Sauceda, S. Chmiela, A. Tkatchenko, K.-R. Müller, J. Chem. Phys. 2018, 148, 24, 241722, 10.1063/1.5019779
- [8] K. T. Schütt, O. T. Unke, M. Gastegger, Proceedings of the 38th International Conference on Machine Learning 2021, PMLR 139:9377-9388, Paper
Related Skills
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
groundhog
399Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
codebase-to-course
Turn any codebase into a beautiful, interactive single-page HTML course that teaches how the code works to non-technical people. Use this skill whenever someone wants to create an interactive course, tutorial, or educational walkthrough from a codebase or project. Also trigger when users mention 'turn this into a course,' 'explain this codebase interactively,' 'teach this code,' 'interactive tutorial from code,' 'codebase walkthrough,' 'learn from this codebase,' or 'make a course from this project.' This skill produces a stunning, self-contained HTML file with scroll-based navigation, animated visualizations, embedded quizzes, and code-with-plain-English side-by-side translations.
academic-pptx
Use this skill whenever the user wants to create or improve a presentation for an academic context — conference papers, seminar talks, thesis defenses, grant briefings, lab meetings, invited lectures, or any presentation where the audience will evaluate reasoning and evidence. Triggers include: 'conference talk', 'seminar slides', 'thesis defense', 'research presentation', 'academic deck', 'academic presentation'. Also triggers when the user asks to 'make slides' in combination with academic content (e.g., 'make slides for my paper on X', 'create a presentation for my dissertation defense', 'build a deck for my grant proposal'). This skill governs CONTENT and STRUCTURE decisions. For the technical work of creating or editing the .pptx file itself, also read the pptx SKILL.md.
