PAOFLOW.transport.parsers.read_matrix#

Functions#

read_matrix(conductor_data, data_controller, ispin, ...)

Build a k-space operator block from the in-memory real-space Hamiltonian.

Module Contents#

PAOFLOW.transport.parsers.read_matrix.read_matrix(conductor_data, data_controller, ispin, transport_direction, opr)[source]#

Build a k-space operator block from the in-memory real-space Hamiltonian.

Selects the real-space block requested by opr from the shared HRs/SRs arrays, slices it according to the row/column index metadata on opr.tag, and stores the partial Fourier transform into opr.

Parameters:
  • conductor_data (ConductorData) – Conductor input model. Only conductor_data.atomic_proj.do_overlap_transformation is read, to decide whether overlap blocks are taken from SRs or replaced by an identity (on-site) / zero (off-site) block.

  • data_controller (DataController) – Shared PAOFLOW data store. Required arrays: HRs (shape (nrtot, nawf, nawf)), SRs (same shape, only when overlap is enabled), and ivr (shape (nrtot, 3)). Required attributes: nawf, nspin.

  • ispin (int) – Spin index (0-based) selecting the spin channel. Must be non-negative when nspin == 2.

  • transport_direction ({'x', 'y', 'z'}) – Transport direction.

  • opr (OperatorBlock) – Target operator block, mutated in place (see Returns).

Returns:

Mutates opr: sets opr.irows, opr.icols, opr.irows_sgm, opr.icols_sgm from the parsed opr.tag metadata, and overwrites opr.H and opr.S with the k-resolved Hamiltonian and overlap blocks.

Return type:

None

Raises:
  • RuntimeError – If opr has not been allocated.

  • ValueError – If nspin == 2 and ispin is negative, if opr.name is not a recognized block label, or if the required 3D R-vector cannot be found in ivr.

Notes

The data source is the in-memory HRs/SRs arrays produced by populate_real_space_hamiltonian; nothing is read from disk. (The legacy .ham file is now a debug-only artifact and is not an input here.)

Real-space blocks are selected by building the target 3D integer R-vector ivr_aux: the component along transport_direction is fixed by the block label (0 for on-site blocks, 1 for coupling blocks, or an explicit ivr override from opr.tag), while the remaining components come from opr.ivr_par. The matching row of ivr selects the block from HRs (and SRs when overlap is enabled). When overlap is disabled, the on-site block uses the identity at the zero R-vector and zeros elsewhere.

Each selected block is sliced using the irows/icols index arrays parsed from opr.tag and inserted into the real-space tensors A (Hamiltonian) and S (overlap), indexed over the parallel R-vector grid. A partial 2D Fourier transform in the directions orthogonal to the transport axis then yields the k-resolved operator block.