Metadata-Version: 2.4
Name: cowan-runner
Version: 0.1.0
Summary: Automation wrapper for the Cowan atomic structure code
Author: Miguel Carvalho
License: MIT License
        
        Copyright (c) 2026 miguemcarvalhojr-cmd
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Cowan Runner

WARNING:
The Cowan code must be obtained separately.
This tool only automates execution and parsing.


Python automation tool for running the Cowan atomic structure code
and parsing results (Slater integrals, spin–orbit constants) for a given atomic configuration and respective XAS final state

This project does NOT include the Cowan code itself.

------------------------------------------------------------

REQUIREMENTS

You must have the Cowan executables installed and available in your system PATH:

- rcn
- rcn2
- rcg

The original Cowan code is required separately.

------------------------------------------------------------

WHAT THIS TOOL DOES

- Automatically generates IN36
- Runs Cowan (rcn, rcn2, rcg)
- Parses the results
- Extracts:
    • Fk (same-shell)
    • Fk (cross-shell)
    • Gk (exchange)
    • Zeta (spin–orbit)
- Converts all values to eV

------------------------------------------------------------

USAGE

Run:

    python cowan_runner.py

The script will prompt for the required atomic and configuration parameters.

------------------------------------------------------------

EXAMPLE

For Ni²⁺ 3d⁸ with a 2p core hole, run:

    python cowan_runner.py

The script will ask:

    Atomic number (Z): 28
    Element symbol (e.g. Co, Ni, Ce,...): Ni
    Ionization (e.g. 3+): 2+
    Open subshell (e.g. 3d,4d,4f): 3d
    Shell to create a hole (e.g. 2p,3d): 2p
    Occupation number n (e.g. 7 for 3d7): 8

    Select Cowan control mesh:
     90  = non-relativistic
    190 = relativistic (standard)
    290 = relativistic (recommended for heavy atoms / f systems)

    Mesh [290 default]: 290


Example output:

    Time spent: 0 hr 0 min 0.4 sec

    --- Ni2+  3d8 ---
    zeta_3d      = 0.0826 eV
    F2           = 12.2328 eV
    F4           = 7.5969 eV

    --- Ni2+  2p5 3d9 ---
    zeta_2p      = 11.5070 eV
    zeta_3d      = 0.1022 eV
    G1pd         = 5.7829 eV
    F2pd         = 7.7204 eV
    G3pd         = 3.2898 eV
    F2           = 13.0052 eV
    F4           = 8.0836 eV

------------------------------------------------------------

NOTES

- The Cowan CODE directory must be accessible via PATH
- This repository does NOT distribute Cowan binaries
- Designed for atomic multiplet and spectroscopy calculations
- The mesh details can be found on COWAN documentation
------------------------------------------------------------


## Citation

If you use this tool in published work, please cite both this repository and the original Cowan code.

Cowan code:

R. D. Cowan,
"The Theory of Atomic Structure and Spectra",
University of California Press, 1981.

BibTeX:

@book{cowan1981theory,
  title={The Theory of Atomic Structure and Spectra},
  author={Cowan, Robert D.},
  year={1981},
  publisher={University of California Press}
}



LICENSE

MIT License
