co-crawfish 0.1.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.
- co_crawfish-0.1.0/LICENSE +21 -0
- co_crawfish-0.1.0/PKG-INFO +224 -0
- co_crawfish-0.1.0/README.md +204 -0
- co_crawfish-0.1.0/pyproject.toml +64 -0
- co_crawfish-0.1.0/setup.cfg +4 -0
- co_crawfish-0.1.0/src/co_crawfish.egg-info/PKG-INFO +224 -0
- co_crawfish-0.1.0/src/co_crawfish.egg-info/SOURCES.txt +33 -0
- co_crawfish-0.1.0/src/co_crawfish.egg-info/dependency_links.txt +1 -0
- co_crawfish-0.1.0/src/co_crawfish.egg-info/requires.txt +7 -0
- co_crawfish-0.1.0/src/co_crawfish.egg-info/top_level.txt +1 -0
- co_crawfish-0.1.0/src/crawfish/__init__.py +1 -0
- co_crawfish-0.1.0/src/crawfish/core/__init__.py +7 -0
- co_crawfish-0.1.0/src/crawfish/core/elecdata.py +2373 -0
- co_crawfish-0.1.0/src/crawfish/core/operations/__init__.py +0 -0
- co_crawfish-0.1.0/src/crawfish/core/operations/matrix.py +1027 -0
- co_crawfish-0.1.0/src/crawfish/core/operations/scalar.py +78 -0
- co_crawfish-0.1.0/src/crawfish/core/operations/vector.py +159 -0
- co_crawfish-0.1.0/src/crawfish/funcs/__init__.py +8 -0
- co_crawfish-0.1.0/src/crawfish/funcs/dos.py +196 -0
- co_crawfish-0.1.0/src/crawfish/funcs/general.py +349 -0
- co_crawfish-0.1.0/src/crawfish/funcs/pcohp.py +868 -0
- co_crawfish-0.1.0/src/crawfish/funcs/pdos.py +7 -0
- co_crawfish-0.1.0/src/crawfish/io/__init__.py +1 -0
- co_crawfish-0.1.0/src/crawfish/io/data_parsing.py +1389 -0
- co_crawfish-0.1.0/src/crawfish/io/general.py +132 -0
- co_crawfish-0.1.0/src/crawfish/result_changes.py +121 -0
- co_crawfish-0.1.0/src/crawfish/utils/__init__.py +1 -0
- co_crawfish-0.1.0/src/crawfish/utils/arg_correction.py +169 -0
- co_crawfish-0.1.0/src/crawfish/utils/caching.py +507 -0
- co_crawfish-0.1.0/src/crawfish/utils/indexing.py +262 -0
- co_crawfish-0.1.0/src/crawfish/utils/lattice.py +196 -0
- co_crawfish-0.1.0/src/crawfish/utils/symmetry.py +180 -0
- co_crawfish-0.1.0/src/crawfish/utils/testing/__init__.py +93 -0
- co_crawfish-0.1.0/src/crawfish/utils/typing.py +68 -0
- co_crawfish-0.1.0/src/crawfish/utils/versioning.py +96 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Benjamin Rich
|
|
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.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: co-crawfish
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Bonding analysis (pDOS, pCOHP, pCOOP, pCOBI, pCOMO) on JDFTx calculations
|
|
5
|
+
Author-email: Ben Rich <benjamin.rich@colorado.edu>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/benrich37/crawfish
|
|
8
|
+
Project-URL: Issues, https://github.com/benrich37/crawfish/issues
|
|
9
|
+
Requires-Python: >=3.12
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Requires-Dist: matplotlib>=3.8
|
|
13
|
+
Requires-Dist: numpy<3,>=1.25.0
|
|
14
|
+
Requires-Dist: numba>=0.55
|
|
15
|
+
Requires-Dist: scipy
|
|
16
|
+
Requires-Dist: ase>=3.23.0
|
|
17
|
+
Requires-Dist: pymatgen-core!=2026.10.31,>=2026.10.31
|
|
18
|
+
Requires-Dist: libtetrabz>=0.1.1
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
<h1 align="center">
|
|
22
|
+
<picture>
|
|
23
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/70a64716-aa4d-498f-a123-01aa8daccfb6">
|
|
24
|
+
<img alt="Logo" src="https://github.com/user-attachments/assets/70a64716-aa4d-498f-a123-01aa8daccfb6"
|
|
25
|
+
height="400">
|
|
26
|
+
</picture>
|
|
27
|
+
</h1>
|
|
28
|
+
|
|
29
|
+
Crawfish is a Python library for pCOHP analysis on JDFTx calculations.
|
|
30
|
+
|
|
31
|
+
## About `crawfish`
|
|
32
|
+
|
|
33
|
+
Crawfish (originally called ultraSoftCrawfish) is a Python library intended primarily for performing bonding analysis on the output of JDFTx calculations. Its reason for existing (as alluded to in the original name) is that the state-of-the-art COHP analysis software (LOBSTER) only supports calculations with PAW pseudopotentials. While the researchers of LOBSTER have shown unavoidable pitfalls when attempting COHP analysis on non-PAW calculations, COHP analysis on calculations with other pseudopotential types is far from meaningless and still provides tremendous insight. Thus the goal of crawfish is to allow access to COHP analysis for DFT users who do not use PAW pseudopotentials. While this library is intended for JDFTx, `crawfish` also offers support for pCOHP analysis on user-provided system data, whether generated by another DFT software, or created by the user for learning purposes.
|
|
34
|
+
|
|
35
|
+
This README, the docstrings and some warnings cite `notes/theory_audit.md` (findings F1 to F20) and `notes/wannier_and_adaptive_basis.md`. Those development notes hold the derivations behind each fix. They are kept on the `theory_check` branch of this repository, not on `master`. The notes there go up to F15 so far: the write-ups of F16 to F20 as numbered in this README are not in the repository yet.
|
|
36
|
+
|
|
37
|
+
### Notation - format
|
|
38
|
+
All arrays are named in the general format "name_indices", where "name" provides insight to the meaning of the array, and "indices" tells the user the array's dimensionality, and the significance of each dimension. ie for `h_uu`, "h" would signify the system hamiltonian, and "uu" would signify the array is 2-dimensional, where both dimensions correspond to atomic orbitals (meaning of each index name given below). Parts of the indices are also occasionally separated by an underscore for clarity, but are meaningless (ie `s_tj_uu` would be assumed equivalent to `s_tjuu`).
|
|
39
|
+
|
|
40
|
+
### Notation - index definitions
|
|
41
|
+
Spin and k-points are collapsed to a single index `t`, called a "state" (and `nstates` gives the total number of states for a calculation). When un-collapsed, spin is given the index `s` (`nspin`) and steps along the first, second, and third reciprocal lattice vector are given the indices `a`, `b`, and `c` (`nka`, `nkb`, `nkc` = `kfolding`). Bands are indexed always by `j` (`nbands`). Orbitals are indexed by either `u` (`nproj`) ($\mu$) or `v` ($\nu$) (the latter only when distinction of a second orbital index is required).
|
|
42
|
+
|
|
43
|
+
### Notation - array definitions
|
|
44
|
+
1. `proj` is used to signify the projection vector, typically in shape `tju`. In braket notation, `proj_tju[t,j,u]` = $\bra{\phi_\mu}\hat{O}\ket{\psi_j(t)}$, where $\hat O$ is the ultrasoft overlap operator ($\hat O = 1$ for norm-conserving pseudopotentials). The equations below write this as $\bra{\phi_\mu}\psi_j(t)\rangle$ for short.
|
|
45
|
+
2. `e` ($\epsilon$) is used to signify the Kohn-Sham eigenvalues of the DFT calculation, and has either the shape `tj` or `sabcj`.
|
|
46
|
+
3. `wk` is used to signify the weights of each k-point, and has only the shape `t`.
|
|
47
|
+
4. `occ` ($f$) is used to signify the occupation at each state (k-point + spin) and band, and thus has either shape `tj` or `sabcj`.
|
|
48
|
+
5. `coef` ($C$) is used to signify the expansion coefficients of each band in the orbitals, in shape `tju` (`coef_tju`). It equals `proj` in the default orthonormal basis.
|
|
49
|
+
6. `s`, `h` and `d` are used to signify the overlap, Hamiltonian and density matrix of the orbitals at each state, in shape `t_uv` (`s_t_uv`, `h_t_uv`, `d_t_uv`; complex and Hermitian). They are defined under "Provided analysis techniques".
|
|
50
|
+
7. `s_uu`, `p_uu`, `h_uu` (and `s_t_uu`, `p_t_uu`, `h_t_uu`) are the real, unsigned matrices of the legacy formalism (`legacy_matrices=True`), defined at the end of "Provided analysis techniques".
|
|
51
|
+
|
|
52
|
+
### Units
|
|
53
|
+
Unless otherwise indicated, all energies are in **Hartrees** and are not normalized to the Fermi level!!
|
|
54
|
+
|
|
55
|
+
### Occupations and k-point weights
|
|
56
|
+
crawfish follows JDFTx's convention.
|
|
57
|
+
- **Occupations** $f_j(t)$ (`occ_tj`) are per state, in $[0, 1]$.
|
|
58
|
+
- **k-point weights** $w_t$ (`wk_t`) carry the spin factor and sum to 2: each weight is $2/N_k$ for `spintype no-spin`, and $1/N_k$ per spin channel for `z-spin`.
|
|
59
|
+
|
|
60
|
+
With these conventions the electron count is $\sum_{t,j} w_t f_j(t)$.
|
|
61
|
+
|
|
62
|
+
JDFTx writes its `fillings` file in $[0, 2]$ for `no-spin` calculations, so crawfish divides it by 2 when reading it. It then warns if the electron count disagrees with the outfile. Before this was fixed, the raw file values were used, which doubled the electron count, the density matrix and pCOBI for unpolarized calculations. Integrated spectra hid this by dividing occupations by their maximum. Both old behaviours are still available through `edata.legacy_fillings = True`, which is part of the cache key (`notes/theory_audit.md`, finding F4).
|
|
63
|
+
|
|
64
|
+
### Projection modifications
|
|
65
|
+
0. **Orbital phase convention (always on for JDFTx data).** JDFTx builds its atomic orbitals without the $i^l$ factor of the plane-wave expansion, so each dumped projection onto an orbital of angular momentum $l$ is $(-i)^l$ times the projection onto the corresponding real orbital. `crawfish` multiplies JDFTx projections by $i^l$ when loading them, which puts every orbital in the real convention. Before this correction, $Re[T_{\mu,j}^*T_{\nu,j}]$ was essentially zero for orbital pairs whose $l$ differs by an odd number (s-p, p-d), so those interactions were missing from every pair spectrum, and pairs whose $l$ differs by 2 (s-d) had the wrong sign (pDOS was unaffected). The raw projections are still available through `edata.legacy_orbital_phase = True`, which is part of the cache key, for comparing results. With the signed matrices described below, pCOHP, pCOOP and pCOBI don't depend on a phase per orbital, so that setting alone only changes pCOMO. Reproducing the old pair spectra also needs `edata.legacy_matrices = True`. Projections set through `user_proj_tju` are never modified, so they should already use real orbitals. See `notes/theory_audit.md` (finding F1) for the derivation and evidence.
|
|
66
|
+
1. `trim_excess_bands` is a bool class variable of `ElecData` in which only `nproj` bands are included in analysis. By trimming excess bands, the projection vector `proj_tju` becomes square at each state. This has been primarily useful so far as a means of allowing the projections at each state to be normalized for each band and each orbital. Theoretically, this also allows for projections to undergo a band-lowdin-orthogonalization, but the usefulness has not been investigated. Theoretically this also allows for using the dual space of the projections (allowing for less ad-hoc approaches to charge conservation), but this has yet to be implemented. **Deprecated** (setting it warns): it keeps the same `nproj` bands at every k-point, ranked by the sum of $|T|$ over all k-points, and the rescaling of $|T|^2$ isn't a unitary change of the projections. Use enough `elec-n-bands` with `los_orbs` instead (`notes/theory_audit.md`, finding F10).
|
|
67
|
+
2. `los_orbs` is a bool class variable of `ElecData` in which orbitals are made orthogonal to one another via the Lowdin-Orthogonalization technique. This may seem counterintuitive in a framework centered around how orbitals interact with each other, but remember that this orthogonality ($\langle\phi_\mu|\phi_\nu\rangle=\delta_{\mu,\nu}$) does not eliminate overlap between orbitals at individual bands ($\bra{\phi_\mu}\psi_j(t)\rangle\langle\psi_j(t)\ket{\phi_\nu}$), only over the sum of all bands at each state ($\sum_{j}\langle\phi_\mu|\psi_j(t)\rangle\langle\psi_j(t)|\phi_\nu\rangle=\delta_{\mu,\nu}$ for every $t$). The orthogonalization is done separately at each state, within the space of the computed bands. This is an incredibly useful technique when trying to reformulate our calculation in a LCAO picture, as it ensures that for all bonding interactions (bands `j` at state `t` where $c_{\mu,j}(t)^* c_{\nu,j}(t)>0$), there are enough antibonding interactions ($c_{\mu,j}(t)^* c_{\nu,j}(t)<0$) such that the sum over all bands at that state for any orbital pair $\mu,\nu$ sums to $\delta_{\mu,\nu}$. The Lowdin-Orthogonalization technique is the obvious choice for this orthogonalization, as it is simple to employ (takes 5 lines of vectorized numpy processes here) and minimizes the deviation of each projection from the true value (JDFTx will orthogonalize the orbitals if given the argument `band-projection-params yes no` prior to evaluating and dumping the band projections. However, due to the incompleteness of the space spanned by the bands at each state, this orthogonality will be lost when evaluating total overlap with the dumped projections. The same can also be realized for the bands due to the incompleteness of the space spanned by the orbitals). Orbital combinations the bands don't span at a state (overlap eigenvalue below $10^{-6}$ of the largest) are dropped, with a warning, instead of being scaled up to unit weight. If you see that warning, check `edata.orbital_completeness_u` and add bands. Before this was fixed, the cutoff was an absolute $10^{-15}$ on float32 data, so such directions were kept or dropped depending on the sign of rounding noise; `edata.legacy_lowdin_cutoff = True` restores that (`notes/theory_audit.md`, finding F10). The Löwdin step needs complex projections and at least as many bands as orbitals. When either is missing, crawfish switches `los_orbs` off on load, with a warning (for $|T|^2$ files, finding F18).
|
|
68
|
+
|
|
69
|
+
### Matrix modifications
|
|
70
|
+
1. `legacy_matrices` (default `False`) selects how the pair spectra (pCOHP, pCOOP, pCOBI, and pCOMO in the non-orthogonal basis) are built. The default is the signed formalism described below. `True` restores the matrices crawfish used before this was fixed. Those were built from squares of $Re[T_{\mu,j}^*T_{\nu,j}]$, so they carry no sign, and the bonding/antibonding call was wrong whenever the true matrix element is positive (e.g. p–p σ bonds). The legacy formalism is documented at the end of this section, and kept for comparing results (`notes/theory_audit.md`, finding F2; `examples/fix_comparisons/F2_signed_matrices.ipynb`).
|
|
71
|
+
2. `norm_eigs_for_h` (default `True`) measures eigenvalues from the Fermi level when building $H$. In the orthonormal basis (`los_orbs=True`) this changes only diagonal elements, so it has no effect on pair spectra, as long as the Löwdin step dropped no orbital direction. At states where it did (too few bands; crawfish warns on load), $S$ is a projector and not the identity, and pair values then depend on the energy zero: by 1.5% for the N–N IpCOHP of the N2 test calculation with 10 bands. In the non-orthogonal basis, shifting the energy zero by $c$ shifts pCOHP by $-c\cdot\text{pCOOP}$ (Glassey & Hoffmann, J. Chem. Phys. 113, 1698 (2000)). The too-few-bands warning says so where the Löwdin step dropped a direction (finding F15). JDFTx prints the Fermi level only with `elec-smearing`. For a calculation without it, `edata.mu` is the midpoint of the HOMO and LUMO (the highest eigenvalue with occupation ≥ 0.5 and the lowest with occupation ≤ 0.5, as in JDFTx's `eigStats` dump), `edata.mu_is_estimated` is True, and crawfish warns the first time it is used. Set `edata.mu` to override it, then call `edata.reset_cache()`: cached matrices, weights and spectra don't record a hand-set mu (this was already so for calculations with smearing), so results cached with the estimate would otherwise be reused. JDFTx's own Fermi level would lie anywhere in the gap (for the Si test calculation, the `eigStats` "mu" line is 0.2419 Ha against the midpoint 0.2423 Ha). When spin channels or k-points are filled separately (constant fillings with a magnetization), the HOMO can lie above the LUMO; the midpoint is then only an energy zero, and the warning says so. The estimate needs occupations that don't depend on mu: a `fillings` file, or no smearing. Without a LUMO (no empty band), crawfish switches `norm_eigs_for_h` off instead, which the settings string records, and warns where that changes pair values (non-orthogonal basis, or a dropped Löwdin direction). Before this was fixed, the pair spectra of calculations without smearing raised an error (finding F20); the energy zero matters only in the non-orthogonal basis or where a direction was dropped.
|
|
72
|
+
3. `p_uu_consistent` only affects the legacy matrices (`legacy_matrices=True`). It rescales each band's contribution so that $\sum_{\mu,\nu}P_{\mu,\nu}(t,j)=f_j(t)w_t$.
|
|
73
|
+
4. `legacy_cobi_scale` (default `False`): `True` drops the factor 2 of pCOBI, which halves it, as before finding F16 (see "pCOBI scale" below).
|
|
74
|
+
5. `use_ao_matrices` (default `True`) only matters when the calculation directory has JDFTx's `aoOverlap` and `aoHamiltonian` files (`dump End AO`). These are the exact orbital overlap $\langle\phi_\mu|\hat O|\phi_\nu\rangle$ and Hamiltonian $\langle\phi_\mu|\hat H|\phi_\nu\rangle$ at each state (`edata.ao_s_t_uv`, `edata.ao_h_t_uv`). crawfish then uses them for $S$ and $H$ instead of the band sums below, and the coefficients come from the exact overlap.
|
|
75
|
+
- With ortho projections or `los_orbs=True`, the basis is the exact Löwdin orbitals $\phi S^{-1/2}$: $C=T$ (projections onto those orbitals), $H=S^{-1/2}H_{AO}S^{-1/2}$ and $S=1$.
|
|
76
|
+
- With `band-projection-params no no` and `los_orbs=False`, it is the bare orbitals: $C=S^{-1}T$, $H=H_{AO}$ and $S=S_{AO}$.
|
|
77
|
+
|
|
78
|
+
Pair spectra then stop depending on `elec-n-bands`: each computed band's coefficients are exact, and the bands no longer need to span the orbitals. In graphene (SG15, 6x6x1 mesh, 16 bands) the C–C IpCOHP is −0.545 Ha, against −0.468 Ha from band sums. For gas-phase N2, band sums are still about 20% short at 80 bands (`notes/wannier_and_adaptive_basis.md`, section 10.4). `edata.ao_matrices_used` reports whether the matrices were applied, and the setting is part of the cache key.
|
|
79
|
+
|
|
80
|
+
### Provided analysis techniques
|
|
81
|
+
|
|
82
|
+
For the following equations, projections (`proj_tju[t,j,u]`) are short-handed as $T_{\mu,j}(t)=\bra{\phi_\mu}\psi_j(t)\rangle$. Eigenvalues (`e_tj[t,j]`) are notated as $\epsilon_j(t)$, and $\delta(x)$ signifies the delta function ($\delta(x)=\infty$ for $x=0$, $\delta(x)=0$ for $x\neq0$). The following equations are evaluated on an evenly spaced energy array `erange`. By default, gaussian smearing is employed, by which $\delta(E-x)=\frac{1}{\sqrt{\pi\sigma}}e^{-\frac{(E-x)^2}{\sigma}}$, where $\sigma$ is an optional user parameter `sig` (so the standard deviation is $\sqrt{\sigma/2}$). If linear tetrahedron integration (`lti`) is requested, $\sum_{t}w_t\,(\ldots)\,\delta\left(E-\epsilon_j(t)\right)$ is replaced by the Brillouin-zone integral computed by the `libtetrabz` package for each spin channel. Both are normalized, so spectra are densities per Hartree: the total DOS integrates to $\sum_t w_t\, n_\text{bands}$, and Gaussian and LTI spectra share one scale. Before this was fixed, the Gaussian lacked the $1/\sqrt{\pi\sigma}$, and LTI counted the $1/N_k$ of the zone average twice. Peak shapes, `norm_max` and `norm_intg` results are unaffected. `edata.legacy_normalization = True` restores the old scales (`notes/theory_audit.md`, finding F6).
|
|
83
|
+
|
|
84
|
+
The energy grid must be fine enough to resolve the peaks. On a grid of step $h$, the area of a Gaussian peak of standard deviation $s$ differs from its weight by up to $2e^{-2\pi^2(s/h)^2}$, depending on where the eigenvalue falls between grid points: 1.4% at $h=2s$. The default grid step `res` is 1 mHa, under half the standard deviation of the default `sig` ($10^{-5}$ Ha², 2.2 mHa), so peak areas are exact to well below $10^{-6}$. crawfish warns when the step of the grid (from `res`, or a given `erange`) is more than 2 standard deviations of `sig`. An automatic `erange` extends beyond the lowest and highest eigenvalue by 10 `res` or 5 standard deviations, whichever is more (10 `res` for LTI). The integrated functions (`get_i<mode>`) are exact sums and don't depend on the grid. Before this was fixed, the default `res` was 10 mHa, 4.5 standard deviations, so a peak's area on the grid was 0.29 to 1.78 times its weight (the N2 N–N pCOHP integrated to −1.02 Ha up to mid-gap instead of −0.87 Ha), and the pad of 10 `res` cut off the outermost peaks at a fine `res`. `res=0.01` still gives exactly that grid and those spectra (finding F17).
|
|
85
|
+
|
|
86
|
+
#### pDOS
|
|
87
|
+
|
|
88
|
+
Projected density-of-states (pDOS) is primarily included in this package for sanity checks, and is evaluated as
|
|
89
|
+
|
|
90
|
+
$$
|
|
91
|
+
pDOS(E,\mu)=\sum_{j,t}\left|T_{\mu,j}\right|^2w_t\delta(E-\epsilon_j(t))
|
|
92
|
+
$$
|
|
93
|
+
|
|
94
|
+
Here $T$ is `edata.proj_tju` after the projection modifications above. With `los_orbs=True` (default) that is the projection onto the Löwdin-orthonormalized orbitals, so pDOS changes with `los_orbs`. For a `bandProjections` file of $|T|^2$ (`band-projection-params <ortho> yes`), `proj_tju` holds the amplitudes $|T|$, the square roots of the file's values, without the Löwdin step. Before this was fixed, the file's values were used as $T$: pDOS squared them again, and the Löwdin step ran on them (finding F18).
|
|
95
|
+
|
|
96
|
+
#### Pair spectra (pCOHP, pCOOP, pCOBI, pCOMO)
|
|
97
|
+
|
|
98
|
+
Pair spectra use the band-projected orbitals $\chi_\mu = \sum_j \psi_j \langle\psi_j|\hat O|\phi_\mu\rangle$, where $\hat O$ is the ultrasoft overlap operator. JDFTx applies $\hat O$ when it writes the projections, and $\hat O = 1$ for norm-conserving pseudopotentials. Because $\hat H = \sum_j \hat O|\psi_j\rangle\epsilon_j\langle\psi_j|\hat O$ in the generalized (ultrasoft) eigenproblem, at each state $t$:
|
|
99
|
+
|
|
100
|
+
$$
|
|
101
|
+
S_{\mu\nu}(t) = \sum_j T_{\mu,j}T_{\nu,j}^*, \qquad H_{\mu\nu}(t) = \sum_j T_{\mu,j}\,\epsilon_j\,T_{\nu,j}^*, \qquad D_{\mu\nu}(t) = \sum_j f_j\, C_{\mu,j}C_{\nu,j}^*
|
|
102
|
+
$$
|
|
103
|
+
|
|
104
|
+
(`edata.s_t_uv`, `edata.h_t_uv`, `edata.d_t_uv`, which are complex and Hermitian). $C_{\mu,j}(t)$ are the coefficients of $\psi_j$ in the $\chi_\mu$ (`edata.coef_tju`). With `los_orbs=True` (default) the orbitals are Löwdin-orthonormalized within the band space first, so $S=1$ and $C=T$. With `los_orbs=False`, $C = S^{-1}T$ (least squares). For a spectral mode with matrix $M$:
|
|
105
|
+
|
|
106
|
+
$$
|
|
107
|
+
pX(E,\mu,\nu)=\sum_{j,t} w_t\, Re\left[C_{\mu,j}^*\, M_{\mu\nu}\, C_{\nu,j}\right]\delta(E-\epsilon_j(t))
|
|
108
|
+
$$
|
|
109
|
+
|
|
110
|
+
where $M = H$ for **pCOHP** (negative = bonding), $M = S$ for **pCOOP**, $M = 2D$ for **pCOBI** (the Wiberg/Mayer scale; see "pCOBI scale" below), and $M = 1$ for **pCOMO** (Coulson's mobile order).
|
|
111
|
+
|
|
112
|
+
**Which periodic image** of the second atom is meant is set by the `image` argument of every pair function. JDFTx's Bloch sums are $\phi_{\mu k} = \sum_R e^{ik\cdot R}\phi_\mu(r-\tau_\mu-R)$, with $\tau$ the atom positions exactly as JDFTx used them. The image of atom $b$ at $\tau_b+R$ (R in lattice vectors) therefore enters through
|
|
113
|
+
|
|
114
|
+
$$
|
|
115
|
+
M_{\mu\nu}(t) \;\to\; M_{\mu\nu}(R)\,e^{2\pi i k_t\cdot R}, \qquad M_{\mu\nu}(R) = \frac{\sum_{t\in s} w_t\, e^{-2\pi i k_t\cdot R} M_{\mu\nu}(t)}{\sum_{t\in s} w_t}
|
|
116
|
+
$$
|
|
117
|
+
|
|
118
|
+
for each spin channel $s$.
|
|
119
|
+
- `image="nearest"` (default) uses, for each atom pair, the image nearest to the first atom. `get_pair_images(edata, idcs1=..., idcs2=...)` reports the $R$ and bond length used, and crawfish warns when several images are equally near.
|
|
120
|
+
- `image=(n1, n2, n3)` uses that lattice vector for every pair. With $R\neq0$ the two orbital sets may share orbitals: `idcs1=a, idcs2=a, image=R` is atom $a$'s bond with its own image at $R$, including each orbital with its own copy ($\mu=\nu$), which carries 15% to 50% of graphene's second-neighbour C–C IpCOHP, depending on the direction. `get_nearest_images(edata, a, b)` (in `crawfish.funcs`) lists the images of atom $b$ nearest to atom $a$ at a non-zero distance, e.g. graphene's six second neighbours for $b=a$, or the bonds of a one-atom cell. Sets that share orbitals are refused for `"nearest"` (an atom's nearest image of itself is itself), `"all"` and $(0,0,0)$, where $\mu=\nu$ is the on-site term. Before this was fixed, every pair of sets sharing an orbital was refused, and $\mu=\nu$ was left out for every image (finding F19).
|
|
121
|
+
- `image="all"`, or the older `state_sep=True`, uses $M(t)$ directly, summing the interaction over every image.
|
|
122
|
+
|
|
123
|
+
Images other than the same cell need the full k-mesh (run JDFTx with `symmetries none`, or dump `Symmetries`; see "JDFTx settings"). The fcc Al test calculations have a reduced mesh and no `sym` file, so their self-image bonds stay refused. An $N_1\times N_2\times N_3$ mesh can't separate $R$ from $R + (N_1n_1, N_2n_2, N_3n_3)$, so $M(R)$ also contains those far images. Before this was fixed, crawfish always used the same-cell copy ($R=0$) whatever its distance. That is still available through `edata.legacy_lattice_image = True` (`notes/theory_audit.md`, finding F3; `examples/fix_comparisons/F3_lattice_images.ipynb`).
|
|
124
|
+
|
|
125
|
+
Notes:
|
|
126
|
+
- Summing $w_t f_j\,Re[C_{\mu,j}^* H_{\mu\nu} C_{\nu,j}]$ over all bands, all orbital pairs and all lattice images, including the diagonal terms $\mu=\nu$, reproduces the band energy $\sum w f\epsilon$ (measured from the Fermi level when `norm_eigs_for_h=True`), up to the charge spilling of the projection: within 0.6% for the N2 test calculation and 3% for graphene with 20 bands. The pair functions don't return the on-site terms ($\mu=\nu$ in the same cell): they skip them, and refuse orbital sets that share an orbital unless `image` is a lattice vector other than $(0,0,0)$. So `get_ipcohp` can't give the on-site energies (about 70% of the N2 band energy). An atom's interactions with its own periodic images, including those of each orbital with its own copy, are available through an explicit `image` (see above; finding F19).
|
|
127
|
+
- **pCOOP vanishes between different orbitals in an orthonormal basis.** For meaningful pCOOP:
|
|
128
|
+
- run JDFTx with `band-projection-params no no` (non-orthogonal atomic orbitals);
|
|
129
|
+
- set `edata.los_orbs = False`;
|
|
130
|
+
- use enough bands that the orbitals are spanned, or provide JDFTx's AO matrices (`use_ao_matrices`), which give the exact overlap.
|
|
131
|
+
|
|
132
|
+
Without the AO matrices, crawfish builds the overlap from the bands ($S = TT^\dagger$), which approaches $\langle\phi_\mu|\hat O|\phi_\nu\rangle$ as `edata.orbital_completeness_u` approaches 1. For ultrasoft pseudopotentials there is one more approximation: with `band-projection-params no no`, JDFTx applies $\hat O$ to each orbital with the augmentation of that orbital's own atom only (`OpsiRadial`, built in `SpeciesInfo.cpp::setPsi`), not that of its neighbours. Projections onto orthonormalized orbitals (`yes no`) use the full $\hat O$, and norm-conserving pseudopotentials have $\hat O = 1$. crawfish warns when pCOOP is zero (Löwdin basis), when it is only a band-truncation artifact (orthonormalized-orbital projections), and when the selected orbitals' completeness is below 0.85. For gas-phase N2 with non-orthogonal projections, completeness is 0.90–0.99 with 15 bands. The overlaps have the textbook signs (σ between parallel p negative, π positive), and ICOOP changes by less than 0.03 from 15 to 40 bands (`examples/fix_comparisons/F7_coop_basis.ipynb`).
|
|
133
|
+
- **Basis dependence.** pCOHP depends on the orbital basis, and in the non-orthogonal basis also on the energy zero (`norm_eigs_for_h`). For N2, the non-orthogonal basis gives the textbook net-antibonding s–s interaction, while the Löwdin basis gives a bonding one and about 3× the total ICOHP. Compare results within one basis.
|
|
134
|
+
- **pCOMO** has no matrix factor, so its sign depends on how the two orbitals are oriented. For example, a p–p σ bonding combination of parallel p orbitals has $C_{\mu}^*C_{\nu} < 0$. Read it as a bond-order density, not as a bonding indicator.
|
|
135
|
+
- **pCOBI scale.** pCOBI weights are $2w_t\,Re[C_{\mu,j}^*D_{\mu\nu}C_{\nu,j}]$, with $D$ the density matrix of one spin channel (occupations in $[0,1]$). The integrated pCOBI of each orbital pair is then $2W_s|D^s_{\mu\nu}(R)|^2$ summed over spin channels $s$, with $W_s=\sum_{t\in s}w_t$ (2 for `no-spin`, 1 per channel for `z-spin`), so it is non-negative. Summed over the orbitals of two atoms it is the Wiberg/Mayer bond index ($\sum P_{\mu\nu}^2$ with the spin-summed density matrix $P=2D$ for closed shells, $2\sum_s\sum|D^s_{\mu\nu}|^2$ in general), on which COBI is built (Müller et al., J. Phys. Chem. C 125, 7959 (2021)): a single bond gives about 1. For the N2 test calculations IpCOBI is 2.98 (a triple bond), and for a graphene C–C bond 1.22, equal to a float64 evaluation of the index to $10^{-6}$. `no-spin` and `z-spin` calculations of the same system agree. It hasn't been compared with LOBSTER output. Before this was fixed, the factor 2 was missing, so IpCOBI was half the bond index (1.49 for N2). `edata.legacy_cobi_scale = True` restores that, and is part of the cache key (finding F16; `examples/fix_comparisons/F16_F20_cobi_scale_grid_and_inputs.ipynb`).
|
|
136
|
+
|
|
137
|
+
#### Legacy formalism (`legacy_matrices=True`)
|
|
138
|
+
|
|
139
|
+
Kept for reference. These definitions give wrong signs (see above).
|
|
140
|
+
|
|
141
|
+
$$
|
|
142
|
+
pX_{legacy}(E,\mu,\nu)=M_{\mu,\nu}\sum_{j,t}Re\left[T_{\mu,j}^*T_{\nu,j}\right]w_t\delta(E-\epsilon_j(t)),\qquad M \in \{H, S, P, 1\}
|
|
143
|
+
$$
|
|
144
|
+
|
|
145
|
+
$$
|
|
146
|
+
H_{\mu,\nu} = \sum_{j,t} P_{j,t,\mu,\nu} \epsilon_{j,t}, \qquad P_{j,t,\mu,\nu} = S_{j,t,\mu,\nu} f_j(t) w_t, \qquad S_{j,t,\mu,\nu} = \left(Re\left[\langle \mu | \psi_j(t) \rangle \langle \psi_j(t) | \nu \rangle\right]\right)^2
|
|
147
|
+
$$
|
|
148
|
+
|
|
149
|
+
(with $P$ renormalized per band when `p_uu_consistent=True`, and $\epsilon$ shifted by $\mu$ when `norm_eigs_for_h=True`).
|
|
150
|
+
|
|
151
|
+
## Why and when should I use `crawfish`?
|
|
152
|
+
|
|
153
|
+
1. **Non-PAW JDFTx calculations** The intended audience for `crawfish` is anyone curious about the bonding within a non-PAW pseudopotential calculation performed using JDFTx. While LOBSTER is not explicitly supported by JDFTx, the output of any unsupported calculation with PAW pseudopotentials can be converted by the user to mimic the output of a calculation which is supported by LOBSTER, circumventing the need of explicit support. If this is not the case, `crawfish` is here for you.
|
|
154
|
+
2. **General non-PAW calculations** The techniques used by `crawfish` are made available to other DFT calculators, so long as the user is able to acquire the required data to construct an `ElecData` object. The instructions for how to do so are available in the "Creating your own `ElecData`" section of this readme. This process requires providing `crawfish` with the Kohn-Sham eigenvalues, and the projections of each Kohn-Sham wavefunction onto each orbital (as well as some other information that is typically much easier to obtain). If you are interested in doing so, please reach out to me (beri9208@colorado.edu) to help you with any obstacles that might require fixing some less-tested parts of the code.
|
|
155
|
+
|
|
156
|
+
## How to use `crawfish`
|
|
157
|
+
|
|
158
|
+
1. **Create an `ElecData` object** `ElecData` is the class used to house all electronic data and derived tensors for a given calculation. Provided the JDFTx calculation has been run with the required settings (see "JDFTx settings" below), this can be done in one line as `edata = ElecData.from_calc_dir(calc_dir)`, where `ElecData` has been imported from `crawfish.core.elecdata`, and `calc_dir` is either `str` or `Path` giving the full path to your directory containing the calculation output data.
|
|
159
|
+
2. **Change desired settings** If there are any parameters you wish to change that affect the computed tensors required for pCOHP analysis (ie `edata.los_orbs`), you can change these values in the typical fashion (`edata.los_orbs = False`) triggering a re-evaluation of the affected tensors with this change in mind. If you have multiple settings you want to change, you can avoid repeated re-evaluations by changing the setting's private value (`edata._los_orbs = False`) and either remembering to change the final setting through the public value or by running `edata.alloc_elec_data()`.
|
|
160
|
+
3. **Import function(s) for desired analysis** All spectrum-generating functions can be imported from `crawfish.funcs`. For each analysis technique `<mode>` (`dos`, `pdos`, `pcohp`, `pcoop`, `pcobi`, `pcomo`) there is a dos-like spectrum-generating function `get_<mode>` and a spectrum integrating function `get_i<mode>`.
|
|
161
|
+
4. **Generate spectra and plot** Dos-like generating functions and spectrum integrating function will both return a length-2 tuple `erange, spectrum`: the energy-axis values and the corresponding spectrum values. If you are unfamiliar with plotting in Python, this can be easily done with `matplotlib` (the installation of this library ensures your Python environment has this package) by importing `import matplotlib.pyplot as plt` and running `plt.plot(erange, spectrum)`. The arguments for these functions can all be checked in the docstrings for the function definitions.
|
|
162
|
+
|
|
163
|
+
### JDFTx settings
|
|
164
|
+
|
|
165
|
+
| setting | why |
|
|
166
|
+
|---|---|
|
|
167
|
+
| `dump End BandProjections BandEigs Fillings Kpoints Symmetries` | Projections, eigenvalues, occupations, k-point weights and JDFTx's symmetry operations. `Fillings` and `Kpoints` are optional but recommended. Without them, occupations are computed from the smearing and mu (or, without smearing, JDFTx's constant fillings), and weights are read from the `bandProjections` header. Without smearing, JDFTx prints no Fermi level, and crawfish uses the HOMO–LUMO midpoint (see `norm_eigs_for_h`). `Symmetries` writes the `sym` file, which lets crawfish unfold a symmetry-reduced k-mesh (see below). |
|
|
168
|
+
| `band-projection-params yes no` | Complex projections onto orthonormalized orbitals, for pCOHP/pCOBI/pCOMO. Use `no no` for pCOOP, which is identically zero in an orthonormal basis. The second argument must be `no` for any pair spectrum: with `yes`, which is also JDFTx's default when the command is missing, JDFTx writes only $\|T\|^2$. crawfish then gives DOS and pDOS from $\|T\|$, without the Löwdin step, and the pair functions raise an error (finding F18). |
|
|
169
|
+
| `dump End ... AO` (recommended, once JDFTx supports it) | Writes the exact orbital overlap and Hamiltonian (`aoOverlap`, `aoHamiltonian`), which crawfish uses instead of band sums (`edata.use_ao_matrices`, above). Pair spectra are then converged in the number of bands. To add them to a finished calculation that saved its state, run a `dump-only` restart with only `dump End AO`. Write its log to another file (`-o dumponly.out`), because that log has no mu. |
|
|
170
|
+
| `symmetries automatic` (the default) with `dump End ... Symmetries`, or `symmetries none` | Results resolved by atom, bond or m-orbital need every k-point of the mesh. crawfish rebuilds the ones JDFTx skipped from its `sym` file (see below), which is the cheapest option. Without the `sym` file, use `symmetries none`, or `symmetries manual` with only the identity `symmetry-matrix 1 0 0 0 1 0 0 0 1 0 0 0` (JDFTx then reduces only k ↔ −k, which crawfish unfolds without operations). |
|
|
171
|
+
| `spintype no-spin` or `z-spin` | Spinor calculations (`vector-spin`, `spin-orbit`) aren't supported yet: `ElecData` refuses them with an error (`notes/theory_audit.md`, finding F9). |
|
|
172
|
+
| `elec-n-bands` well above the number of orbitals | The bands must span the atomic orbitals at every k-point, including antibonding (σ*) states. With too few bands (e.g. as many bands as orbitals), the orbital basis is ill-conditioned at some k-points and pair spectra are not converged in the number of bands. `ElecData` warns on load when an orbital combination is almost missing from the bands at any k-point (`edata.orbital_span_t`, the smallest eigenvalue of the band-space orbital overlap over its largest, below $10^{-4}$), and names the orbitals. In graphene, 20 bands still left the C–C IpCOHP 4% weaker than 40 bands and triggered the warning; 30 bands were within 1% and didn't (`notes/theory_audit.md`, finding F11). |
|
|
173
|
+
|
|
174
|
+
**Time-reversal-reduced k-meshes are unfolded.** With `kpoint-reduce-inversion yes` (the JDFTx default) and no other symmetry, JDFTx keeps one of each k/−k pair. For collinear calculations (`no-spin`, `z-spin`) the Hamiltonian of each spin channel is real, so T(−k) = T(k)* and ε(−k) = ε(k). crawfish detects such a mesh and unfolds it onto the full Monkhorst–Pack mesh, splitting each pair's weight. All results, including single bonds and m-resolved ones, are then the same as for `symmetries none`: within about 1e-4 in the graphene test. This is on by default and controlled by `edata.unfold_time_reversal`, which is part of the cache key. `edata.time_reversal_unfolded` reports whether it was applied.
|
|
175
|
+
|
|
176
|
+
**Point-group-reduced k-meshes are unfolded when JDFTx's operations are available.** With `symmetries automatic`, JDFTx computes one k-point per star. If the run also wrote the `sym` file (`dump End Symmetries`), or used `symmetries manual` with several matrices, crawfish rebuilds every other k-point of the mesh: an operation g = (rot, a), x → rot·x + a in lattice coordinates, maps the state at k onto one at rot^−T·k, and its projections onto JDFTx's Bloch-sum orbitals follow as T_{b,m'}(k') = e^{−2πi k'·L_a} Σ_m M_{mm'} T_{a,m}(k). Here g takes atom a to atom b in the cell L_a, and M rotates the real spherical harmonics of each shell (JDFTx's convention); time reversal (complex conjugation) is added where JDFTx used it. Eigenvalues and occupations are those of the computed state, and each computed k-point's weight is split over its images. In tests on graphene and wurtzite ZnO (screw axes, no inversion, Zn d orbitals), single bonds and m-resolved pDOS match full-mesh calculations to about 1e-5. This is on by default and controlled by `edata.unfold_point_group`, which is part of the cache key; `edata.point_group_unfolded` reports whether it was applied (`notes/theory_audit.md`, finding F12).
|
|
177
|
+
|
|
178
|
+
**Symmetry-reduced k-meshes that can't be unfolded.** Without the operations, only irreducible k-points are available. Each one stands in for its symmetry-equivalent k-points, so a quantity for one atom, bond or m-orbital is averaged over its symmetry-equivalent copies. On such a mesh crawfish:
|
|
179
|
+
- uses JDFTx's symmetry weights;
|
|
180
|
+
- raises an error for pair spectra of a single lattice image, including the default `image="nearest"`;
|
|
181
|
+
- warns for `image="all"` pair spectra and for pDOS of a subset of orbitals.
|
|
182
|
+
|
|
183
|
+
Results remain exact only for selections the point group maps onto themselves: the sum over all images, complete orbital shells, and complete sets of equivalent atoms. In a graphene test, the all-image C1–C2 pCOHP and atom-total pDOS match the full-mesh values, while a single bond came out 2.2× too strong, and px–px 2× too strong. `edata.legacy_reduced_kmesh = True` restores the old behaviour, which used uniform weights for spin-polarized reduced meshes and had no guard (`notes/theory_audit.md`, finding F5).
|
|
184
|
+
|
|
185
|
+
## Creating your own `ElecData`
|
|
186
|
+
|
|
187
|
+
### Required
|
|
188
|
+
|
|
189
|
+
1. Collect (or artificially construct) the following objects:
|
|
190
|
+
- A pymatgen `Structure` of your system. It is critical that the species in this structure are ordered by their atomic number.
|
|
191
|
+
- The band eigenvalues in shape `tj` as a numpy array.
|
|
192
|
+
- The k-point folding and the corresponding k-points (if you are unsure but know the total number of k-points, the kfolding can be set arbitrarily and the k-points can be left as None).
|
|
193
|
+
- The k-point weights, including the spin factor, so that they sum to 2 (see "Occupations and k-point weights"). If you are unsure but know there was no symmetry reduction (ie every k-point on your MP grid was evaluated), every weight is 2/nkpts for spin-unpolarized data and 1/nkpts per spin channel for spin-polarized data. If there was symmetry reduction of your k-mesh but you know how many k-points were reduced into each of the output k-points, multiply the weights by the number of k-points each output k-point "represents".
|
|
194
|
+
- The number of projections (orbitals) gathered for each atom type and their corresponding quantum numbers (the exact principal quantum number n matters less, as long as you know their ordering for multiple shells of a given angular momentum).
|
|
195
|
+
- The projection coefficients for each band+state on each orbital in shape `tju`. They should be projections onto real orbitals (`crawfish` applies no phase correction to user projections). It is critical that you have the actual projections and not their absolute values (the latter typically dumped as it is all that is needed for pDOS analysis) as taking the absolute value removes all information about the phase of the orbital at that band+state (bonding vs antibonding interaction is determined solely by the matching of phases between two orbitals). The ordering of the projections must match the ordering of the atoms as given in the Structure (ie for an all-electron calculation of an Li2 structure, projections 0-3 should correspond to Li #1's 1s, Li #1's 2s, Li #2's 1s, and Li #2's 2s).
|
|
196
|
+
2. Initialize an empty `ElecData` object with the class method `edata = ElecData.as_empty()` to circumvent initialization procedures for JDFTx calculations.
|
|
197
|
+
3. Set `user_proj_tju` (ie `edata.user_proj_tju = np.random.random([10,5,4])`). This will not be touched, and all projection manipulations will be performed on a copy of this array. This will automatically define `nstates`, `nbands`, and `nproj`.
|
|
198
|
+
4. Set the `atom_orb_labels_dict` property for the class as a dictionary mapping each element in your calculation to a list of strings giving the quantum numbers of the projections gathered for that element (ie for a calculation of C2H4O, set `edata.atom_orb_labels_dict = {"H": ["s"], "C": ["s", "px", "py", "pz"], "O": ["s", "px", "py", "pz"]}`). If you do not wish to perform orbital resolution on your analysis, it does not matter what you put here, as long as all the elements of each list are unique and the list length matches the number of projections for that element. The ordering of the projections must match the ordering as they are listed in your `user_proj_tju`. If you have multiple projections for a given angular momentum, include the principal quantum number as well (ie `["1s", "2s"]`; they do not need to be the true principal quantum numbers).
|
|
199
|
+
5. Set `kfolding` (ie `edata.kfolding = [3,3,3]`). If you are unsure but know `nspin`, set as `[int(edata.nstates/nspin), 1, 1]`.
|
|
200
|
+
6. Set `wk_t` (ie `edata.wk_t = np.ones(edata.nstates)*(2/edata.nspin)/np.prod(edata.kfolding)`). If you are unsure, just make sure they sum to 2.
|
|
201
|
+
7. Set the fermi level as `edata.mu` (if you are going to set `occ_tj` explicitly, this step becomes optional but is still useful for plotting).
|
|
202
|
+
|
|
203
|
+
### Optional
|
|
204
|
+
|
|
205
|
+
8. If you have the state/band occupation, set it as `edata.occ_tj`, per state in [0, 1]. Otherwise, it will be calculated for you using `edata.broadening` and `edata.broadening_type`.
|
|
206
|
+
|
|
207
|
+
## Installation
|
|
208
|
+
|
|
209
|
+
### pip
|
|
210
|
+
|
|
211
|
+
`crawfish` is on PyPI as `co-crawfish` (the name `crawfish` belongs to another project there). The module you import is still `crawfish`.
|
|
212
|
+
|
|
213
|
+
1. Activate the Python environment you wish to use when performing pCOHP analysis. crawfish needs Python 3.12 or newer (its tests run on 3.12 to 3.14). If you are worried about dependency conflicts, I would recommend creating a conda virtual environment with one of those Python versions.
|
|
214
|
+
2. **Until pymatgen-core's next release:** crawfish needs the JDFTx IO module of pymatgen-core as it is on GitHub (`main`), which is newer than the latest PyPI release (2026.10.31). Install that first, or step 3 fails because pip finds no pymatgen-core version it can use.
|
|
215
|
+
```sh
|
|
216
|
+
pip install git+https://github.com/materialsproject/pymatgen-core.git
|
|
217
|
+
```
|
|
218
|
+
Skip this step once PyPI has a pymatgen-core release newer than 2026.10.31.
|
|
219
|
+
3. Install crawfish
|
|
220
|
+
```sh
|
|
221
|
+
pip install co-crawfish
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
To install from source instead (for the examples and tests, or to edit the code), do step 2, clone this repo, and run `pip install .` in it.
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
<h1 align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/70a64716-aa4d-498f-a123-01aa8daccfb6">
|
|
4
|
+
<img alt="Logo" src="https://github.com/user-attachments/assets/70a64716-aa4d-498f-a123-01aa8daccfb6"
|
|
5
|
+
height="400">
|
|
6
|
+
</picture>
|
|
7
|
+
</h1>
|
|
8
|
+
|
|
9
|
+
Crawfish is a Python library for pCOHP analysis on JDFTx calculations.
|
|
10
|
+
|
|
11
|
+
## About `crawfish`
|
|
12
|
+
|
|
13
|
+
Crawfish (originally called ultraSoftCrawfish) is a Python library intended primarily for performing bonding analysis on the output of JDFTx calculations. Its reason for existing (as alluded to in the original name) is that the state-of-the-art COHP analysis software (LOBSTER) only supports calculations with PAW pseudopotentials. While the researchers of LOBSTER have shown unavoidable pitfalls when attempting COHP analysis on non-PAW calculations, COHP analysis on calculations with other pseudopotential types is far from meaningless and still provides tremendous insight. Thus the goal of crawfish is to allow access to COHP analysis for DFT users who do not use PAW pseudopotentials. While this library is intended for JDFTx, `crawfish` also offers support for pCOHP analysis on user-provided system data, whether generated by another DFT software, or created by the user for learning purposes.
|
|
14
|
+
|
|
15
|
+
This README, the docstrings and some warnings cite `notes/theory_audit.md` (findings F1 to F20) and `notes/wannier_and_adaptive_basis.md`. Those development notes hold the derivations behind each fix. They are kept on the `theory_check` branch of this repository, not on `master`. The notes there go up to F15 so far: the write-ups of F16 to F20 as numbered in this README are not in the repository yet.
|
|
16
|
+
|
|
17
|
+
### Notation - format
|
|
18
|
+
All arrays are named in the general format "name_indices", where "name" provides insight to the meaning of the array, and "indices" tells the user the array's dimensionality, and the significance of each dimension. ie for `h_uu`, "h" would signify the system hamiltonian, and "uu" would signify the array is 2-dimensional, where both dimensions correspond to atomic orbitals (meaning of each index name given below). Parts of the indices are also occasionally separated by an underscore for clarity, but are meaningless (ie `s_tj_uu` would be assumed equivalent to `s_tjuu`).
|
|
19
|
+
|
|
20
|
+
### Notation - index definitions
|
|
21
|
+
Spin and k-points are collapsed to a single index `t`, called a "state" (and `nstates` gives the total number of states for a calculation). When un-collapsed, spin is given the index `s` (`nspin`) and steps along the first, second, and third reciprocal lattice vector are given the indices `a`, `b`, and `c` (`nka`, `nkb`, `nkc` = `kfolding`). Bands are indexed always by `j` (`nbands`). Orbitals are indexed by either `u` (`nproj`) ($\mu$) or `v` ($\nu$) (the latter only when distinction of a second orbital index is required).
|
|
22
|
+
|
|
23
|
+
### Notation - array definitions
|
|
24
|
+
1. `proj` is used to signify the projection vector, typically in shape `tju`. In braket notation, `proj_tju[t,j,u]` = $\bra{\phi_\mu}\hat{O}\ket{\psi_j(t)}$, where $\hat O$ is the ultrasoft overlap operator ($\hat O = 1$ for norm-conserving pseudopotentials). The equations below write this as $\bra{\phi_\mu}\psi_j(t)\rangle$ for short.
|
|
25
|
+
2. `e` ($\epsilon$) is used to signify the Kohn-Sham eigenvalues of the DFT calculation, and has either the shape `tj` or `sabcj`.
|
|
26
|
+
3. `wk` is used to signify the weights of each k-point, and has only the shape `t`.
|
|
27
|
+
4. `occ` ($f$) is used to signify the occupation at each state (k-point + spin) and band, and thus has either shape `tj` or `sabcj`.
|
|
28
|
+
5. `coef` ($C$) is used to signify the expansion coefficients of each band in the orbitals, in shape `tju` (`coef_tju`). It equals `proj` in the default orthonormal basis.
|
|
29
|
+
6. `s`, `h` and `d` are used to signify the overlap, Hamiltonian and density matrix of the orbitals at each state, in shape `t_uv` (`s_t_uv`, `h_t_uv`, `d_t_uv`; complex and Hermitian). They are defined under "Provided analysis techniques".
|
|
30
|
+
7. `s_uu`, `p_uu`, `h_uu` (and `s_t_uu`, `p_t_uu`, `h_t_uu`) are the real, unsigned matrices of the legacy formalism (`legacy_matrices=True`), defined at the end of "Provided analysis techniques".
|
|
31
|
+
|
|
32
|
+
### Units
|
|
33
|
+
Unless otherwise indicated, all energies are in **Hartrees** and are not normalized to the Fermi level!!
|
|
34
|
+
|
|
35
|
+
### Occupations and k-point weights
|
|
36
|
+
crawfish follows JDFTx's convention.
|
|
37
|
+
- **Occupations** $f_j(t)$ (`occ_tj`) are per state, in $[0, 1]$.
|
|
38
|
+
- **k-point weights** $w_t$ (`wk_t`) carry the spin factor and sum to 2: each weight is $2/N_k$ for `spintype no-spin`, and $1/N_k$ per spin channel for `z-spin`.
|
|
39
|
+
|
|
40
|
+
With these conventions the electron count is $\sum_{t,j} w_t f_j(t)$.
|
|
41
|
+
|
|
42
|
+
JDFTx writes its `fillings` file in $[0, 2]$ for `no-spin` calculations, so crawfish divides it by 2 when reading it. It then warns if the electron count disagrees with the outfile. Before this was fixed, the raw file values were used, which doubled the electron count, the density matrix and pCOBI for unpolarized calculations. Integrated spectra hid this by dividing occupations by their maximum. Both old behaviours are still available through `edata.legacy_fillings = True`, which is part of the cache key (`notes/theory_audit.md`, finding F4).
|
|
43
|
+
|
|
44
|
+
### Projection modifications
|
|
45
|
+
0. **Orbital phase convention (always on for JDFTx data).** JDFTx builds its atomic orbitals without the $i^l$ factor of the plane-wave expansion, so each dumped projection onto an orbital of angular momentum $l$ is $(-i)^l$ times the projection onto the corresponding real orbital. `crawfish` multiplies JDFTx projections by $i^l$ when loading them, which puts every orbital in the real convention. Before this correction, $Re[T_{\mu,j}^*T_{\nu,j}]$ was essentially zero for orbital pairs whose $l$ differs by an odd number (s-p, p-d), so those interactions were missing from every pair spectrum, and pairs whose $l$ differs by 2 (s-d) had the wrong sign (pDOS was unaffected). The raw projections are still available through `edata.legacy_orbital_phase = True`, which is part of the cache key, for comparing results. With the signed matrices described below, pCOHP, pCOOP and pCOBI don't depend on a phase per orbital, so that setting alone only changes pCOMO. Reproducing the old pair spectra also needs `edata.legacy_matrices = True`. Projections set through `user_proj_tju` are never modified, so they should already use real orbitals. See `notes/theory_audit.md` (finding F1) for the derivation and evidence.
|
|
46
|
+
1. `trim_excess_bands` is a bool class variable of `ElecData` in which only `nproj` bands are included in analysis. By trimming excess bands, the projection vector `proj_tju` becomes square at each state. This has been primarily useful so far as a means of allowing the projections at each state to be normalized for each band and each orbital. Theoretically, this also allows for projections to undergo a band-lowdin-orthogonalization, but the usefulness has not been investigated. Theoretically this also allows for using the dual space of the projections (allowing for less ad-hoc approaches to charge conservation), but this has yet to be implemented. **Deprecated** (setting it warns): it keeps the same `nproj` bands at every k-point, ranked by the sum of $|T|$ over all k-points, and the rescaling of $|T|^2$ isn't a unitary change of the projections. Use enough `elec-n-bands` with `los_orbs` instead (`notes/theory_audit.md`, finding F10).
|
|
47
|
+
2. `los_orbs` is a bool class variable of `ElecData` in which orbitals are made orthogonal to one another via the Lowdin-Orthogonalization technique. This may seem counterintuitive in a framework centered around how orbitals interact with each other, but remember that this orthogonality ($\langle\phi_\mu|\phi_\nu\rangle=\delta_{\mu,\nu}$) does not eliminate overlap between orbitals at individual bands ($\bra{\phi_\mu}\psi_j(t)\rangle\langle\psi_j(t)\ket{\phi_\nu}$), only over the sum of all bands at each state ($\sum_{j}\langle\phi_\mu|\psi_j(t)\rangle\langle\psi_j(t)|\phi_\nu\rangle=\delta_{\mu,\nu}$ for every $t$). The orthogonalization is done separately at each state, within the space of the computed bands. This is an incredibly useful technique when trying to reformulate our calculation in a LCAO picture, as it ensures that for all bonding interactions (bands `j` at state `t` where $c_{\mu,j}(t)^* c_{\nu,j}(t)>0$), there are enough antibonding interactions ($c_{\mu,j}(t)^* c_{\nu,j}(t)<0$) such that the sum over all bands at that state for any orbital pair $\mu,\nu$ sums to $\delta_{\mu,\nu}$. The Lowdin-Orthogonalization technique is the obvious choice for this orthogonalization, as it is simple to employ (takes 5 lines of vectorized numpy processes here) and minimizes the deviation of each projection from the true value (JDFTx will orthogonalize the orbitals if given the argument `band-projection-params yes no` prior to evaluating and dumping the band projections. However, due to the incompleteness of the space spanned by the bands at each state, this orthogonality will be lost when evaluating total overlap with the dumped projections. The same can also be realized for the bands due to the incompleteness of the space spanned by the orbitals). Orbital combinations the bands don't span at a state (overlap eigenvalue below $10^{-6}$ of the largest) are dropped, with a warning, instead of being scaled up to unit weight. If you see that warning, check `edata.orbital_completeness_u` and add bands. Before this was fixed, the cutoff was an absolute $10^{-15}$ on float32 data, so such directions were kept or dropped depending on the sign of rounding noise; `edata.legacy_lowdin_cutoff = True` restores that (`notes/theory_audit.md`, finding F10). The Löwdin step needs complex projections and at least as many bands as orbitals. When either is missing, crawfish switches `los_orbs` off on load, with a warning (for $|T|^2$ files, finding F18).
|
|
48
|
+
|
|
49
|
+
### Matrix modifications
|
|
50
|
+
1. `legacy_matrices` (default `False`) selects how the pair spectra (pCOHP, pCOOP, pCOBI, and pCOMO in the non-orthogonal basis) are built. The default is the signed formalism described below. `True` restores the matrices crawfish used before this was fixed. Those were built from squares of $Re[T_{\mu,j}^*T_{\nu,j}]$, so they carry no sign, and the bonding/antibonding call was wrong whenever the true matrix element is positive (e.g. p–p σ bonds). The legacy formalism is documented at the end of this section, and kept for comparing results (`notes/theory_audit.md`, finding F2; `examples/fix_comparisons/F2_signed_matrices.ipynb`).
|
|
51
|
+
2. `norm_eigs_for_h` (default `True`) measures eigenvalues from the Fermi level when building $H$. In the orthonormal basis (`los_orbs=True`) this changes only diagonal elements, so it has no effect on pair spectra, as long as the Löwdin step dropped no orbital direction. At states where it did (too few bands; crawfish warns on load), $S$ is a projector and not the identity, and pair values then depend on the energy zero: by 1.5% for the N–N IpCOHP of the N2 test calculation with 10 bands. In the non-orthogonal basis, shifting the energy zero by $c$ shifts pCOHP by $-c\cdot\text{pCOOP}$ (Glassey & Hoffmann, J. Chem. Phys. 113, 1698 (2000)). The too-few-bands warning says so where the Löwdin step dropped a direction (finding F15). JDFTx prints the Fermi level only with `elec-smearing`. For a calculation without it, `edata.mu` is the midpoint of the HOMO and LUMO (the highest eigenvalue with occupation ≥ 0.5 and the lowest with occupation ≤ 0.5, as in JDFTx's `eigStats` dump), `edata.mu_is_estimated` is True, and crawfish warns the first time it is used. Set `edata.mu` to override it, then call `edata.reset_cache()`: cached matrices, weights and spectra don't record a hand-set mu (this was already so for calculations with smearing), so results cached with the estimate would otherwise be reused. JDFTx's own Fermi level would lie anywhere in the gap (for the Si test calculation, the `eigStats` "mu" line is 0.2419 Ha against the midpoint 0.2423 Ha). When spin channels or k-points are filled separately (constant fillings with a magnetization), the HOMO can lie above the LUMO; the midpoint is then only an energy zero, and the warning says so. The estimate needs occupations that don't depend on mu: a `fillings` file, or no smearing. Without a LUMO (no empty band), crawfish switches `norm_eigs_for_h` off instead, which the settings string records, and warns where that changes pair values (non-orthogonal basis, or a dropped Löwdin direction). Before this was fixed, the pair spectra of calculations without smearing raised an error (finding F20); the energy zero matters only in the non-orthogonal basis or where a direction was dropped.
|
|
52
|
+
3. `p_uu_consistent` only affects the legacy matrices (`legacy_matrices=True`). It rescales each band's contribution so that $\sum_{\mu,\nu}P_{\mu,\nu}(t,j)=f_j(t)w_t$.
|
|
53
|
+
4. `legacy_cobi_scale` (default `False`): `True` drops the factor 2 of pCOBI, which halves it, as before finding F16 (see "pCOBI scale" below).
|
|
54
|
+
5. `use_ao_matrices` (default `True`) only matters when the calculation directory has JDFTx's `aoOverlap` and `aoHamiltonian` files (`dump End AO`). These are the exact orbital overlap $\langle\phi_\mu|\hat O|\phi_\nu\rangle$ and Hamiltonian $\langle\phi_\mu|\hat H|\phi_\nu\rangle$ at each state (`edata.ao_s_t_uv`, `edata.ao_h_t_uv`). crawfish then uses them for $S$ and $H$ instead of the band sums below, and the coefficients come from the exact overlap.
|
|
55
|
+
- With ortho projections or `los_orbs=True`, the basis is the exact Löwdin orbitals $\phi S^{-1/2}$: $C=T$ (projections onto those orbitals), $H=S^{-1/2}H_{AO}S^{-1/2}$ and $S=1$.
|
|
56
|
+
- With `band-projection-params no no` and `los_orbs=False`, it is the bare orbitals: $C=S^{-1}T$, $H=H_{AO}$ and $S=S_{AO}$.
|
|
57
|
+
|
|
58
|
+
Pair spectra then stop depending on `elec-n-bands`: each computed band's coefficients are exact, and the bands no longer need to span the orbitals. In graphene (SG15, 6x6x1 mesh, 16 bands) the C–C IpCOHP is −0.545 Ha, against −0.468 Ha from band sums. For gas-phase N2, band sums are still about 20% short at 80 bands (`notes/wannier_and_adaptive_basis.md`, section 10.4). `edata.ao_matrices_used` reports whether the matrices were applied, and the setting is part of the cache key.
|
|
59
|
+
|
|
60
|
+
### Provided analysis techniques
|
|
61
|
+
|
|
62
|
+
For the following equations, projections (`proj_tju[t,j,u]`) are short-handed as $T_{\mu,j}(t)=\bra{\phi_\mu}\psi_j(t)\rangle$. Eigenvalues (`e_tj[t,j]`) are notated as $\epsilon_j(t)$, and $\delta(x)$ signifies the delta function ($\delta(x)=\infty$ for $x=0$, $\delta(x)=0$ for $x\neq0$). The following equations are evaluated on an evenly spaced energy array `erange`. By default, gaussian smearing is employed, by which $\delta(E-x)=\frac{1}{\sqrt{\pi\sigma}}e^{-\frac{(E-x)^2}{\sigma}}$, where $\sigma$ is an optional user parameter `sig` (so the standard deviation is $\sqrt{\sigma/2}$). If linear tetrahedron integration (`lti`) is requested, $\sum_{t}w_t\,(\ldots)\,\delta\left(E-\epsilon_j(t)\right)$ is replaced by the Brillouin-zone integral computed by the `libtetrabz` package for each spin channel. Both are normalized, so spectra are densities per Hartree: the total DOS integrates to $\sum_t w_t\, n_\text{bands}$, and Gaussian and LTI spectra share one scale. Before this was fixed, the Gaussian lacked the $1/\sqrt{\pi\sigma}$, and LTI counted the $1/N_k$ of the zone average twice. Peak shapes, `norm_max` and `norm_intg` results are unaffected. `edata.legacy_normalization = True` restores the old scales (`notes/theory_audit.md`, finding F6).
|
|
63
|
+
|
|
64
|
+
The energy grid must be fine enough to resolve the peaks. On a grid of step $h$, the area of a Gaussian peak of standard deviation $s$ differs from its weight by up to $2e^{-2\pi^2(s/h)^2}$, depending on where the eigenvalue falls between grid points: 1.4% at $h=2s$. The default grid step `res` is 1 mHa, under half the standard deviation of the default `sig` ($10^{-5}$ Ha², 2.2 mHa), so peak areas are exact to well below $10^{-6}$. crawfish warns when the step of the grid (from `res`, or a given `erange`) is more than 2 standard deviations of `sig`. An automatic `erange` extends beyond the lowest and highest eigenvalue by 10 `res` or 5 standard deviations, whichever is more (10 `res` for LTI). The integrated functions (`get_i<mode>`) are exact sums and don't depend on the grid. Before this was fixed, the default `res` was 10 mHa, 4.5 standard deviations, so a peak's area on the grid was 0.29 to 1.78 times its weight (the N2 N–N pCOHP integrated to −1.02 Ha up to mid-gap instead of −0.87 Ha), and the pad of 10 `res` cut off the outermost peaks at a fine `res`. `res=0.01` still gives exactly that grid and those spectra (finding F17).
|
|
65
|
+
|
|
66
|
+
#### pDOS
|
|
67
|
+
|
|
68
|
+
Projected density-of-states (pDOS) is primarily included in this package for sanity checks, and is evaluated as
|
|
69
|
+
|
|
70
|
+
$$
|
|
71
|
+
pDOS(E,\mu)=\sum_{j,t}\left|T_{\mu,j}\right|^2w_t\delta(E-\epsilon_j(t))
|
|
72
|
+
$$
|
|
73
|
+
|
|
74
|
+
Here $T$ is `edata.proj_tju` after the projection modifications above. With `los_orbs=True` (default) that is the projection onto the Löwdin-orthonormalized orbitals, so pDOS changes with `los_orbs`. For a `bandProjections` file of $|T|^2$ (`band-projection-params <ortho> yes`), `proj_tju` holds the amplitudes $|T|$, the square roots of the file's values, without the Löwdin step. Before this was fixed, the file's values were used as $T$: pDOS squared them again, and the Löwdin step ran on them (finding F18).
|
|
75
|
+
|
|
76
|
+
#### Pair spectra (pCOHP, pCOOP, pCOBI, pCOMO)
|
|
77
|
+
|
|
78
|
+
Pair spectra use the band-projected orbitals $\chi_\mu = \sum_j \psi_j \langle\psi_j|\hat O|\phi_\mu\rangle$, where $\hat O$ is the ultrasoft overlap operator. JDFTx applies $\hat O$ when it writes the projections, and $\hat O = 1$ for norm-conserving pseudopotentials. Because $\hat H = \sum_j \hat O|\psi_j\rangle\epsilon_j\langle\psi_j|\hat O$ in the generalized (ultrasoft) eigenproblem, at each state $t$:
|
|
79
|
+
|
|
80
|
+
$$
|
|
81
|
+
S_{\mu\nu}(t) = \sum_j T_{\mu,j}T_{\nu,j}^*, \qquad H_{\mu\nu}(t) = \sum_j T_{\mu,j}\,\epsilon_j\,T_{\nu,j}^*, \qquad D_{\mu\nu}(t) = \sum_j f_j\, C_{\mu,j}C_{\nu,j}^*
|
|
82
|
+
$$
|
|
83
|
+
|
|
84
|
+
(`edata.s_t_uv`, `edata.h_t_uv`, `edata.d_t_uv`, which are complex and Hermitian). $C_{\mu,j}(t)$ are the coefficients of $\psi_j$ in the $\chi_\mu$ (`edata.coef_tju`). With `los_orbs=True` (default) the orbitals are Löwdin-orthonormalized within the band space first, so $S=1$ and $C=T$. With `los_orbs=False`, $C = S^{-1}T$ (least squares). For a spectral mode with matrix $M$:
|
|
85
|
+
|
|
86
|
+
$$
|
|
87
|
+
pX(E,\mu,\nu)=\sum_{j,t} w_t\, Re\left[C_{\mu,j}^*\, M_{\mu\nu}\, C_{\nu,j}\right]\delta(E-\epsilon_j(t))
|
|
88
|
+
$$
|
|
89
|
+
|
|
90
|
+
where $M = H$ for **pCOHP** (negative = bonding), $M = S$ for **pCOOP**, $M = 2D$ for **pCOBI** (the Wiberg/Mayer scale; see "pCOBI scale" below), and $M = 1$ for **pCOMO** (Coulson's mobile order).
|
|
91
|
+
|
|
92
|
+
**Which periodic image** of the second atom is meant is set by the `image` argument of every pair function. JDFTx's Bloch sums are $\phi_{\mu k} = \sum_R e^{ik\cdot R}\phi_\mu(r-\tau_\mu-R)$, with $\tau$ the atom positions exactly as JDFTx used them. The image of atom $b$ at $\tau_b+R$ (R in lattice vectors) therefore enters through
|
|
93
|
+
|
|
94
|
+
$$
|
|
95
|
+
M_{\mu\nu}(t) \;\to\; M_{\mu\nu}(R)\,e^{2\pi i k_t\cdot R}, \qquad M_{\mu\nu}(R) = \frac{\sum_{t\in s} w_t\, e^{-2\pi i k_t\cdot R} M_{\mu\nu}(t)}{\sum_{t\in s} w_t}
|
|
96
|
+
$$
|
|
97
|
+
|
|
98
|
+
for each spin channel $s$.
|
|
99
|
+
- `image="nearest"` (default) uses, for each atom pair, the image nearest to the first atom. `get_pair_images(edata, idcs1=..., idcs2=...)` reports the $R$ and bond length used, and crawfish warns when several images are equally near.
|
|
100
|
+
- `image=(n1, n2, n3)` uses that lattice vector for every pair. With $R\neq0$ the two orbital sets may share orbitals: `idcs1=a, idcs2=a, image=R` is atom $a$'s bond with its own image at $R$, including each orbital with its own copy ($\mu=\nu$), which carries 15% to 50% of graphene's second-neighbour C–C IpCOHP, depending on the direction. `get_nearest_images(edata, a, b)` (in `crawfish.funcs`) lists the images of atom $b$ nearest to atom $a$ at a non-zero distance, e.g. graphene's six second neighbours for $b=a$, or the bonds of a one-atom cell. Sets that share orbitals are refused for `"nearest"` (an atom's nearest image of itself is itself), `"all"` and $(0,0,0)$, where $\mu=\nu$ is the on-site term. Before this was fixed, every pair of sets sharing an orbital was refused, and $\mu=\nu$ was left out for every image (finding F19).
|
|
101
|
+
- `image="all"`, or the older `state_sep=True`, uses $M(t)$ directly, summing the interaction over every image.
|
|
102
|
+
|
|
103
|
+
Images other than the same cell need the full k-mesh (run JDFTx with `symmetries none`, or dump `Symmetries`; see "JDFTx settings"). The fcc Al test calculations have a reduced mesh and no `sym` file, so their self-image bonds stay refused. An $N_1\times N_2\times N_3$ mesh can't separate $R$ from $R + (N_1n_1, N_2n_2, N_3n_3)$, so $M(R)$ also contains those far images. Before this was fixed, crawfish always used the same-cell copy ($R=0$) whatever its distance. That is still available through `edata.legacy_lattice_image = True` (`notes/theory_audit.md`, finding F3; `examples/fix_comparisons/F3_lattice_images.ipynb`).
|
|
104
|
+
|
|
105
|
+
Notes:
|
|
106
|
+
- Summing $w_t f_j\,Re[C_{\mu,j}^* H_{\mu\nu} C_{\nu,j}]$ over all bands, all orbital pairs and all lattice images, including the diagonal terms $\mu=\nu$, reproduces the band energy $\sum w f\epsilon$ (measured from the Fermi level when `norm_eigs_for_h=True`), up to the charge spilling of the projection: within 0.6% for the N2 test calculation and 3% for graphene with 20 bands. The pair functions don't return the on-site terms ($\mu=\nu$ in the same cell): they skip them, and refuse orbital sets that share an orbital unless `image` is a lattice vector other than $(0,0,0)$. So `get_ipcohp` can't give the on-site energies (about 70% of the N2 band energy). An atom's interactions with its own periodic images, including those of each orbital with its own copy, are available through an explicit `image` (see above; finding F19).
|
|
107
|
+
- **pCOOP vanishes between different orbitals in an orthonormal basis.** For meaningful pCOOP:
|
|
108
|
+
- run JDFTx with `band-projection-params no no` (non-orthogonal atomic orbitals);
|
|
109
|
+
- set `edata.los_orbs = False`;
|
|
110
|
+
- use enough bands that the orbitals are spanned, or provide JDFTx's AO matrices (`use_ao_matrices`), which give the exact overlap.
|
|
111
|
+
|
|
112
|
+
Without the AO matrices, crawfish builds the overlap from the bands ($S = TT^\dagger$), which approaches $\langle\phi_\mu|\hat O|\phi_\nu\rangle$ as `edata.orbital_completeness_u` approaches 1. For ultrasoft pseudopotentials there is one more approximation: with `band-projection-params no no`, JDFTx applies $\hat O$ to each orbital with the augmentation of that orbital's own atom only (`OpsiRadial`, built in `SpeciesInfo.cpp::setPsi`), not that of its neighbours. Projections onto orthonormalized orbitals (`yes no`) use the full $\hat O$, and norm-conserving pseudopotentials have $\hat O = 1$. crawfish warns when pCOOP is zero (Löwdin basis), when it is only a band-truncation artifact (orthonormalized-orbital projections), and when the selected orbitals' completeness is below 0.85. For gas-phase N2 with non-orthogonal projections, completeness is 0.90–0.99 with 15 bands. The overlaps have the textbook signs (σ between parallel p negative, π positive), and ICOOP changes by less than 0.03 from 15 to 40 bands (`examples/fix_comparisons/F7_coop_basis.ipynb`).
|
|
113
|
+
- **Basis dependence.** pCOHP depends on the orbital basis, and in the non-orthogonal basis also on the energy zero (`norm_eigs_for_h`). For N2, the non-orthogonal basis gives the textbook net-antibonding s–s interaction, while the Löwdin basis gives a bonding one and about 3× the total ICOHP. Compare results within one basis.
|
|
114
|
+
- **pCOMO** has no matrix factor, so its sign depends on how the two orbitals are oriented. For example, a p–p σ bonding combination of parallel p orbitals has $C_{\mu}^*C_{\nu} < 0$. Read it as a bond-order density, not as a bonding indicator.
|
|
115
|
+
- **pCOBI scale.** pCOBI weights are $2w_t\,Re[C_{\mu,j}^*D_{\mu\nu}C_{\nu,j}]$, with $D$ the density matrix of one spin channel (occupations in $[0,1]$). The integrated pCOBI of each orbital pair is then $2W_s|D^s_{\mu\nu}(R)|^2$ summed over spin channels $s$, with $W_s=\sum_{t\in s}w_t$ (2 for `no-spin`, 1 per channel for `z-spin`), so it is non-negative. Summed over the orbitals of two atoms it is the Wiberg/Mayer bond index ($\sum P_{\mu\nu}^2$ with the spin-summed density matrix $P=2D$ for closed shells, $2\sum_s\sum|D^s_{\mu\nu}|^2$ in general), on which COBI is built (Müller et al., J. Phys. Chem. C 125, 7959 (2021)): a single bond gives about 1. For the N2 test calculations IpCOBI is 2.98 (a triple bond), and for a graphene C–C bond 1.22, equal to a float64 evaluation of the index to $10^{-6}$. `no-spin` and `z-spin` calculations of the same system agree. It hasn't been compared with LOBSTER output. Before this was fixed, the factor 2 was missing, so IpCOBI was half the bond index (1.49 for N2). `edata.legacy_cobi_scale = True` restores that, and is part of the cache key (finding F16; `examples/fix_comparisons/F16_F20_cobi_scale_grid_and_inputs.ipynb`).
|
|
116
|
+
|
|
117
|
+
#### Legacy formalism (`legacy_matrices=True`)
|
|
118
|
+
|
|
119
|
+
Kept for reference. These definitions give wrong signs (see above).
|
|
120
|
+
|
|
121
|
+
$$
|
|
122
|
+
pX_{legacy}(E,\mu,\nu)=M_{\mu,\nu}\sum_{j,t}Re\left[T_{\mu,j}^*T_{\nu,j}\right]w_t\delta(E-\epsilon_j(t)),\qquad M \in \{H, S, P, 1\}
|
|
123
|
+
$$
|
|
124
|
+
|
|
125
|
+
$$
|
|
126
|
+
H_{\mu,\nu} = \sum_{j,t} P_{j,t,\mu,\nu} \epsilon_{j,t}, \qquad P_{j,t,\mu,\nu} = S_{j,t,\mu,\nu} f_j(t) w_t, \qquad S_{j,t,\mu,\nu} = \left(Re\left[\langle \mu | \psi_j(t) \rangle \langle \psi_j(t) | \nu \rangle\right]\right)^2
|
|
127
|
+
$$
|
|
128
|
+
|
|
129
|
+
(with $P$ renormalized per band when `p_uu_consistent=True`, and $\epsilon$ shifted by $\mu$ when `norm_eigs_for_h=True`).
|
|
130
|
+
|
|
131
|
+
## Why and when should I use `crawfish`?
|
|
132
|
+
|
|
133
|
+
1. **Non-PAW JDFTx calculations** The intended audience for `crawfish` is anyone curious about the bonding within a non-PAW pseudopotential calculation performed using JDFTx. While LOBSTER is not explicitly supported by JDFTx, the output of any unsupported calculation with PAW pseudopotentials can be converted by the user to mimic the output of a calculation which is supported by LOBSTER, circumventing the need of explicit support. If this is not the case, `crawfish` is here for you.
|
|
134
|
+
2. **General non-PAW calculations** The techniques used by `crawfish` are made available to other DFT calculators, so long as the user is able to acquire the required data to construct an `ElecData` object. The instructions for how to do so are available in the "Creating your own `ElecData`" section of this readme. This process requires providing `crawfish` with the Kohn-Sham eigenvalues, and the projections of each Kohn-Sham wavefunction onto each orbital (as well as some other information that is typically much easier to obtain). If you are interested in doing so, please reach out to me (beri9208@colorado.edu) to help you with any obstacles that might require fixing some less-tested parts of the code.
|
|
135
|
+
|
|
136
|
+
## How to use `crawfish`
|
|
137
|
+
|
|
138
|
+
1. **Create an `ElecData` object** `ElecData` is the class used to house all electronic data and derived tensors for a given calculation. Provided the JDFTx calculation has been run with the required settings (see "JDFTx settings" below), this can be done in one line as `edata = ElecData.from_calc_dir(calc_dir)`, where `ElecData` has been imported from `crawfish.core.elecdata`, and `calc_dir` is either `str` or `Path` giving the full path to your directory containing the calculation output data.
|
|
139
|
+
2. **Change desired settings** If there are any parameters you wish to change that affect the computed tensors required for pCOHP analysis (ie `edata.los_orbs`), you can change these values in the typical fashion (`edata.los_orbs = False`) triggering a re-evaluation of the affected tensors with this change in mind. If you have multiple settings you want to change, you can avoid repeated re-evaluations by changing the setting's private value (`edata._los_orbs = False`) and either remembering to change the final setting through the public value or by running `edata.alloc_elec_data()`.
|
|
140
|
+
3. **Import function(s) for desired analysis** All spectrum-generating functions can be imported from `crawfish.funcs`. For each analysis technique `<mode>` (`dos`, `pdos`, `pcohp`, `pcoop`, `pcobi`, `pcomo`) there is a dos-like spectrum-generating function `get_<mode>` and a spectrum integrating function `get_i<mode>`.
|
|
141
|
+
4. **Generate spectra and plot** Dos-like generating functions and spectrum integrating function will both return a length-2 tuple `erange, spectrum`: the energy-axis values and the corresponding spectrum values. If you are unfamiliar with plotting in Python, this can be easily done with `matplotlib` (the installation of this library ensures your Python environment has this package) by importing `import matplotlib.pyplot as plt` and running `plt.plot(erange, spectrum)`. The arguments for these functions can all be checked in the docstrings for the function definitions.
|
|
142
|
+
|
|
143
|
+
### JDFTx settings
|
|
144
|
+
|
|
145
|
+
| setting | why |
|
|
146
|
+
|---|---|
|
|
147
|
+
| `dump End BandProjections BandEigs Fillings Kpoints Symmetries` | Projections, eigenvalues, occupations, k-point weights and JDFTx's symmetry operations. `Fillings` and `Kpoints` are optional but recommended. Without them, occupations are computed from the smearing and mu (or, without smearing, JDFTx's constant fillings), and weights are read from the `bandProjections` header. Without smearing, JDFTx prints no Fermi level, and crawfish uses the HOMO–LUMO midpoint (see `norm_eigs_for_h`). `Symmetries` writes the `sym` file, which lets crawfish unfold a symmetry-reduced k-mesh (see below). |
|
|
148
|
+
| `band-projection-params yes no` | Complex projections onto orthonormalized orbitals, for pCOHP/pCOBI/pCOMO. Use `no no` for pCOOP, which is identically zero in an orthonormal basis. The second argument must be `no` for any pair spectrum: with `yes`, which is also JDFTx's default when the command is missing, JDFTx writes only $\|T\|^2$. crawfish then gives DOS and pDOS from $\|T\|$, without the Löwdin step, and the pair functions raise an error (finding F18). |
|
|
149
|
+
| `dump End ... AO` (recommended, once JDFTx supports it) | Writes the exact orbital overlap and Hamiltonian (`aoOverlap`, `aoHamiltonian`), which crawfish uses instead of band sums (`edata.use_ao_matrices`, above). Pair spectra are then converged in the number of bands. To add them to a finished calculation that saved its state, run a `dump-only` restart with only `dump End AO`. Write its log to another file (`-o dumponly.out`), because that log has no mu. |
|
|
150
|
+
| `symmetries automatic` (the default) with `dump End ... Symmetries`, or `symmetries none` | Results resolved by atom, bond or m-orbital need every k-point of the mesh. crawfish rebuilds the ones JDFTx skipped from its `sym` file (see below), which is the cheapest option. Without the `sym` file, use `symmetries none`, or `symmetries manual` with only the identity `symmetry-matrix 1 0 0 0 1 0 0 0 1 0 0 0` (JDFTx then reduces only k ↔ −k, which crawfish unfolds without operations). |
|
|
151
|
+
| `spintype no-spin` or `z-spin` | Spinor calculations (`vector-spin`, `spin-orbit`) aren't supported yet: `ElecData` refuses them with an error (`notes/theory_audit.md`, finding F9). |
|
|
152
|
+
| `elec-n-bands` well above the number of orbitals | The bands must span the atomic orbitals at every k-point, including antibonding (σ*) states. With too few bands (e.g. as many bands as orbitals), the orbital basis is ill-conditioned at some k-points and pair spectra are not converged in the number of bands. `ElecData` warns on load when an orbital combination is almost missing from the bands at any k-point (`edata.orbital_span_t`, the smallest eigenvalue of the band-space orbital overlap over its largest, below $10^{-4}$), and names the orbitals. In graphene, 20 bands still left the C–C IpCOHP 4% weaker than 40 bands and triggered the warning; 30 bands were within 1% and didn't (`notes/theory_audit.md`, finding F11). |
|
|
153
|
+
|
|
154
|
+
**Time-reversal-reduced k-meshes are unfolded.** With `kpoint-reduce-inversion yes` (the JDFTx default) and no other symmetry, JDFTx keeps one of each k/−k pair. For collinear calculations (`no-spin`, `z-spin`) the Hamiltonian of each spin channel is real, so T(−k) = T(k)* and ε(−k) = ε(k). crawfish detects such a mesh and unfolds it onto the full Monkhorst–Pack mesh, splitting each pair's weight. All results, including single bonds and m-resolved ones, are then the same as for `symmetries none`: within about 1e-4 in the graphene test. This is on by default and controlled by `edata.unfold_time_reversal`, which is part of the cache key. `edata.time_reversal_unfolded` reports whether it was applied.
|
|
155
|
+
|
|
156
|
+
**Point-group-reduced k-meshes are unfolded when JDFTx's operations are available.** With `symmetries automatic`, JDFTx computes one k-point per star. If the run also wrote the `sym` file (`dump End Symmetries`), or used `symmetries manual` with several matrices, crawfish rebuilds every other k-point of the mesh: an operation g = (rot, a), x → rot·x + a in lattice coordinates, maps the state at k onto one at rot^−T·k, and its projections onto JDFTx's Bloch-sum orbitals follow as T_{b,m'}(k') = e^{−2πi k'·L_a} Σ_m M_{mm'} T_{a,m}(k). Here g takes atom a to atom b in the cell L_a, and M rotates the real spherical harmonics of each shell (JDFTx's convention); time reversal (complex conjugation) is added where JDFTx used it. Eigenvalues and occupations are those of the computed state, and each computed k-point's weight is split over its images. In tests on graphene and wurtzite ZnO (screw axes, no inversion, Zn d orbitals), single bonds and m-resolved pDOS match full-mesh calculations to about 1e-5. This is on by default and controlled by `edata.unfold_point_group`, which is part of the cache key; `edata.point_group_unfolded` reports whether it was applied (`notes/theory_audit.md`, finding F12).
|
|
157
|
+
|
|
158
|
+
**Symmetry-reduced k-meshes that can't be unfolded.** Without the operations, only irreducible k-points are available. Each one stands in for its symmetry-equivalent k-points, so a quantity for one atom, bond or m-orbital is averaged over its symmetry-equivalent copies. On such a mesh crawfish:
|
|
159
|
+
- uses JDFTx's symmetry weights;
|
|
160
|
+
- raises an error for pair spectra of a single lattice image, including the default `image="nearest"`;
|
|
161
|
+
- warns for `image="all"` pair spectra and for pDOS of a subset of orbitals.
|
|
162
|
+
|
|
163
|
+
Results remain exact only for selections the point group maps onto themselves: the sum over all images, complete orbital shells, and complete sets of equivalent atoms. In a graphene test, the all-image C1–C2 pCOHP and atom-total pDOS match the full-mesh values, while a single bond came out 2.2× too strong, and px–px 2× too strong. `edata.legacy_reduced_kmesh = True` restores the old behaviour, which used uniform weights for spin-polarized reduced meshes and had no guard (`notes/theory_audit.md`, finding F5).
|
|
164
|
+
|
|
165
|
+
## Creating your own `ElecData`
|
|
166
|
+
|
|
167
|
+
### Required
|
|
168
|
+
|
|
169
|
+
1. Collect (or artificially construct) the following objects:
|
|
170
|
+
- A pymatgen `Structure` of your system. It is critical that the species in this structure are ordered by their atomic number.
|
|
171
|
+
- The band eigenvalues in shape `tj` as a numpy array.
|
|
172
|
+
- The k-point folding and the corresponding k-points (if you are unsure but know the total number of k-points, the kfolding can be set arbitrarily and the k-points can be left as None).
|
|
173
|
+
- The k-point weights, including the spin factor, so that they sum to 2 (see "Occupations and k-point weights"). If you are unsure but know there was no symmetry reduction (ie every k-point on your MP grid was evaluated), every weight is 2/nkpts for spin-unpolarized data and 1/nkpts per spin channel for spin-polarized data. If there was symmetry reduction of your k-mesh but you know how many k-points were reduced into each of the output k-points, multiply the weights by the number of k-points each output k-point "represents".
|
|
174
|
+
- The number of projections (orbitals) gathered for each atom type and their corresponding quantum numbers (the exact principal quantum number n matters less, as long as you know their ordering for multiple shells of a given angular momentum).
|
|
175
|
+
- The projection coefficients for each band+state on each orbital in shape `tju`. They should be projections onto real orbitals (`crawfish` applies no phase correction to user projections). It is critical that you have the actual projections and not their absolute values (the latter typically dumped as it is all that is needed for pDOS analysis) as taking the absolute value removes all information about the phase of the orbital at that band+state (bonding vs antibonding interaction is determined solely by the matching of phases between two orbitals). The ordering of the projections must match the ordering of the atoms as given in the Structure (ie for an all-electron calculation of an Li2 structure, projections 0-3 should correspond to Li #1's 1s, Li #1's 2s, Li #2's 1s, and Li #2's 2s).
|
|
176
|
+
2. Initialize an empty `ElecData` object with the class method `edata = ElecData.as_empty()` to circumvent initialization procedures for JDFTx calculations.
|
|
177
|
+
3. Set `user_proj_tju` (ie `edata.user_proj_tju = np.random.random([10,5,4])`). This will not be touched, and all projection manipulations will be performed on a copy of this array. This will automatically define `nstates`, `nbands`, and `nproj`.
|
|
178
|
+
4. Set the `atom_orb_labels_dict` property for the class as a dictionary mapping each element in your calculation to a list of strings giving the quantum numbers of the projections gathered for that element (ie for a calculation of C2H4O, set `edata.atom_orb_labels_dict = {"H": ["s"], "C": ["s", "px", "py", "pz"], "O": ["s", "px", "py", "pz"]}`). If you do not wish to perform orbital resolution on your analysis, it does not matter what you put here, as long as all the elements of each list are unique and the list length matches the number of projections for that element. The ordering of the projections must match the ordering as they are listed in your `user_proj_tju`. If you have multiple projections for a given angular momentum, include the principal quantum number as well (ie `["1s", "2s"]`; they do not need to be the true principal quantum numbers).
|
|
179
|
+
5. Set `kfolding` (ie `edata.kfolding = [3,3,3]`). If you are unsure but know `nspin`, set as `[int(edata.nstates/nspin), 1, 1]`.
|
|
180
|
+
6. Set `wk_t` (ie `edata.wk_t = np.ones(edata.nstates)*(2/edata.nspin)/np.prod(edata.kfolding)`). If you are unsure, just make sure they sum to 2.
|
|
181
|
+
7. Set the fermi level as `edata.mu` (if you are going to set `occ_tj` explicitly, this step becomes optional but is still useful for plotting).
|
|
182
|
+
|
|
183
|
+
### Optional
|
|
184
|
+
|
|
185
|
+
8. If you have the state/band occupation, set it as `edata.occ_tj`, per state in [0, 1]. Otherwise, it will be calculated for you using `edata.broadening` and `edata.broadening_type`.
|
|
186
|
+
|
|
187
|
+
## Installation
|
|
188
|
+
|
|
189
|
+
### pip
|
|
190
|
+
|
|
191
|
+
`crawfish` is on PyPI as `co-crawfish` (the name `crawfish` belongs to another project there). The module you import is still `crawfish`.
|
|
192
|
+
|
|
193
|
+
1. Activate the Python environment you wish to use when performing pCOHP analysis. crawfish needs Python 3.12 or newer (its tests run on 3.12 to 3.14). If you are worried about dependency conflicts, I would recommend creating a conda virtual environment with one of those Python versions.
|
|
194
|
+
2. **Until pymatgen-core's next release:** crawfish needs the JDFTx IO module of pymatgen-core as it is on GitHub (`main`), which is newer than the latest PyPI release (2026.10.31). Install that first, or step 3 fails because pip finds no pymatgen-core version it can use.
|
|
195
|
+
```sh
|
|
196
|
+
pip install git+https://github.com/materialsproject/pymatgen-core.git
|
|
197
|
+
```
|
|
198
|
+
Skip this step once PyPI has a pymatgen-core release newer than 2026.10.31.
|
|
199
|
+
3. Install crawfish
|
|
200
|
+
```sh
|
|
201
|
+
pip install co-crawfish
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
To install from source instead (for the examples and tests, or to edit the code), do step 2, clone this repo, and run `pip install .` in it.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0.3"] # first setuptools that takes `license = "MIT"` as an SPDX string
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "co-crawfish" # the PyPI name ("crawfish" is taken there); the import name is still `crawfish`
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Bonding analysis (pDOS, pCOHP, pCOOP, pCOBI, pCOMO) on JDFTx calculations"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12" # pymatgen-core's minimum
|
|
11
|
+
authors = [{ name = "Ben Rich", email = "benjamin.rich@colorado.edu" }]
|
|
12
|
+
license = "MIT"
|
|
13
|
+
license-files = ["LICENSE"]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
dependencies = [
|
|
17
|
+
"matplotlib>=3.8",
|
|
18
|
+
"numpy>=1.25.0,<3",
|
|
19
|
+
"numba>=0.55",
|
|
20
|
+
"scipy",
|
|
21
|
+
"ase>=3.23.0",
|
|
22
|
+
# crawfish needs the JDFTx IO of pymatgen-core PRs 319-324 (merged 2026-11-25), which the latest PyPI
|
|
23
|
+
# release (2026.10.31) lacks, and PyPI accepts no git URL here. This takes anything newer: the next
|
|
24
|
+
# release, or a build of GitHub main (2026.10.31.post1.dev..., which ">2026.10.31" would refuse).
|
|
25
|
+
# Switch to "pymatgen-core>=<release>" once that release exists.
|
|
26
|
+
"pymatgen-core>=2026.10.31,!=2026.10.31",
|
|
27
|
+
"libtetrabz>=0.1.1",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Repository = "https://github.com/benrich37/crawfish"
|
|
32
|
+
Issues = "https://github.com/benrich37/crawfish/issues"
|
|
33
|
+
|
|
34
|
+
[tool.setuptools.dynamic]
|
|
35
|
+
version = { attr = "crawfish.__version__" }
|
|
36
|
+
|
|
37
|
+
[tool.ruff]
|
|
38
|
+
target-version = "py310"
|
|
39
|
+
line-length = 120
|
|
40
|
+
output-format = "concise"
|
|
41
|
+
|
|
42
|
+
[tool.pdm.dev-dependencies]
|
|
43
|
+
lint = ["mypy>=1.10.0", "pre-commit>=3.7.1", "ruff>=0.4.9"]
|
|
44
|
+
test = ["pytest-cov>=5.0.0", "pytest-split>=0.9.0", "pytest>=8.2.2"]
|
|
45
|
+
|
|
46
|
+
[tool.pyright]
|
|
47
|
+
typeCheckingMode = "off"
|
|
48
|
+
reportPossiblyUnboundVariable = true
|
|
49
|
+
reportUnboundVariable = true
|
|
50
|
+
reportMissingImports = false
|
|
51
|
+
reportMissingModuleSource = false
|
|
52
|
+
reportInvalidTypeForm = false
|
|
53
|
+
exclude = ["**/tests"]
|
|
54
|
+
|
|
55
|
+
[tool.pydocstyle]
|
|
56
|
+
exclude = ["**/tests"]
|
|
57
|
+
|
|
58
|
+
[tool.ruff.format]
|
|
59
|
+
docstring-code-format = true
|
|
60
|
+
|
|
61
|
+
[tool.codespell]
|
|
62
|
+
ignore-words-list = """
|
|
63
|
+
te,initalized,auxilliary,commun
|
|
64
|
+
"""
|