openwfn 0.4.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.
- openwfn-0.4.0/LICENSE +22 -0
- openwfn-0.4.0/PKG-INFO +212 -0
- openwfn-0.4.0/README.md +184 -0
- openwfn-0.4.0/pyproject.toml +62 -0
- openwfn-0.4.0/setup.cfg +4 -0
- openwfn-0.4.0/src/openwfn/__init__.py +37 -0
- openwfn-0.4.0/src/openwfn/basis.py +29 -0
- openwfn-0.4.0/src/openwfn/cli.py +188 -0
- openwfn-0.4.0/src/openwfn/commands.py +211 -0
- openwfn-0.4.0/src/openwfn/constants.py +67 -0
- openwfn-0.4.0/src/openwfn/density.py +25 -0
- openwfn-0.4.0/src/openwfn/export.py +66 -0
- openwfn-0.4.0/src/openwfn/fchk.py +164 -0
- openwfn-0.4.0/src/openwfn/geometry.py +175 -0
- openwfn-0.4.0/src/openwfn/graph.py +47 -0
- openwfn-0.4.0/src/openwfn/grid.py +43 -0
- openwfn-0.4.0/src/openwfn/interactive.py +258 -0
- openwfn-0.4.0/src/openwfn/mo.py +54 -0
- openwfn-0.4.0/src/openwfn/utils.py +85 -0
- openwfn-0.4.0/src/openwfn/xyz.py +19 -0
- openwfn-0.4.0/src/openwfn.egg-info/PKG-INFO +212 -0
- openwfn-0.4.0/src/openwfn.egg-info/SOURCES.txt +33 -0
- openwfn-0.4.0/src/openwfn.egg-info/dependency_links.txt +1 -0
- openwfn-0.4.0/src/openwfn.egg-info/entry_points.txt +2 -0
- openwfn-0.4.0/src/openwfn.egg-info/requires.txt +5 -0
- openwfn-0.4.0/src/openwfn.egg-info/top_level.txt +1 -0
- openwfn-0.4.0/tests/test_bonds.py +12 -0
- openwfn-0.4.0/tests/test_cli.py +53 -0
- openwfn-0.4.0/tests/test_constants.py +39 -0
- openwfn-0.4.0/tests/test_export.py +31 -0
- openwfn-0.4.0/tests/test_fchk.py +48 -0
- openwfn-0.4.0/tests/test_geometry.py +31 -0
- openwfn-0.4.0/tests/test_geometry_robustness.py +58 -0
- openwfn-0.4.0/tests/test_interactive.py +44 -0
- openwfn-0.4.0/tests/test_xyz.py +18 -0
openwfn-0.4.0/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Muhammed Shah Shaji
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
openwfn-0.4.0/PKG-INFO
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: openwfn
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary: openWFN: lightweight wavefunction geometry analysis toolkit
|
|
5
|
+
Author: Muhammed Shah Shaji
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/sha786muhammed/openWFN
|
|
8
|
+
Project-URL: Repository, https://github.com/sha786muhammed/openWFN
|
|
9
|
+
Project-URL: Issues, https://github.com/sha786muhammed/openWFN/issues
|
|
10
|
+
Keywords: computational chemistry,gaussian,geometry,molecular modeling,quantum chemistry,wavefunction
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: numpy>=1.20.0
|
|
25
|
+
Provides-Extra: test
|
|
26
|
+
Requires-Dist: pytest; extra == "test"
|
|
27
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
28
|
+
|
|
29
|
+
# openWFN
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+

|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
openWFN (open WaveFunction Network) is a lightweight toolkit for molecular geometry post-processing from Gaussian checkpoint data.
|
|
36
|
+
|
|
37
|
+
It is built for users who want:
|
|
38
|
+
- fast command-line geometry analysis from `.fchk` files
|
|
39
|
+
- reproducible atom-index-based calculations
|
|
40
|
+
- a minimal, script-friendly toolchain with low dependencies
|
|
41
|
+
|
|
42
|
+
## Key Capabilities
|
|
43
|
+
- Read Gaussian `.fchk` files
|
|
44
|
+
- Convert `.chk` to `.fchk` automatically when `formchk` is available
|
|
45
|
+
- Convert coordinate units from Bohr to Angstrom internally
|
|
46
|
+
- Calculate distance, angle, and dihedral from atom indices
|
|
47
|
+
- Detect covalent bonds using tabulated covalent radii
|
|
48
|
+
- Build molecular fragments (connected components)
|
|
49
|
+
- Export coordinates to XYZ format
|
|
50
|
+
- Run in command mode or interactive terminal menu mode
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
- Python 3.10+
|
|
54
|
+
- `numpy`
|
|
55
|
+
- Gaussian `formchk` only if you provide `.chk` files
|
|
56
|
+
|
|
57
|
+
## Installation
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/sha786muhammed/openWFN.git
|
|
60
|
+
cd openWFN
|
|
61
|
+
pip install -e .
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
Use one of the included examples:
|
|
66
|
+
```bash
|
|
67
|
+
openwfn examples/water/water.fchk summary
|
|
68
|
+
openwfn examples/ammonia/ammonia.fchk dist 1 2
|
|
69
|
+
openwfn examples/methane/methane.fchk graph
|
|
70
|
+
openwfn examples/water/water.fchk xyz water.xyz
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If no subcommand is provided:
|
|
74
|
+
- in a TTY terminal, openWFN starts interactive mode
|
|
75
|
+
- in non-interactive contexts, openWFN runs `summary`
|
|
76
|
+
|
|
77
|
+
## Command Reference
|
|
78
|
+
General form:
|
|
79
|
+
```bash
|
|
80
|
+
openwfn <file.chk|file.fchk> <command> [arguments]
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Available commands:
|
|
84
|
+
- `summary`: one-page molecular overview (formula, atom count, charge, multiplicity, center of mass, energy if present, bonds, fragments)
|
|
85
|
+
- `info`: print parsed scalar metadata from FCHK
|
|
86
|
+
- `dist i j`: distance in Angstrom between atom `i` and atom `j`
|
|
87
|
+
- `angle i j k`: bond angle (i-j-k) in degrees
|
|
88
|
+
- `dihedral i j k l`: torsion angle (i-j-k-l) in degrees
|
|
89
|
+
- `bonds`: print detected covalent bonds and distances
|
|
90
|
+
- `graph`: print molecular fragments (connected components)
|
|
91
|
+
- `xyz output.xyz`: export Cartesian coordinates to XYZ file
|
|
92
|
+
- `interactive`: force interactive menu mode
|
|
93
|
+
- `density --export out.vtk [--grid-size NxNxN]`: experimental density-export pathway; currently unavailable and exits with an error
|
|
94
|
+
- `mo <index> --export out.vtk`: experimental molecular-orbital pathway; currently unavailable and exits with an error
|
|
95
|
+
|
|
96
|
+
Note:
|
|
97
|
+
- geometry and export commands (`summary`, `info`, `dist`, `angle`, `dihedral`, `bonds`, `graph`, `xyz`) are the stable user-facing surface today
|
|
98
|
+
- `density` and `mo` are reserved for future development work and should not be treated as supported end-user commands yet
|
|
99
|
+
|
|
100
|
+
Get CLI help:
|
|
101
|
+
```bash
|
|
102
|
+
openwfn --help
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Interactive Mode Guide
|
|
106
|
+
Start:
|
|
107
|
+
```bash
|
|
108
|
+
openwfn examples/water/water.fchk
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Main menu options:
|
|
112
|
+
```text
|
|
113
|
+
Landing page
|
|
114
|
+
openWFN
|
|
115
|
+
Open WaveFunction Network
|
|
116
|
+
A lightweight terminal toolkit for Gaussian .fchk geometry analysis.
|
|
117
|
+
|
|
118
|
+
Features
|
|
119
|
+
1 Molecular summary
|
|
120
|
+
2 Detailed metadata
|
|
121
|
+
3 Atom index table
|
|
122
|
+
4 Distance between two atoms
|
|
123
|
+
5 Bond angle (i-j-k)
|
|
124
|
+
6 Dihedral angle (i-j-k-l)
|
|
125
|
+
7 Export XYZ
|
|
126
|
+
8 List detected covalent bonds
|
|
127
|
+
9 Show fragments / connectivity
|
|
128
|
+
|
|
129
|
+
Session
|
|
130
|
+
0 Exit
|
|
131
|
+
|
|
132
|
+
Feature page
|
|
133
|
+
Shows the selected feature
|
|
134
|
+
Supports `back` to return to the landing page
|
|
135
|
+
Supports `exit` to quit openWFN
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Typical interactive workflow:
|
|
139
|
+
1. Start on the landing page and choose a feature number.
|
|
140
|
+
2. openWFN opens that feature as its own page.
|
|
141
|
+
3. Use `back` to return to the landing page.
|
|
142
|
+
4. Use `exit` from either the landing page or a feature page to quit immediately.
|
|
143
|
+
|
|
144
|
+
Input behavior:
|
|
145
|
+
- atom indices are 1-based
|
|
146
|
+
- invalid indices are reported as errors
|
|
147
|
+
- malformed numeric input is rejected and reprompted
|
|
148
|
+
- `back` returns from any feature page to the landing page
|
|
149
|
+
- `exit` quits from any page
|
|
150
|
+
- textual aliases such as `summary`, `dist`, `bonds`, `graph`, `xyz`, and `exit` are accepted
|
|
151
|
+
- interactive mode intentionally shows only the working end-user features
|
|
152
|
+
|
|
153
|
+
## Example Sessions
|
|
154
|
+
Distance and angle:
|
|
155
|
+
```bash
|
|
156
|
+
openwfn examples/water/water.fchk dist 2 1
|
|
157
|
+
openwfn examples/water/water.fchk angle 2 1 3
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Molecular summary:
|
|
161
|
+
```bash
|
|
162
|
+
openwfn examples/ammonia/ammonia.fchk summary
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Fragment detection:
|
|
166
|
+
```bash
|
|
167
|
+
openwfn examples/methane/methane.fchk graph
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
XYZ export:
|
|
171
|
+
```bash
|
|
172
|
+
openwfn examples/water/water.fchk xyz outputs/water.xyz
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## File and Data Notes
|
|
176
|
+
- Atomic coordinates in Gaussian FCHK are read in Bohr and converted to Angstrom.
|
|
177
|
+
- Geometry commands assume coordinates are present in `Current cartesian coordinates`.
|
|
178
|
+
- Bond detection uses element covalent radii with a fixed scaling factor (currently `1.2` in code).
|
|
179
|
+
|
|
180
|
+
## Current Implementation Status
|
|
181
|
+
Fully supported and tested:
|
|
182
|
+
- parsing of essential scalar and coordinate data
|
|
183
|
+
- geometry calculations (`dist`, `angle`, `dihedral`)
|
|
184
|
+
- bond detection and graph fragments
|
|
185
|
+
- XYZ export
|
|
186
|
+
|
|
187
|
+
Partially implemented:
|
|
188
|
+
- `density` is exposed for future development, but electron-density evaluation is not implemented yet; the command currently exits with an explanatory error.
|
|
189
|
+
- `mo` is exposed for future development, but molecular-orbital grid evaluation is not implemented yet; the command currently exits with an explanatory error.
|
|
190
|
+
|
|
191
|
+
Use these two commands only if you are extending the codebase.
|
|
192
|
+
|
|
193
|
+
## Development
|
|
194
|
+
Run tests:
|
|
195
|
+
```bash
|
|
196
|
+
pytest -q
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Project layout:
|
|
200
|
+
```text
|
|
201
|
+
src/openwfn/ package source
|
|
202
|
+
tests/ unit and CLI regression tests
|
|
203
|
+
examples/ sample molecules and Gaussian artifacts
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## License
|
|
207
|
+
MIT License. See [LICENSE](LICENSE).
|
|
208
|
+
|
|
209
|
+
## Author
|
|
210
|
+
Muhammed Shah Shaji
|
|
211
|
+
PhD Researcher, Computational Chemistry
|
|
212
|
+
GitHub: https://github.com/sha786muhammed
|
openwfn-0.4.0/README.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# openWFN
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
openWFN (open WaveFunction Network) is a lightweight toolkit for molecular geometry post-processing from Gaussian checkpoint data.
|
|
8
|
+
|
|
9
|
+
It is built for users who want:
|
|
10
|
+
- fast command-line geometry analysis from `.fchk` files
|
|
11
|
+
- reproducible atom-index-based calculations
|
|
12
|
+
- a minimal, script-friendly toolchain with low dependencies
|
|
13
|
+
|
|
14
|
+
## Key Capabilities
|
|
15
|
+
- Read Gaussian `.fchk` files
|
|
16
|
+
- Convert `.chk` to `.fchk` automatically when `formchk` is available
|
|
17
|
+
- Convert coordinate units from Bohr to Angstrom internally
|
|
18
|
+
- Calculate distance, angle, and dihedral from atom indices
|
|
19
|
+
- Detect covalent bonds using tabulated covalent radii
|
|
20
|
+
- Build molecular fragments (connected components)
|
|
21
|
+
- Export coordinates to XYZ format
|
|
22
|
+
- Run in command mode or interactive terminal menu mode
|
|
23
|
+
|
|
24
|
+
## Requirements
|
|
25
|
+
- Python 3.10+
|
|
26
|
+
- `numpy`
|
|
27
|
+
- Gaussian `formchk` only if you provide `.chk` files
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
```bash
|
|
31
|
+
git clone https://github.com/sha786muhammed/openWFN.git
|
|
32
|
+
cd openWFN
|
|
33
|
+
pip install -e .
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Quick Start
|
|
37
|
+
Use one of the included examples:
|
|
38
|
+
```bash
|
|
39
|
+
openwfn examples/water/water.fchk summary
|
|
40
|
+
openwfn examples/ammonia/ammonia.fchk dist 1 2
|
|
41
|
+
openwfn examples/methane/methane.fchk graph
|
|
42
|
+
openwfn examples/water/water.fchk xyz water.xyz
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
If no subcommand is provided:
|
|
46
|
+
- in a TTY terminal, openWFN starts interactive mode
|
|
47
|
+
- in non-interactive contexts, openWFN runs `summary`
|
|
48
|
+
|
|
49
|
+
## Command Reference
|
|
50
|
+
General form:
|
|
51
|
+
```bash
|
|
52
|
+
openwfn <file.chk|file.fchk> <command> [arguments]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Available commands:
|
|
56
|
+
- `summary`: one-page molecular overview (formula, atom count, charge, multiplicity, center of mass, energy if present, bonds, fragments)
|
|
57
|
+
- `info`: print parsed scalar metadata from FCHK
|
|
58
|
+
- `dist i j`: distance in Angstrom between atom `i` and atom `j`
|
|
59
|
+
- `angle i j k`: bond angle (i-j-k) in degrees
|
|
60
|
+
- `dihedral i j k l`: torsion angle (i-j-k-l) in degrees
|
|
61
|
+
- `bonds`: print detected covalent bonds and distances
|
|
62
|
+
- `graph`: print molecular fragments (connected components)
|
|
63
|
+
- `xyz output.xyz`: export Cartesian coordinates to XYZ file
|
|
64
|
+
- `interactive`: force interactive menu mode
|
|
65
|
+
- `density --export out.vtk [--grid-size NxNxN]`: experimental density-export pathway; currently unavailable and exits with an error
|
|
66
|
+
- `mo <index> --export out.vtk`: experimental molecular-orbital pathway; currently unavailable and exits with an error
|
|
67
|
+
|
|
68
|
+
Note:
|
|
69
|
+
- geometry and export commands (`summary`, `info`, `dist`, `angle`, `dihedral`, `bonds`, `graph`, `xyz`) are the stable user-facing surface today
|
|
70
|
+
- `density` and `mo` are reserved for future development work and should not be treated as supported end-user commands yet
|
|
71
|
+
|
|
72
|
+
Get CLI help:
|
|
73
|
+
```bash
|
|
74
|
+
openwfn --help
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Interactive Mode Guide
|
|
78
|
+
Start:
|
|
79
|
+
```bash
|
|
80
|
+
openwfn examples/water/water.fchk
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Main menu options:
|
|
84
|
+
```text
|
|
85
|
+
Landing page
|
|
86
|
+
openWFN
|
|
87
|
+
Open WaveFunction Network
|
|
88
|
+
A lightweight terminal toolkit for Gaussian .fchk geometry analysis.
|
|
89
|
+
|
|
90
|
+
Features
|
|
91
|
+
1 Molecular summary
|
|
92
|
+
2 Detailed metadata
|
|
93
|
+
3 Atom index table
|
|
94
|
+
4 Distance between two atoms
|
|
95
|
+
5 Bond angle (i-j-k)
|
|
96
|
+
6 Dihedral angle (i-j-k-l)
|
|
97
|
+
7 Export XYZ
|
|
98
|
+
8 List detected covalent bonds
|
|
99
|
+
9 Show fragments / connectivity
|
|
100
|
+
|
|
101
|
+
Session
|
|
102
|
+
0 Exit
|
|
103
|
+
|
|
104
|
+
Feature page
|
|
105
|
+
Shows the selected feature
|
|
106
|
+
Supports `back` to return to the landing page
|
|
107
|
+
Supports `exit` to quit openWFN
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Typical interactive workflow:
|
|
111
|
+
1. Start on the landing page and choose a feature number.
|
|
112
|
+
2. openWFN opens that feature as its own page.
|
|
113
|
+
3. Use `back` to return to the landing page.
|
|
114
|
+
4. Use `exit` from either the landing page or a feature page to quit immediately.
|
|
115
|
+
|
|
116
|
+
Input behavior:
|
|
117
|
+
- atom indices are 1-based
|
|
118
|
+
- invalid indices are reported as errors
|
|
119
|
+
- malformed numeric input is rejected and reprompted
|
|
120
|
+
- `back` returns from any feature page to the landing page
|
|
121
|
+
- `exit` quits from any page
|
|
122
|
+
- textual aliases such as `summary`, `dist`, `bonds`, `graph`, `xyz`, and `exit` are accepted
|
|
123
|
+
- interactive mode intentionally shows only the working end-user features
|
|
124
|
+
|
|
125
|
+
## Example Sessions
|
|
126
|
+
Distance and angle:
|
|
127
|
+
```bash
|
|
128
|
+
openwfn examples/water/water.fchk dist 2 1
|
|
129
|
+
openwfn examples/water/water.fchk angle 2 1 3
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Molecular summary:
|
|
133
|
+
```bash
|
|
134
|
+
openwfn examples/ammonia/ammonia.fchk summary
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Fragment detection:
|
|
138
|
+
```bash
|
|
139
|
+
openwfn examples/methane/methane.fchk graph
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
XYZ export:
|
|
143
|
+
```bash
|
|
144
|
+
openwfn examples/water/water.fchk xyz outputs/water.xyz
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## File and Data Notes
|
|
148
|
+
- Atomic coordinates in Gaussian FCHK are read in Bohr and converted to Angstrom.
|
|
149
|
+
- Geometry commands assume coordinates are present in `Current cartesian coordinates`.
|
|
150
|
+
- Bond detection uses element covalent radii with a fixed scaling factor (currently `1.2` in code).
|
|
151
|
+
|
|
152
|
+
## Current Implementation Status
|
|
153
|
+
Fully supported and tested:
|
|
154
|
+
- parsing of essential scalar and coordinate data
|
|
155
|
+
- geometry calculations (`dist`, `angle`, `dihedral`)
|
|
156
|
+
- bond detection and graph fragments
|
|
157
|
+
- XYZ export
|
|
158
|
+
|
|
159
|
+
Partially implemented:
|
|
160
|
+
- `density` is exposed for future development, but electron-density evaluation is not implemented yet; the command currently exits with an explanatory error.
|
|
161
|
+
- `mo` is exposed for future development, but molecular-orbital grid evaluation is not implemented yet; the command currently exits with an explanatory error.
|
|
162
|
+
|
|
163
|
+
Use these two commands only if you are extending the codebase.
|
|
164
|
+
|
|
165
|
+
## Development
|
|
166
|
+
Run tests:
|
|
167
|
+
```bash
|
|
168
|
+
pytest -q
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Project layout:
|
|
172
|
+
```text
|
|
173
|
+
src/openwfn/ package source
|
|
174
|
+
tests/ unit and CLI regression tests
|
|
175
|
+
examples/ sample molecules and Gaussian artifacts
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## License
|
|
179
|
+
MIT License. See [LICENSE](LICENSE).
|
|
180
|
+
|
|
181
|
+
## Author
|
|
182
|
+
Muhammed Shah Shaji
|
|
183
|
+
PhD Researcher, Computational Chemistry
|
|
184
|
+
GitHub: https://github.com/sha786muhammed
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "openwfn"
|
|
8
|
+
version = "0.4.0"
|
|
9
|
+
description = "openWFN: lightweight wavefunction geometry analysis toolkit"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
license = { text = "MIT" }
|
|
13
|
+
authors = [{ name = "Muhammed Shah Shaji" }]
|
|
14
|
+
keywords = [
|
|
15
|
+
"computational chemistry",
|
|
16
|
+
"gaussian",
|
|
17
|
+
"geometry",
|
|
18
|
+
"molecular modeling",
|
|
19
|
+
"quantum chemistry",
|
|
20
|
+
"wavefunction",
|
|
21
|
+
]
|
|
22
|
+
classifiers = [
|
|
23
|
+
"Development Status :: 3 - Alpha",
|
|
24
|
+
"Intended Audience :: Science/Research",
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
"Programming Language :: Python :: 3",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
32
|
+
"Topic :: Scientific/Engineering :: Physics",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"numpy>=1.20.0"
|
|
36
|
+
]
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Homepage = "https://github.com/sha786muhammed/openWFN"
|
|
40
|
+
Repository = "https://github.com/sha786muhammed/openWFN"
|
|
41
|
+
Issues = "https://github.com/sha786muhammed/openWFN/issues"
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
openwfn = "openwfn.cli:main"
|
|
46
|
+
|
|
47
|
+
[project.optional-dependencies]
|
|
48
|
+
test = [
|
|
49
|
+
"pytest",
|
|
50
|
+
"pytest-cov"
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[tool.setuptools]
|
|
54
|
+
package-dir = {"" = "src"}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
[tool.setuptools.packages.find]
|
|
58
|
+
where = ["src"]
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
testpaths = ["tests"]
|
openwfn-0.4.0/setup.cfg
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""
|
|
2
|
+
openWFN - open WaveFunction Network
|
|
3
|
+
A lightweight toolkit for wavefunction geometry and spatial property analysis.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
__version__ = "0.4.0"
|
|
7
|
+
|
|
8
|
+
from .fchk import read_fchk, parse_fchk_arrays, parse_fchk_scalars, parse_fchk_density, parse_fchk_basis, parse_fchk_mos # type: ignore
|
|
9
|
+
from .geometry import distance, angle, dihedral, detect_bonds # type: ignore
|
|
10
|
+
from .graph import MolecularGraph, build_graph # type: ignore
|
|
11
|
+
from .basis import eval_s_type_gto # type: ignore
|
|
12
|
+
from .density import compute_density # type: ignore
|
|
13
|
+
from .mo import evaluate_mo # type: ignore
|
|
14
|
+
from .grid import make_bounding_box_grid # type: ignore
|
|
15
|
+
from .export import export_vtk, export_json, export_csv # type: ignore
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"read_fchk",
|
|
19
|
+
"parse_fchk_arrays",
|
|
20
|
+
"parse_fchk_scalars",
|
|
21
|
+
"parse_fchk_density",
|
|
22
|
+
"parse_fchk_basis",
|
|
23
|
+
"parse_fchk_mos",
|
|
24
|
+
"distance",
|
|
25
|
+
"angle",
|
|
26
|
+
"dihedral",
|
|
27
|
+
"detect_bonds",
|
|
28
|
+
"MolecularGraph",
|
|
29
|
+
"build_graph",
|
|
30
|
+
"eval_s_type_gto",
|
|
31
|
+
"compute_density",
|
|
32
|
+
"evaluate_mo",
|
|
33
|
+
"make_bounding_box_grid",
|
|
34
|
+
"export_vtk",
|
|
35
|
+
"export_json",
|
|
36
|
+
"export_csv",
|
|
37
|
+
]
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# src/openwfn/basis.py
|
|
2
|
+
|
|
3
|
+
import numpy as np # type: ignore
|
|
4
|
+
|
|
5
|
+
def eval_s_type_gto(r_points: np.ndarray, center: np.ndarray, alpha: np.ndarray, d: np.ndarray) -> np.ndarray:
|
|
6
|
+
"""
|
|
7
|
+
Vectorized evaluation of an s-type Contracted Gaussian Type Orbital over N points.
|
|
8
|
+
|
|
9
|
+
Args:
|
|
10
|
+
r_points: (N, 3) float array of Cartesian coordinates.
|
|
11
|
+
center: (3,) float array of the basis function center.
|
|
12
|
+
alpha: (K,) float array of orbital exponents.
|
|
13
|
+
d: (K,) float array of orbital contraction coefficients.
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
(N,) float array of the evaluated basis function amplitude at each point.
|
|
17
|
+
"""
|
|
18
|
+
# r_squared: shape (N,)
|
|
19
|
+
r_squared = np.sum((r_points - center)**2, axis=1)
|
|
20
|
+
|
|
21
|
+
# exponentials: shape (N, K)
|
|
22
|
+
# alpha is shape (K,), r_squared is broadcasted by outer product
|
|
23
|
+
exponentials = np.exp(-np.outer(r_squared, alpha))
|
|
24
|
+
|
|
25
|
+
# Contract with coefficients d: shape (N,)
|
|
26
|
+
return np.dot(exponentials, d)
|
|
27
|
+
|
|
28
|
+
# P and D type orbital implementations would go here, multiplying the unnormalized
|
|
29
|
+
# s-type contracted Gaussians by the corresponding cartesian polynomials (x, y, z, xy, x2-y2, etc.)
|