PAOFLOW.transport.parsers.read_matrix#
Functions#
|
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
oprfrom the sharedHRs/SRsarrays, slices it according to the row/column index metadata onopr.tag, and stores the partial Fourier transform intoopr.- Parameters:
conductor_data (ConductorData) – Conductor input model. Only
conductor_data.atomic_proj.do_overlap_transformationis read, to decide whether overlap blocks are taken fromSRsor 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), andivr(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: setsopr.irows,opr.icols,opr.irows_sgm,opr.icols_sgmfrom the parsedopr.tagmetadata, and overwritesopr.Handopr.Swith the k-resolved Hamiltonian and overlap blocks.- Return type:
None
- Raises:
RuntimeError – If
oprhas not been allocated.ValueError – If
nspin == 2andispinis negative, ifopr.nameis not a recognized block label, or if the required 3D R-vector cannot be found inivr.
Notes
The data source is the in-memory
HRs/SRsarrays produced bypopulate_real_space_hamiltonian; nothing is read from disk. (The legacy.hamfile 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 alongtransport_directionis fixed by the block label (0for on-site blocks,1for coupling blocks, or an explicitivroverride fromopr.tag), while the remaining components come fromopr.ivr_par. The matching row ofivrselects the block fromHRs(andSRswhen 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/icolsindex arrays parsed fromopr.tagand inserted into the real-space tensorsA(Hamiltonian) andS(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.