PAOFLOW.transport.io.write_debug#

Debug-only serialization of transport intermediates.

These writers emit human-inspectable artifacts (the legacy .ham file, projectabilities, k-space overlaps) that are not consumed by the transport calculation itself. They run only when debug output is requested.

All inputs are read from the shared DataController store, which is the single source of truth; the caller does not derive or pass them in.

Functions#

write_internal_format_files(output_dir, output_prefix, ...)

Write Hamiltonian and optional overlap matrices in a format that matches the legacy IOTK-style .ham file structure.

write_kham(Hk, f[, spin_component, tag, block_prefix])

Write Hk to an IOTK-style XML file.

write_projectability_files(output_dir, data_controller)

write_overlap_files(output_dir, data_controller, ...)

Module Contents#

PAOFLOW.transport.io.write_debug.write_internal_format_files(output_dir, output_prefix, data_controller, do_overlap_transformation)[source]#

Write Hamiltonian and optional overlap matrices in a format that matches the legacy IOTK-style .ham file structure.

This is a debug-only serialization of the real-space blocks produced by populate_real_space_hamiltonian(), which must have been called first to populate HRs/SRs in the shared data store.

The output includes: - Dimensional and symmetry metadata in a DATA tag - Real-space and reciprocal lattice vectors - K-point list and weights - R-vectors and their weights - Hamiltonian matrix blocks (VR.#) - Overlap matrix blocks (OVERLAP.#), if enabled

Parameters:
  • output_dir (str) – Directory to write the .ham file into (created if missing).

  • output_prefix (str) – Prefix for the output file (e.g., ‘al5_bulk’ → ‘al5_bulk.ham’).

  • data_controller (DataController) – Shared data store. The k-space Hamiltonian/overlap blocks, R-vectors, k-points, lattice vectors, and real-space HRs/SRs are all read from here.

  • do_overlap_transformation (bool) – If True and overlap matrices are present, overlap blocks will be written to the output.

PAOFLOW.transport.io.write_debug.write_kham(Hk, f, spin_component='all', tag='KHAM', block_prefix='KH')[source]#

Write Hk to an IOTK-style XML file.

Parameters:
  • Hk ((nspin, nkpnts, dim, dim) complex ndarray) – Hamiltonian matrices in k-space.

  • output_file (Path) – Destination XML file.

  • spin_component (str) – One of: “all”, “up”, “down”.

  • tag (str) – Name of the XML block (default: “KHAM”).

  • block_prefix (str) – Prefix for matrix block tags (default: “KH” → <KH.1>, <KH.2>, …)

PAOFLOW.transport.io.write_debug.write_projectability_files(output_dir, data_controller)[source]#
PAOFLOW.transport.io.write_debug.write_overlap_files(output_dir, data_controller, do_overlap_transformation)[source]#