openWFN: lightweight wavefunction geometry analysis toolkit
Project description
openWFN
openWFN (open WaveFunction Network) is a lightweight toolkit for molecular geometry post-processing from Gaussian checkpoint data.
It is built for users who want:
- fast command-line geometry analysis from
.fchkfiles - reproducible atom-index-based calculations
- a minimal, script-friendly toolchain with low dependencies
Key Capabilities
- Read Gaussian
.fchkfiles - Convert
.chkto.fchkautomatically whenformchkis available - Convert coordinate units from Bohr to Angstrom internally
- Calculate distance, angle, and dihedral from atom indices
- Detect covalent bonds using tabulated covalent radii
- Build molecular fragments (connected components)
- Export coordinates to XYZ format
- Run in command mode or interactive terminal menu mode
Requirements
- Python 3.10+
numpy- Gaussian
formchkonly if you provide.chkfiles
Installation
git clone https://github.com/sha786muhammed/openWFN.git
cd openWFN
pip install -e .
Quick Start
Use one of the included examples:
openwfn examples/water/water.fchk summary
openwfn examples/ammonia/ammonia.fchk dist 1 2
openwfn examples/methane/methane.fchk graph
openwfn examples/water/water.fchk xyz water.xyz
If no subcommand is provided:
- in a TTY terminal, openWFN starts interactive mode
- in non-interactive contexts, openWFN runs
summary
Command Reference
General form:
openwfn <file.chk|file.fchk> <command> [arguments]
Available commands:
summary: one-page molecular overview (formula, atom count, charge, multiplicity, center of mass, energy if present, bonds, fragments)info: print parsed scalar metadata from FCHKdist i j: distance in Angstrom between atomiand atomjangle i j k: bond angle (i-j-k) in degreesdihedral i j k l: torsion angle (i-j-k-l) in degreesbonds: print detected covalent bonds and distancesgraph: print molecular fragments (connected components)xyz output.xyz: export Cartesian coordinates to XYZ fileinteractive: force interactive menu modedensity --export out.vtk [--grid-size NxNxN]: experimental density-export pathway; currently unavailable and exits with an errormo <index> --export out.vtk: experimental molecular-orbital pathway; currently unavailable and exits with an error
Note:
- geometry and export commands (
summary,info,dist,angle,dihedral,bonds,graph,xyz) are the stable user-facing surface today densityandmoare reserved for future development work and should not be treated as supported end-user commands yet
Get CLI help:
openwfn --help
Interactive Mode Guide
Start:
openwfn examples/water/water.fchk
Main menu options:
Landing page
openWFN
Open WaveFunction Network
A lightweight terminal toolkit for Gaussian .fchk geometry analysis.
Features
1 Molecular summary
2 Detailed metadata
3 Atom index table
4 Distance between two atoms
5 Bond angle (i-j-k)
6 Dihedral angle (i-j-k-l)
7 Export XYZ
8 List detected covalent bonds
9 Show fragments / connectivity
Session
0 Exit
Feature page
Shows the selected feature
Supports `back` to return to the landing page
Supports `exit` to quit openWFN
Typical interactive workflow:
- Start on the landing page and choose a feature number.
- openWFN opens that feature as its own page.
- Use
backto return to the landing page. - Use
exitfrom either the landing page or a feature page to quit immediately.
Input behavior:
- atom indices are 1-based
- invalid indices are reported as errors
- malformed numeric input is rejected and reprompted
backreturns from any feature page to the landing pageexitquits from any page- textual aliases such as
summary,dist,bonds,graph,xyz, andexitare accepted - interactive mode intentionally shows only the working end-user features
Example Sessions
Distance and angle:
openwfn examples/water/water.fchk dist 2 1
openwfn examples/water/water.fchk angle 2 1 3
Molecular summary:
openwfn examples/ammonia/ammonia.fchk summary
Fragment detection:
openwfn examples/methane/methane.fchk graph
XYZ export:
openwfn examples/water/water.fchk xyz outputs/water.xyz
File and Data Notes
- Atomic coordinates in Gaussian FCHK are read in Bohr and converted to Angstrom.
- Geometry commands assume coordinates are present in
Current cartesian coordinates. - Bond detection uses element covalent radii with a fixed scaling factor (currently
1.2in code).
Current Implementation Status
Fully supported and tested:
- parsing of essential scalar and coordinate data
- geometry calculations (
dist,angle,dihedral) - bond detection and graph fragments
- XYZ export
Partially implemented:
densityis exposed for future development, but electron-density evaluation is not implemented yet; the command currently exits with an explanatory error.mois exposed for future development, but molecular-orbital grid evaluation is not implemented yet; the command currently exits with an explanatory error.
Use these two commands only if you are extending the codebase.
Development
Run tests:
pytest -q
Project layout:
src/openwfn/ package source
tests/ unit and CLI regression tests
examples/ sample molecules and Gaussian artifacts
License
MIT License. See LICENSE.
Author
Muhammed Shah Shaji
PhD Researcher, Computational Chemistry
GitHub: https://github.com/sha786muhammed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openwfn-0.4.0.tar.gz.
File metadata
- Download URL: openwfn-0.4.0.tar.gz
- Upload date:
- Size: 26.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22481129ac899030a69ab3665c06ce816d0aa20653d313e50be24860254889f3
|
|
| MD5 |
2c525e3cfd92d64125dd275bc18c4fa4
|
|
| BLAKE2b-256 |
856f2fc141f003e6ad3d8cc17d7bdab6ae6e5706e91856c64020d44dc447deb5
|
File details
Details for the file openwfn-0.4.0-py3-none-any.whl.
File metadata
- Download URL: openwfn-0.4.0-py3-none-any.whl
- Upload date:
- Size: 24.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d985ed6521d8dd2bccd2c641f337a8ef30869799792b24b94036eda5288095b4
|
|
| MD5 |
a25c60f64e78e35332344dbd09ad52fa
|
|
| BLAKE2b-256 |
a97b18f9f85605418db91e06dafaa4664d7f5cd7bef608c8586a1c61c2be9199
|