cqpes 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
cqpes-2.0.0/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ BSD 2-Clause License
2
+
3
+ Copyright (c) 2024, CQPES
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
19
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
22
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
cqpes-2.0.0/PKG-INFO ADDED
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.4
2
+ Name: cqpes
3
+ Version: 2.0.0
4
+ Summary: A GPU-Aided Software Package for Developing Full-Dimensional Accurate Potential Energy Surfaces
5
+ Author-email: mizu-bai <shiragawa4519@outlook.com>, kshsong <songks@foxmail.com>
6
+ License: BSD 2-Clause Simplified License
7
+ Project-URL: Homepage, https://github.com/CQPES/cqpes-legacy
8
+ Keywords: potential-energy-surface,neural-network,chemical-reaction-dynamics
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: BSD License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
13
+ Requires-Python: >=3.10
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+ Dynamic: license-file
17
+
18
+ # CQPES (ChongQing Potential Energy Surface)
19
+
20
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/CQPES/cqpes-legacy)
21
+
22
+ This package is a Python implementation of potential energy surface (PES) fitting with permutational invariant polynomials neural network (PIP-NN).
23
+
24
+ Paper: [CQPES: A GPU-Aided Software Package for Developing Full-Dimensional Accurate Potential Energy Surfaces by Permutation-Invariant-Polynomial Neural Network](https://doi.org/10.3390/chemistry7060201)
25
+
26
+ If CQPES helps your work, please cite correctly.
27
+
28
+ > Li, J.; Song, K.; Li, J. CQPES: A GPU-Aided Software Package for Developing Full-Dimensional Accurate Potential Energy Surfaces by Permutation-Invariant-Polynomial Neural Network. _Chemistry (Basel)_ **2025**, _7_ (6), 201. https://doi.org/10.3390/chemistry7060201.
29
+
30
+ ## Installation
31
+
32
+ We provide pre-packaged installers including all dependencies (TensorFlow, CUDA, etc.). This is the most stable way to use CQPES.
33
+
34
+ ### Step 1: Deploy the Environment
35
+
36
+ Download the installer from [Releases](https://github.com/cqpes/cqpes-legacy/releases).
37
+
38
+ Run the installer:
39
+
40
+ ```bash
41
+ # cpu version
42
+ $ bash ./cqpes-cpu-2.0.0-Linux-x86_64.sh
43
+ # cuda version
44
+ $ cat cqpes-cu120-2.0.0-Linux-x86_64.sh.part* > cqpes-cu120-2.0.0-Linux-x86_64.sh
45
+ $ bash ./cqpes-cu120-2.0.0-Linux-x86_64.sh
46
+ ```
47
+
48
+ ### Step 2: Install CQPES
49
+
50
+ ```bash
51
+ $ conda activate /path/to/cqpes-env
52
+ (cqpes-env)$ git clone https://github.com/CQPES/cqpes-legacy.git
53
+ (cqpes-env)$ cd cqpes-legacy
54
+ (cqpes-env)$ pip install -e .
55
+ ```
56
+
57
+ ### Step 3: Verify the installation
58
+
59
+ ```bash
60
+ (cqpes-env)$ cqpes -h
61
+ usage: cqpes [-h] [-v] {prepare,train,test,export,predict,run} ...
62
+
63
+ CQPES: GPU-Aided Potential Energy Surface Development Toolkit
64
+
65
+ positional arguments:
66
+ {prepare,train,test,export,predict,run}
67
+ Sub-commands
68
+ prepare Prepare dataset from raw files
69
+ train Train PIP-NN model via Keras & TensorFlow
70
+ test Evaluate model performance and plot errors
71
+ export Export trained model for dynamics interfaces
72
+ predict Predict energies for a given XYZ trajectory
73
+ run Run tasks (Opt, TS, Freq, MD) using trained PES via ASE
74
+
75
+ options:
76
+ -h, --help show this help message and exit
77
+ -v, --version show program's version number and exit
78
+ ```
79
+
80
+ ## The CQPES Workflow
81
+
82
+ CQPES provides a unified Command Line Interface (CLI) for the entire PES development lifecycle: from data preparation and training, to model evaluation and dynamic simulations.
83
+
84
+ You can try the following steps in directory `example/CH4`!
85
+
86
+ ### Step 1. Generate PIP Basis
87
+
88
+ We provide a wrapper for MSA-2.0 to generate the PIP basis. Clone the builder repository:
89
+
90
+ ```bash
91
+ (cqpes-env)$ git clone https://github.com/CQPES/PyMSA-Builder.git
92
+ (cqpes-env)$ cd PyMSA-Builder
93
+ (cqpes-env)$ python3 build.py
94
+ ```
95
+
96
+ Follow the interactive prompts to configure your molecular system (e.g., `4 1` for an A<sub>4</sub>B system like CH<sub>4</sub>). Once built, copy the generated .so library into your working directory.
97
+
98
+ ### Step 2: Prepare Dataset
99
+
100
+ Organize your raw structural data in standard xyz format and your corresponding energies (in Hartree) in a .dat file. Pack them into efficient NumPy arrays using the prepare command:
101
+
102
+ ```bash
103
+ (cqpes-env)$ cqpes prepare config/prepare.json --msa msa.cpython-310-x86_64-linux-gnu.so
104
+ ```
105
+
106
+ This handles the Morse-like variable transformations and structural unpacking automatically based on your JSON configuration.
107
+
108
+ ### Step 3: Model Training
109
+
110
+ Train the PIP-NN model using Levenberg-Marquardt (LM) or other optimizers defined in your configuration file:
111
+
112
+ ```bash
113
+ (cqpes-env)$ cqpes train config/train.json
114
+ ```
115
+
116
+ The trained models and training logs will be saved in a timestamped output path for model, e.g., `model_20260315_123751`.
117
+
118
+ ### Step 4. Model Evaluation
119
+
120
+ Evaluate the accuracy of your trained PES against the test set:
121
+
122
+ ```bash
123
+ (cqpes-env)$ cqpes test model_20260315_123751/
124
+ ```
125
+
126
+ This will automatically compute MAE, MSE, and RMSE for your training, validation, and test subsets. Additionally, fitting error scatter plots and histograms will be generated and saved in the model path for visual diagnostics.
127
+
128
+ ### Step 5. Model Export
129
+
130
+ CQPES can be exported in 2 formats:
131
+
132
+ - Standard Keras `h5` format, required by `predict` and `run` commands
133
+ - Legacy `potfit` plain text format, compatible with fortran interface for software like Polyrate, VENUS96C, or Caracal.
134
+
135
+ ```bash
136
+ (cqpes-env)$ cqpes export -t h5 model_20260315_123751/
137
+ (cqpes-env)$ cqpes export -t potfit model_20260315_123751/
138
+ ```
139
+
140
+ The exported files will be stored in model path.
141
+
142
+ ### Step 6. Property Prediction
143
+
144
+ Quickly predict energies and forces (analytical and numerical) for a given .xyz trajectory using a trained model.
145
+
146
+ ```bash
147
+ (cqpes-env)$ cqpes predict model_20260315_123751 new_trajectory.xyz --output predictions.xyz
148
+ ```
149
+
150
+ ### Step 7. Running Simulations
151
+
152
+ CQPES is fully integrated with the Atomic Simulation Environment (ASE). You can perform high-level computational chemistry tasks directly via the CLI:
153
+
154
+ ```bash
155
+ # Geometry optimization followed by analytical frequency analysis
156
+ (cqpes-env)$ cqpes run model_20260315_123751 ch4.xyz --opt min --freq
157
+
158
+ # Transition State (TS) search (requires Sella)
159
+ (cqpes-env)$ cqpes run model_20260315_123751 guess_ts.xyz --opt ts --freq
160
+
161
+ # Molecular Dynamics (NVT ensemble at 300K)
162
+ (cqpes-env)$ cqpes run model_20260315_123751 input.xyz --md nvt --temp 300.0 --dt 1.0 --steps 5000 -o md.xyz
163
+ ```
164
+
165
+ ## Supported Interfaces & Interoperability
166
+
167
+ ### Python
168
+
169
+ ```python
170
+ from cqpes import CQPESPot, CQPESCalculator
171
+ ```
172
+
173
+ ### Fortran
174
+
175
+ [`example/CH4/interface/Fortran`](https://github.com/CQPES/cqpes-legacy/tree/main/example/CH4/interface/Fortran)
176
+
177
+ ### Gaussian
178
+
179
+ [`example/CH4/interface/Gaussian`](https://github.com/CQPES/cqpes-legacy/tree/main/example/CH4/interface/Gaussian)
180
+
181
+ ### Polyrate
182
+
183
+ [CQPES Legacy + Polyrate](https://github.com/CQPES/cqpes-legacy-polyrate)
184
+
185
+ ### VENUS96
186
+
187
+ [`example/CH4/interface/VENUS96C`](https://github.com/CQPES/cqpes-legacy/tree/main/example/CH4/interface/VENUS96C)
188
+
189
+ ### Caracal
190
+
191
+ ## Reference
192
+
193
+ - (1) Xie, Z.; Bowman, J. M. Permutationally Invariant Polynomial Basis for Molecular Energy Surface Fitting via Monomial Symmetrization. _J. Chem. Theory Comput._ **2010**, _6_ (1), 26–34. https://doi.org/10.1021/ct9004917.
194
+ - (2) Nandi, A.; Qu, C.; Bowman, J. M. Using Gradients in Permutationally Invariant Polynomial Potential Fitting: A Demonstration for CH4 Using as Few as 100 Configurations. _J. Chem. Theory Comput._ **2019**, _15_ (5), 2826–2835. https://doi.org/10.1021/acs.jctc.9b00043.
195
+ - (3) Jiang, B.; Guo, H. Permutation Invariant Polynomial Neural Network Approach to Fitting Potential Energy Surfaces. _J. Chem. Phys._ **2013**, _139_ (5). https://doi.org/10.1063/1.4817187.
196
+ - (4) Li, J.; Jiang, B.; Guo, H. Permutation Invariant Polynomial Neural Network Approach to Fitting Potential Energy Surfaces. II. Four-Atom Systems. _J. Chem. Phys._ **2013**, _139_ (20). https://doi.org/10.1063/1.4832697.
197
+ - (5) Li, J.; Song, K.; Li, J. CQPES: A GPU-Aided Software Package for Developing Full-Dimensional Accurate Potential Energy Surfaces by Permutation-Invariant-Polynomial Neural Network. _Chemistry (Basel)_ **2025**, _7_ (6), 201. https://doi.org/10.3390/chemistry7060201.
cqpes-2.0.0/README.md ADDED
@@ -0,0 +1,180 @@
1
+ # CQPES (ChongQing Potential Energy Surface)
2
+
3
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/CQPES/cqpes-legacy)
4
+
5
+ This package is a Python implementation of potential energy surface (PES) fitting with permutational invariant polynomials neural network (PIP-NN).
6
+
7
+ Paper: [CQPES: A GPU-Aided Software Package for Developing Full-Dimensional Accurate Potential Energy Surfaces by Permutation-Invariant-Polynomial Neural Network](https://doi.org/10.3390/chemistry7060201)
8
+
9
+ If CQPES helps your work, please cite correctly.
10
+
11
+ > Li, J.; Song, K.; Li, J. CQPES: A GPU-Aided Software Package for Developing Full-Dimensional Accurate Potential Energy Surfaces by Permutation-Invariant-Polynomial Neural Network. _Chemistry (Basel)_ **2025**, _7_ (6), 201. https://doi.org/10.3390/chemistry7060201.
12
+
13
+ ## Installation
14
+
15
+ We provide pre-packaged installers including all dependencies (TensorFlow, CUDA, etc.). This is the most stable way to use CQPES.
16
+
17
+ ### Step 1: Deploy the Environment
18
+
19
+ Download the installer from [Releases](https://github.com/cqpes/cqpes-legacy/releases).
20
+
21
+ Run the installer:
22
+
23
+ ```bash
24
+ # cpu version
25
+ $ bash ./cqpes-cpu-2.0.0-Linux-x86_64.sh
26
+ # cuda version
27
+ $ cat cqpes-cu120-2.0.0-Linux-x86_64.sh.part* > cqpes-cu120-2.0.0-Linux-x86_64.sh
28
+ $ bash ./cqpes-cu120-2.0.0-Linux-x86_64.sh
29
+ ```
30
+
31
+ ### Step 2: Install CQPES
32
+
33
+ ```bash
34
+ $ conda activate /path/to/cqpes-env
35
+ (cqpes-env)$ git clone https://github.com/CQPES/cqpes-legacy.git
36
+ (cqpes-env)$ cd cqpes-legacy
37
+ (cqpes-env)$ pip install -e .
38
+ ```
39
+
40
+ ### Step 3: Verify the installation
41
+
42
+ ```bash
43
+ (cqpes-env)$ cqpes -h
44
+ usage: cqpes [-h] [-v] {prepare,train,test,export,predict,run} ...
45
+
46
+ CQPES: GPU-Aided Potential Energy Surface Development Toolkit
47
+
48
+ positional arguments:
49
+ {prepare,train,test,export,predict,run}
50
+ Sub-commands
51
+ prepare Prepare dataset from raw files
52
+ train Train PIP-NN model via Keras & TensorFlow
53
+ test Evaluate model performance and plot errors
54
+ export Export trained model for dynamics interfaces
55
+ predict Predict energies for a given XYZ trajectory
56
+ run Run tasks (Opt, TS, Freq, MD) using trained PES via ASE
57
+
58
+ options:
59
+ -h, --help show this help message and exit
60
+ -v, --version show program's version number and exit
61
+ ```
62
+
63
+ ## The CQPES Workflow
64
+
65
+ CQPES provides a unified Command Line Interface (CLI) for the entire PES development lifecycle: from data preparation and training, to model evaluation and dynamic simulations.
66
+
67
+ You can try the following steps in directory `example/CH4`!
68
+
69
+ ### Step 1. Generate PIP Basis
70
+
71
+ We provide a wrapper for MSA-2.0 to generate the PIP basis. Clone the builder repository:
72
+
73
+ ```bash
74
+ (cqpes-env)$ git clone https://github.com/CQPES/PyMSA-Builder.git
75
+ (cqpes-env)$ cd PyMSA-Builder
76
+ (cqpes-env)$ python3 build.py
77
+ ```
78
+
79
+ Follow the interactive prompts to configure your molecular system (e.g., `4 1` for an A<sub>4</sub>B system like CH<sub>4</sub>). Once built, copy the generated .so library into your working directory.
80
+
81
+ ### Step 2: Prepare Dataset
82
+
83
+ Organize your raw structural data in standard xyz format and your corresponding energies (in Hartree) in a .dat file. Pack them into efficient NumPy arrays using the prepare command:
84
+
85
+ ```bash
86
+ (cqpes-env)$ cqpes prepare config/prepare.json --msa msa.cpython-310-x86_64-linux-gnu.so
87
+ ```
88
+
89
+ This handles the Morse-like variable transformations and structural unpacking automatically based on your JSON configuration.
90
+
91
+ ### Step 3: Model Training
92
+
93
+ Train the PIP-NN model using Levenberg-Marquardt (LM) or other optimizers defined in your configuration file:
94
+
95
+ ```bash
96
+ (cqpes-env)$ cqpes train config/train.json
97
+ ```
98
+
99
+ The trained models and training logs will be saved in a timestamped output path for model, e.g., `model_20260315_123751`.
100
+
101
+ ### Step 4. Model Evaluation
102
+
103
+ Evaluate the accuracy of your trained PES against the test set:
104
+
105
+ ```bash
106
+ (cqpes-env)$ cqpes test model_20260315_123751/
107
+ ```
108
+
109
+ This will automatically compute MAE, MSE, and RMSE for your training, validation, and test subsets. Additionally, fitting error scatter plots and histograms will be generated and saved in the model path for visual diagnostics.
110
+
111
+ ### Step 5. Model Export
112
+
113
+ CQPES can be exported in 2 formats:
114
+
115
+ - Standard Keras `h5` format, required by `predict` and `run` commands
116
+ - Legacy `potfit` plain text format, compatible with fortran interface for software like Polyrate, VENUS96C, or Caracal.
117
+
118
+ ```bash
119
+ (cqpes-env)$ cqpes export -t h5 model_20260315_123751/
120
+ (cqpes-env)$ cqpes export -t potfit model_20260315_123751/
121
+ ```
122
+
123
+ The exported files will be stored in model path.
124
+
125
+ ### Step 6. Property Prediction
126
+
127
+ Quickly predict energies and forces (analytical and numerical) for a given .xyz trajectory using a trained model.
128
+
129
+ ```bash
130
+ (cqpes-env)$ cqpes predict model_20260315_123751 new_trajectory.xyz --output predictions.xyz
131
+ ```
132
+
133
+ ### Step 7. Running Simulations
134
+
135
+ CQPES is fully integrated with the Atomic Simulation Environment (ASE). You can perform high-level computational chemistry tasks directly via the CLI:
136
+
137
+ ```bash
138
+ # Geometry optimization followed by analytical frequency analysis
139
+ (cqpes-env)$ cqpes run model_20260315_123751 ch4.xyz --opt min --freq
140
+
141
+ # Transition State (TS) search (requires Sella)
142
+ (cqpes-env)$ cqpes run model_20260315_123751 guess_ts.xyz --opt ts --freq
143
+
144
+ # Molecular Dynamics (NVT ensemble at 300K)
145
+ (cqpes-env)$ cqpes run model_20260315_123751 input.xyz --md nvt --temp 300.0 --dt 1.0 --steps 5000 -o md.xyz
146
+ ```
147
+
148
+ ## Supported Interfaces & Interoperability
149
+
150
+ ### Python
151
+
152
+ ```python
153
+ from cqpes import CQPESPot, CQPESCalculator
154
+ ```
155
+
156
+ ### Fortran
157
+
158
+ [`example/CH4/interface/Fortran`](https://github.com/CQPES/cqpes-legacy/tree/main/example/CH4/interface/Fortran)
159
+
160
+ ### Gaussian
161
+
162
+ [`example/CH4/interface/Gaussian`](https://github.com/CQPES/cqpes-legacy/tree/main/example/CH4/interface/Gaussian)
163
+
164
+ ### Polyrate
165
+
166
+ [CQPES Legacy + Polyrate](https://github.com/CQPES/cqpes-legacy-polyrate)
167
+
168
+ ### VENUS96
169
+
170
+ [`example/CH4/interface/VENUS96C`](https://github.com/CQPES/cqpes-legacy/tree/main/example/CH4/interface/VENUS96C)
171
+
172
+ ### Caracal
173
+
174
+ ## Reference
175
+
176
+ - (1) Xie, Z.; Bowman, J. M. Permutationally Invariant Polynomial Basis for Molecular Energy Surface Fitting via Monomial Symmetrization. _J. Chem. Theory Comput._ **2010**, _6_ (1), 26–34. https://doi.org/10.1021/ct9004917.
177
+ - (2) Nandi, A.; Qu, C.; Bowman, J. M. Using Gradients in Permutationally Invariant Polynomial Potential Fitting: A Demonstration for CH4 Using as Few as 100 Configurations. _J. Chem. Theory Comput._ **2019**, _15_ (5), 2826–2835. https://doi.org/10.1021/acs.jctc.9b00043.
178
+ - (3) Jiang, B.; Guo, H. Permutation Invariant Polynomial Neural Network Approach to Fitting Potential Energy Surfaces. _J. Chem. Phys._ **2013**, _139_ (5). https://doi.org/10.1063/1.4817187.
179
+ - (4) Li, J.; Jiang, B.; Guo, H. Permutation Invariant Polynomial Neural Network Approach to Fitting Potential Energy Surfaces. II. Four-Atom Systems. _J. Chem. Phys._ **2013**, _139_ (20). https://doi.org/10.1063/1.4832697.
180
+ - (5) Li, J.; Song, K.; Li, J. CQPES: A GPU-Aided Software Package for Developing Full-Dimensional Accurate Potential Energy Surfaces by Permutation-Invariant-Polynomial Neural Network. _Chemistry (Basel)_ **2025**, _7_ (6), 201. https://doi.org/10.3390/chemistry7060201.
@@ -0,0 +1,8 @@
1
+ from .interface import CQPESCalculator, CQPESPot
2
+ from .types import CQPESData
3
+
4
+ __all__ = [
5
+ "CQPESData",
6
+ "CQPESPot",
7
+ "CQPESCalculator",
8
+ ]
File without changes