File Structure

It is very important to me that humans can understand my code and how to get what they want from it. As LLMs get better at parsing codebases, human understanding and decent documentation can seem less important. But in my experiance, predominately using LLMs makes gaining an intutive sense for code structure much harder. Then, when you want just one thing from a complicated codebase (or heaven forbid nosense bugs happen), things get messy and LLMs often solve nonoptimally. (That said, I did use LLMs to help build this website and still expect others to use them to understand/use COGITO.)

To try and achieve this goal, I have created this interactive visualization of different file inputs and outputs of my different COGITO modules. I hope you enjoy clicking through them and this proves to be a handy reference for understanding the various files of COGITO.

The boxes are bolded if the input/output file is required. The boxes are colored red for quality accessment files and yellow for debug/developer files. More tags and colors will be added when I get more time for it. This is still a bit underdevelopment and as such there may be small errors here and there. For some ridiculous rendering go click ‘bond_cohp_plot.html’ in the COGITOpost output section (it may take a second to load).

COGITO

requiredinput
Used by:COGITO.__init__() [api]
Description
VASP structure file. Always read on initialization regardless of readmode. Provides lattice vectors, atom types, and fractional atom coordinates used to build the real-space structure and local environment tensors.
POSCAR
WAVECAR
POTCAR
OUTCAR
vasprun.xml
IBZKPT
orbitals.npy
COGITO
TBparams.npy
overlaps.npy
TBparams.txt
overlaps.txt
tb_input.txt
orbitals.npy
error_output.txt
orb_converg_info.json
metadata.json
COG_output.txt
fit_cogito.png
init_cogito.png
all_converge_data.json
converg_orbnrmse.npy
converg_radialnrmse.npy
converg_orbnme.npy
converg_radialnme.npy
converg_rad.npy
requiredoutput
Made by:COGITO.get_TBparameter() [api]
COGITO.generate_TBmodel() [api]
run_cogito() [api]
Requires:file_type='npy' (default), version>=0.2.0 Make in CLI:COGITO.py --dir DIR Skip in CLI:COGITO.py --dir DIR --file_type 'txt'
Description
Tight-binding hopping parameters saved as a npy file. Contains real and imaginary parts for each orbital pair and translation vector. Primary input to COGITOpost for all band structure and DOS calculations.

COGITOpost

requiredinput
Used by:COGITO_TB_Model.__init__() [api]
Description
Structural input file for the TB model. Written by COGITO. Contains lattice vectors, atom positions and types, orbital positions and types, spherical harmonic combination vectors, Fermi energy, and energy shift. Read first on initialization of any COGITOpost class.
tb_input.txt
TBparams.npy
overlaps.npy
TBparams.txt
overlaps.txt
EIGENVAL
orbitals.npy
orb_converg_info.json
COGITOpost
all_unique_bonds.json
all_bonds.json
all_atoms.json
bond_info.txt
ICOHP.npy
ICOOP.npy
bond_occup.npy
small_ham.npy
small_over.npy
DFT_band_error.txt
compareDFT.png
tbparams_decay.png
overlaps_decay.png
crystal_bonds.html
bond_cohp_plot.html
crystal_bond_density.html
COHP_DOS.png
COOP_DOS.png
projectedDOS.png
bandstruc.png
COHP_BS.html
COOP_BS.html
projectedBS.html
field_splitting.png
requiredoutput
Made by:COGITO_UNIFORM.jsonify_bonddata() [api]
run_cogito_model() [api]
Make in CLI:COGITOpost.py --dir DIR
Description
These three json files include every integrated quantity you may want to analyze! (Band structure or DOS analysis requires more effort.) This file groups the bonds in all_bonds.json so the data is easier to parse. It lists the bond's atom elements, distance, degeneracy, integrated COHP (energy) and COOP (electron count) values.
root
├── O O 2.9 0.4
│   ├── degeneracy
│   ├── bond length
│   ├── cohp
│   ├── coop
│   └── all bonds
├── O O 4.1 0.0
│   ├── degeneracy
│   ├── bond length
│   ├── cohp
│   ├── coop
│   └── all bonds
├── O O 5.5 -0.0
│   ├── degeneracy
│   ├── bond length
│   ├── cohp
│   ├── coop
│   └── all bonds
├── O O 5.7 0.0
│   ├── degeneracy
│   ├── bond length
│   ├── cohp
│   ├── coop
│   └── all bonds
├── O O 6.2 0.0
│   ├── degeneracy
│   ├── bond length
│   ├── cohp
│   ├── coop
│   └── all bonds
├── O O 6.4 0.0
│   ├── degeneracy
│   ├── bond length
│   ├── cohp
│   ├── coop
│   └── all bonds
└── ...

COGITOanalyze

optionalinputquality
Used by:analyze_orb_converg_info() [api]
analyze_all() [api]
Description
JSON file tracking orbital convergence across outer loops. Written by COGITO. Read to check radial change per iteration, orbital radius change, Bloch NRMSE/NME, and Gaussian fit error. Required for analyze_orb_converg_info(); if missing, analyze_all() catches the error and skips.
root
├── orb_type
├── orb_rad
├── orb_change
├── orb_change_periter
├── radial_change_periter
├── bloch_nrmse_iter
└── ...
orb_converg_info.json
error_output.txt
DFT_band_error.txt
COGITOanalyze
orb_change.png
analysis.txt
optionaloutput
Made by:analyze_orb_converg_info() [api]
analyze_all() [api]
Requires:make_change_plot=True (default) Make in CLI:COGITOanalyze.py --dir DIR Skip in CLI:COGITOanalyze.py --dir DIR --no_make_change_plot
Description
Bar chart of percent orbital radius change from the initial POTCAR value to the converged COGITO value, grouped by element and orbital type (s/p/d indicated by bar hatch). Useful for quickly seeing which orbitals changed the most during convergence and whether the changes are chemically reasonable.
example output

COGITOico

requiredinput
Used by:COGITO_ICO.__init__() [api]
Description
Structural input file for the TB model. Written by COGITO. Contains lattice vectors, atom positions and types, orbital positions and types, spherical harmonic combination vectors, Fermi energy, and energy shift. Read first on initialization of COGITO_ICO.
lattice_vecs
    4.05505270     0.00000000     0.00000000
    0.00000000     4.05505270     0.00000000
    0.00000000     0.00000000     5.47357943
atoms
    0.50000000     0.00000000     0.21770996 Pb 14.0000
   -0.00000000     0.50000000     0.78229004 Pb 14.0000
    0.50000000     0.50000000     0.00000000 O  6.0000
    0.00000000     0.00000000    -0.00000000 O  6.0000
orbitals
    0.50000000     0.00000000     0.21770996 0 d
    0.50000000     0.00000000     0.21770996 0 d
    0.50000000     0.00000000     0.21770996 0 d
    0.50000000     0.00000000     0.21770996 0 d
    0.50000000     0.00000000     0.21770996 0 d
    0.50000000     0.00000000     0.21770996 0 s
    0.50000000     0.00000000     0.21770996 0 p
    0.50000000     0.00000000     0.21770996 0 p
    0.50000000     0.00000000     0.21770996 0 p
   -0.00000000     0.50000000     0.78229004 1 d
   -0.00000000     0.50000000     0.78229004 1 d
   -0.00000000     0.50000000     0.78229004 1 d
   -0.00000000     0.50000000     0.78229004 1 d
   -0.00000000     0.50000000     0.78229004 1 d
   -0.00000000     0.50000000     0.78229004 1 s
   -0.00000000     0.50000000     0.78229004 1 p
   -0.00000000     0.50000000     0.78229004 1 p
   -0.00000000     0.50000000     0.78229004 1 p
    0.50000000     0.50000000     0.00000000 2 s
    0.50000000     0.50000000     0.00000000 2 p

...
tb_input.txt
ICOHP.npy
ICOOP.npy
bond_occup.npy
orbitals.npy
COGITOico
ICOHP.npy / ICOOP.npy
crystal_bonds.html
crystal_bond_density.html
optionaloutput
Made by:COGITO_ICO.save_ICOnpy() [api]
Description
Re-saves the ICOHP and ICOOP matrices loaded into COGITO_ICO, one file per spin channel. Useful for converting from the legacy txt format to the faster .npy format, or after any in-place modification of the matrices. Overwrites files with the same name.