PAOFLOW.hamiltonian.do_j_to_lm#

Rotate a fully-relativistic Hamiltonian from the J basis to the lm basis.

Fully-relativistic QE calculations (dftSO=True) express the Hamiltonian in the coupled total-angular-momentum basis |j, m_j>. This module rotates the PAOFLOW native real-space Hamiltonian into the QE real-spherical-harmonic (lm) basis, in global_spin_block ordering – all spin-up lm orbitals first, then all spin-down lm orbitals – which matches the layout produced by PAOFLOW.adhoc_spin_orbit. After the rotation the orbital character (s/p/d, m) is well defined, so the orbital-resolved band routines (orbital_projected_bands(), species_orbital_projected_bands(), character_projected_bands()) can be used.

Conventions follow Quantum ESPRESSO / projwfc.x:

  • p orbitals: p_z, p_x, p_y

  • d orbitals: d_z2, d_zx, d_zy, d_x2-y2, d_xy

The per-shell transformation matrices below are taken from a validated notebook (J basis -> QE real harmonics, global_spin_block order) and have been checked for unitarity. Only s, p and d shells (l = 0, 1, 2) are implemented.

Attributes#

Functions#

n_real_orbitals_l(l)

Number of real (lm) orbitals for angular momentum l.

shell_dimension(l)

Spinful dimension of one angular-momentum shell, 2*(2l+1).

spin_block_to_orbital_spin(U, norb)

Reorder rows from [all up][all down] to [orb1 up, orb1 down, ...].

U_s_QE([output_order])

l = 0 block, J basis -> QE real basis. Columns |1/2,-1/2>, |1/2,+1/2>.

U_p_QE([output_order])

l = 1 block, J basis -> QE real basis. QE order p_z, p_x, p_y.

U_d_QE([output_order])

l = 2 block, J basis -> QE real basis. QE order d_z2, d_zx, d_zy, d_x2-y2, d_xy.

U_l_QE(l[, output_order])

Per-shell J -> QE real transformation matrix for l = 0, 1, or 2.

block_diag(mats)

Block-diagonal constructor (complex), without scipy.

global_spin_block_permutation(shells)

Row permutation from shell-by-shell spin blocks to global spin blocks.

build_U_spd(shells[, output_order, check_unitary])

Build the full J -> lm transformation matrix for a flat shell list.

j_basis_labels(data_controller)

Per-column labels of the Hamiltonian before the transform (J basis).

lm_basis_labels(data_controller)

Per-column labels of the Hamiltonian after the transform (lm basis).

j_to_lm_hamiltonian(data_controller[, shells, ...])

Rotate the real-space Hamiltonian from the J basis to the lm basis.

Module Contents#

PAOFLOW.hamiltonian.do_j_to_lm.ORBITALS_QE[source]#
PAOFLOW.hamiltonian.do_j_to_lm.n_real_orbitals_l(l)[source]#

Number of real (lm) orbitals for angular momentum l.

PAOFLOW.hamiltonian.do_j_to_lm.shell_dimension(l)[source]#

Spinful dimension of one angular-momentum shell, 2*(2l+1).

PAOFLOW.hamiltonian.do_j_to_lm.spin_block_to_orbital_spin(U, norb)[source]#

Reorder rows from [all up][all down] to [orb1 up, orb1 down, ...].

PAOFLOW.hamiltonian.do_j_to_lm.U_s_QE(output_order='spin_block')[source]#

l = 0 block, J basis -> QE real basis. Columns |1/2,-1/2>, |1/2,+1/2>.

PAOFLOW.hamiltonian.do_j_to_lm.U_p_QE(output_order='spin_block')[source]#

l = 1 block, J basis -> QE real basis. QE order p_z, p_x, p_y.

PAOFLOW.hamiltonian.do_j_to_lm.U_d_QE(output_order='spin_block')[source]#

l = 2 block, J basis -> QE real basis. QE order d_z2, d_zx, d_zy, d_x2-y2, d_xy.

PAOFLOW.hamiltonian.do_j_to_lm.U_l_QE(l, output_order='spin_block')[source]#

Per-shell J -> QE real transformation matrix for l = 0, 1, or 2.

PAOFLOW.hamiltonian.do_j_to_lm.block_diag(mats)[source]#

Block-diagonal constructor (complex), without scipy.

PAOFLOW.hamiltonian.do_j_to_lm.global_spin_block_permutation(shells)[source]#

Row permutation from shell-by-shell spin blocks to global spin blocks.

Maps row order [shell1 up, shell1 down, shell2 up, shell2 down, ...] to [all up orbitals, all down orbitals]. Acts on the rows of the block-diagonal U; the columns stay in the original PAOFLOW/J order.

PAOFLOW.hamiltonian.do_j_to_lm.build_U_spd(shells, output_order='global_spin_block', check_unitary=True)[source]#

Build the full J -> lm transformation matrix for a flat shell list.

Parameters:
  • shells (list of int) – Angular momenta in PAOFLOW/QE block order (0=s, 1=p, 2=d), one entry per (n, l) shell, concatenated over atoms in the Hamiltonian’s atom order.

  • output_order (str) – ‘global_spin_block’ (default; all up orbitals then all down orbitals, matching adhoc_spin_orbit), ‘spin_block’, or ‘orbital_spin’.

  • check_unitary (bool) – If True, raise when U is not unitary to 1e-12.

Returns:

U – Satisfies H_lm = U H_J U^dagger.

Return type:

np.ndarray, shape (2N, 2N), complex

PAOFLOW.hamiltonian.do_j_to_lm.j_basis_labels(data_controller)[source]#

Per-column labels of the Hamiltonian before the transform (J basis).

Each entry is '<site>_<l>_j<j>_mj<mj>' in the column order assumed for the fully-relativistic HRs: atom-major, shell-by-shell, and within each (n,l) shell the j = l-1/2 block (2l states) followed by the j = l+1/2 block (2l+2 states), each with m_j ascending. Length == nawf. Site is '<species><site-index>' to disambiguate equivalent atoms.

PAOFLOW.hamiltonian.do_j_to_lm.lm_basis_labels(data_controller)[source]#

Per-column labels of the Hamiltonian after the transform (lm basis).

QE real spherical harmonics in global_spin_block order (the adhoc_soc layout): all spin-up lm orbitals first, then all spin-down, each block atom-major and shell-by-shell in ORBITALS_QE order. Length == nawf. Site is '<species><site-index>'.

PAOFLOW.hamiltonian.do_j_to_lm.j_to_lm_hamiltonian(data_controller, shells=None, check_unitary=True)[source]#

Rotate the real-space Hamiltonian from the J basis to the lm basis.

Transforms arry['HRs'] in place to the QE real-harmonic (lm) basis in global_spin_block ordering, refreshes arry['Hks'] to stay consistent, and rebuilds arry['basis'] as the lm spatial orbitals so the orbital-resolved band routines interpret the new basis correctly.

Parameters:
  • data_controller (DataController) – Must provide arry['HRs'] (shape (nawf, nawf, nk1, nk2, nk3, nspin)), and – when shells is None – arry['atoms'] and arry['shells'] (dict species -> list of l).

  • shells (list of int, optional) – Flat shell list (0=s, 1=p, 2=d) in the Hamiltonian’s atom/shell order. Defaults to the list built from arry['atoms']/arry['shells'].

  • check_unitary (bool) – Forwarded to build_U_spd().

Returns:

The transformation matrix U used (shape (nawf, nawf)).

Return type:

np.ndarray