PAOFLOW.topology.do_wave_function_site_projection#

Functions#

wave_function_site_projection(data_controller)

Write real-space site-projected wavefunction weights to a data file.

Module Contents#

PAOFLOW.topology.do_wave_function_site_projection.wave_function_site_projection(data_controller)[source]#

Write real-space site-projected wavefunction weights to a data file.

Parameters:

data_controller (DataController) – Object providing data_arrays and data_attributes. Required arrays: tau (shape (natoms, 3) in Bohr radii), naw (number of orbitals per atom), v_k (shape (nkpnts, nawf, bnd, nspin)), bands_proj (list of band indices to project). Required attributes: nawf, do_spin_orbit, dimension, k_proj (k-point index for the projection), opath.

Returns:

Writes one text file per band index in bands_proj to {opath}/site-projected-wave-function-{bnd_idx}.dat. Each line contains the atomic position coordinates followed by the total site weight plus a small offset (0.0001) for plotting. The number of coordinate columns depends on dimension: 3 columns for 3-D, 2 columns for 2-D and 1-D systems.

Return type:

None

Notes

For each atom \(n\) and selected band index \(b\), the site-projected wavefunction weight at a fixed k-point is

\[w_n = \sum_{\mu \in n} |v^\mu_{bk}|^2\]

where the sum runs over all orbital indices \(\mu\) belonging to atom \(n\). Atomic positions are converted from Bohr radii to Ångström using ANGSTROM_AU before writing.

When spin–orbit coupling is active (do_spin_orbit), the wavefunction basis is doubled and both the spin-up sector \([\text{idx}, \text{fdx})\) and spin-down sector \([\text{idx}+s, \text{fdx}+s)\) (with \(s = N_{\text{wf}}/2\)) are included in the weight sum.

This function is valid only for non-magnetic or non-collinear calculations (spin channel 0 is used exclusively).