PAOFLOW.response.nonlinear_optics#
Second-order optical responses of the PAO Hamiltonian: shift and injection currents, SHG.
The bulk photovoltaic (shift and injection) currents and the second-harmonic susceptibility are
evaluated from the band energies, the interband position matrix
\(r^a_{nm} = -i\,v^a_{nm}/\omega_{nm}\) (\(n\neq m\)), its generalized derivative
\(r^b_{nm;a}\) and the velocity differences \(\Delta^a_{nm} = v^a_{nn}-v^a_{mm}\), all
built at arbitrary k from HRs with PAOFLOW.hamiltonian.bloch_derivatives. The PAO basis
is finite, so the sum rule for \(r^b_{nm;a}\) over all nawf bands is exact within the
tight-binding approximation (orbital centres as the position operator):
with \(w^{ab}_{nm} = \langle n|\partial_a\partial_b H|m\rangle\). Conventions (hbar = 1
inside the kernels; energies in eV, lengths in bohr; SI prefactors applied once at the end):
shift current (normal, T-even), \(J^a = \sigma^{abc}(\omega)E^b(\omega)E^c(-\omega)\) for a field \(E(t) = E(\omega)e^{-i\omega t} + E(-\omega)e^{i\omega t}\):
\[\sigma^{abc}(\omega) = \frac{\pi e^3 g_s}{\hbar^2}\int\!\frac{d^3k}{(2\pi)^3}\sum_{nm} f_{nm}\,\mathrm{Im}\big[r^b_{mn}r^c_{nm;a} + r^c_{mn}r^b_{nm;a}\big]\,\delta(\omega_{nm}-\omega),\]which for \(b = c\) is Eq. (2) of Wang et al. (2017) and twice the \(\sigma^{abb}\) of Sipe and Shkrebtii (2000), who write \(J = 2\sigma EE^*\);
magnetic shift current (T-odd), \(J^a = \sigma_M^{abc}\,\mathrm{Im}[E^b(\omega)E^c(-\omega)]\), \(\sigma_M^{abc} = -\frac{\pi e^3 g_s}{\hbar^2}\int\sum f_{nm}\mathrm{Re}[r^b_{mn}r^c_{nm;a} - r^c_{mn}r^b_{nm;a}]\delta(\omega_{nm}-\omega)\);
injection currents, \(dJ^a/dt = \eta_M^{abc}\,\mathrm{Re}[E^bE^{c*}] + \eta_C^{abc}\, \mathrm{Im}[E^bE^{c*}]\) with the circular (T-even, two-band Berry curvature) and magnetic (T-odd, quantum metric) coefficients
\[\eta_C^{abc} = \frac{2\pi e^3 g_s}{\hbar^2}\int\sum_{nm} f_{mn}\Delta^a_{mn}\, \mathrm{Im}[r^b_{mn}r^c_{nm}]\,\delta(\omega_{nm}-\omega),\qquad \eta_M^{abc} = -\frac{2\pi e^3 g_s}{\hbar^2}\int\sum_{nm} f_{mn}\Delta^a_{mn}\, \mathrm{Re}[r^b_{mn}r^c_{nm}]\,\delta(\omega_{nm}-\omega)\](Chen et al. 2022, Eqs. 9, 12, 13);
SHG, \(P^a(2\omega) = \epsilon_0\chi^{abc}E^b(\omega)E^c(\omega)\), the low-frequency convergent form of Chen et al. (2022), Eqs. (C1)-(C3) (Rashkeev 1998 / Wang 2017 with the T-odd term), with \(\omega\to\omega+i\eta\) in every resonance denominator; the resonant factors are accumulated as transition-energy histograms and convolved once.
A scissor shifts the conduction energies in every resonance and explicit \(1/\omega_{mn}\)
factor while \(r\), \(r_{;a}\) and \(\Delta\) keep the DFT eigenvectors. Pairs
closer than degeneracy_tol are excluded from \(r\) and from the band sums.
Attributes#
Classes#
Band-basis quantities of a block of k-points ( |
Functions#
|
Tensor components |
|
|
|
Rotate the orbital operators to the band basis and build \(r\) and \(r_{;a}\). |
|
Band occupations: a step by band index at 0 K (or by energy if |
|
Normalised \(\delta(x)\) of width |
|
Add the \(\delta\)-function sums of a k-block to |
|
Add the SHG weights of a k-block to the transition-energy histograms |
|
\(\sum_b h_1(E_b)/(E_b-\omega-i\eta) + h_2(E_b)/(E_b-2\omega-i\eta)\) on the grid. |
|
Shift current, injection currents and SHG of |
|
Write |
Module Contents#
- PAOFLOW.response.nonlinear_optics.parse_components(components)[source]#
Tensor components
(a, b, c)from'all','diag', strings ('xyz') or triples.
- class PAOFLOW.response.nonlinear_optics.BandGeometry[source]#
Band-basis quantities of a block of k-points (
hbar = 1, eV and bohr).- Variables:
energies (ndarray
(nb, n))eigenvectors (ndarray
(nb, n, n))omega (ndarray
(nb, n, n)) – \(\omega_{nm} = E_n - E_m\).cluster (ndarray
(nb, n), int) – Index of the degenerate cluster of every band (transitive closure of the pairs closer than the degeneracy tolerance, bands sorted by energy).pair_mask (ndarray
(nb, n, n), bool) – Pairs of bands in different clusters (the diagonal and the intra-cluster pairs excluded).inv_omega (ndarray
(nb, n, n)) – \(1/\omega_{nm}\) on the mask, 0 elsewhere.velocity (ndarray
(nb, 3, n, n)) – \(v^a_{nm}\) (eV bohr).velocity_intra (ndarray
(nb, 3, n, n)) – The intra-cluster blocks of \(v^a\) (zero between clusters): the U(N)-covariant replacement of the band velocities \(v^a_{nn}\) of a degenerate cluster.delta_velocity (ndarray
(nb, 3, n, n)) – \(\Delta^a_{nm} = v^a_{nn} - v^a_{mm}\) (real, gauge-dependent inside clusters; used for the adaptive widths only).position (ndarray
(nb, 3, n, n)) – \(r^a_{nm}\) (bohr), zero on the diagonal and inside the clusters.position_delta (ndarray
(nb, 3, 3, n, n)) –[b, a]-> \((v^a_{\rm intra} r^b - r^b v^a_{\rm intra})_{nm}\), the covariant form of \(r^b_{nm}\Delta^a_{nm}\) (bohr eV bohr).position_derivative (ndarray
(nb, 3, 3, n, n)) –[a, b]-> \(r^b_{nm;a}\) (bohr^2), the U(N)-covariant derivative.
- cluster: numpy.typing.NDArray[numpy.int_][source]#
- PAOFLOW.response.nonlinear_optics.band_geometry(energies, eigenvectors, velocity_orb, curvature_orb, degeneracy_tol=0.0001, dipole_orb=None, dipole_gradient_orb=None)[source]#
Rotate the orbital operators to the band basis and build \(r\) and \(r_{;a}\).
- Parameters:
energies (ndarray
(nb, n))eigenvectors (ndarray
(nb, n, n)) – Columns.velocity_orb (ndarray
(nb, 3, n, n)) – \(v_a\) ofvelocity_and_curvature_operators()(the tight-binding part, without the dipole term).curvature_orb (ndarray
(nb, 3, 3, n, n)) – \(w_{ab}\).degeneracy_tol (float, optional) – Consecutive bands closer than it belong to the same degenerate cluster (eV).
dipole_orb (ndarray
(nb, 3, n, n), optional) – Position dipoles \(d^b(\mathbf k)\) of the orbital basis (bohr, lattice gauge, Hermitian): the position operator beyond the tight-binding approximation is \(\tau + d\).dipole_gradient_orb (ndarray
(nb, 3, 3, n, n), optional) –[a, b]-> \(\partial_a d^b(\mathbf k)\) (bohr^2); required withdipole_orb.
- Return type:
Notes
Bands are grouped in degenerate clusters (
degenerate_clusters()); every quantity is U(N)-covariant, i.e. invariant under a change of basis inside a cluster. With \(G^a_{pq} = v^a_{pq}/\omega_{pq}\) between clusters (zero inside) and \(v^a_{\rm intra}\) the intra-cluster blocks of the velocity,\[r^b_{nm;a} = \frac{i}{\omega_{nm}}\Big[\frac{[v^a_{\rm intra}, v^b]_{nm}}{\omega_{nm}} - w^{ab}_{nm} + [v^b, G^a]_{nm}\Big],\]which reduces to the non-degenerate sum rule (\([v^a_{\rm intra}, v^b]_{nm} = v^b_{nm}\Delta^a_{nm}\)) when every cluster has one band. The product rule behind it is \((\omega r^b)_{;a} = v^a_{NN} r^b - r^b v^a_{MM} + \omega_{NM} r^b_{;a}\) for the clusters \(N \ni n\), \(M \ni m\), the generalisation of \(\partial_a\omega_{nm} = \Delta^a_{nm}\).
With position dipoles the position operator is \(\tau + d(\mathbf k)\): in the band basis \(D = U^\dagger d U\) adds to the velocity (\(v \to v + i\omega D\), i.e. \(r = r^{TB} + D\) between clusters) and the covariant derivative becomes
\[r^b_{nm;a} = r^{TB,b}_{nm;a} + (U^\dagger \partial_a d^b U)_{nm} + [G^{TB,a}, D^b]_{nm} - i\,[D^a_{\rm intra}, r^b]_{nm},\]with \(G^{TB}\) built from the tight-binding velocity and \(D_{\rm intra}\) the intra-cluster blocks of \(D\) (the diagonal dipole shifts the Berry connection).
- PAOFLOW.response.nonlinear_optics.occupations(energies, nocc, temperature_k=0.0, fermi_energy=None)[source]#
Band occupations: a step by band index at 0 K (or by energy if
fermi_energyis given), else Fermi-Dirac.
- PAOFLOW.response.nonlinear_optics.delta_kernel(x, width, smearing='gauss')[source]#
Normalised \(\delta(x)\) of width
width: PAOFLOW’s Gaussian or a Lorentzian.
- PAOFLOW.response.nonlinear_optics.accumulate_shift_and_injection(geometry, occupation, omega_scissored, energy_grid, widths, components, smearing, out, k_weights=None)[source]#
Add the \(\delta\)-function sums of a k-block to
out(unnormalised).- Parameters:
geometry (BandGeometry)
occupation (ndarray
(nb, n))omega_scissored (ndarray
(nb, n, n)) – \(\omega'_{nm}\) with the scissor.energy_grid (ndarray
(ne,))widths (ndarray
(nb, n, n)) – Width of \(\delta(\omega'_{nm}-\omega)\) per pair (eV).components (sequence of
(a, b, c))smearing ({'gauss', 'lorentz'})
out (dict) – Accumulators
'shift','shiftm','injectc','injectm'of shape(ncomp, ne).k_weights (ndarray
(nb,), optional) – Weight of every k-point (orbit sizes of an irreducible wedge); 1 by default.
- PAOFLOW.response.nonlinear_optics.accumulate_shg_histograms(geometry, occupation, energies_scissored, bin_edges, components, out, degeneracy_tol=0.0001, chunk=None, k_weights=None)[source]#
Add the SHG weights of a k-block to the transition-energy histograms
out.Every term of Eqs. (C2)-(C3) of Chen et al. (2022) has the form
weight / (E - c w)withEa (scissored) transition energy andc = 1or2; the weights are binned onbin_edgesintoout['hist1']andout['hist2']((ncomp, nbins), complex, unnormalised) and convolved later byshg_from_histograms(). Array axes are[k, n, m](nfirst);r[:, a]is \(r^a_{nm}\),rd[:, a, b]is \(r^b_{nm;a}\),dv[:, a]is \(\Delta^a_{nm}\).- Parameters:
geometry (BandGeometry)
occupation (ndarray
(nb, n))energies_scissored (ndarray
(nb, n)) – \(E'_n\) (the scissor applied to the conduction bands).bin_edges (ndarray
(nbins + 1,))components (sequence of
(a, b, c))out (dict) –
'hist1','hist2'.degeneracy_tol (float)
chunk (int, optional)
k_weights (ndarray
(nb,), optional) – Weight of every k-point (orbit sizes of an irreducible wedge); 1 by default. k-points per inner chunk of the three-band term (memory).
- PAOFLOW.response.nonlinear_optics.shg_from_histograms(hist1, hist2, bin_centres, energy_grid, eta)[source]#
\(\sum_b h_1(E_b)/(E_b-\omega-i\eta) + h_2(E_b)/(E_b-2\omega-i\eta)\) on the grid.
- PAOFLOW.response.nonlinear_optics.nonlinear_optical_spectra(HRs, a_vectors, alat, cell_volume, orbital_positions_cryst, nelec, nk, energy_grid, *, components='all', eta=0.05, smearing='gauss', adaptive_smearing=None, scissor=0.0, temperature=0.0, fermi_energy=None, degeneracy_tol=0.01, spin_factor=2.0, ispin=0, kblock=128, want=RESPONSES, shg_bin=None, hopping_cutoff=None, position_dipoles=None, dipole_step=0.0001, symmetry_ops_cryst=None, comm=None, progress=False)[source]#
Shift current, injection currents and SHG of
HRson a uniform k-grid.- Parameters:
HRs (ndarray
(nawf, nawf, n1, n2, n3, nspin)) – Real-space PAO Hamiltonian (eV).a_vectors (ndarray
(3, 3)) – Direct lattice vectors (rows, alat units).alat (float) – Lattice parameter (bohr).
cell_volume (float) – Cell volume (bohr^3).
orbital_positions_cryst (ndarray
(nawf, 3)or None) – Orbital centres (crystal coordinates);Noneputs all orbitals at the origin.nelec (float) – Electrons per cell.
nk (sequence of int) – Dense k-grid
(n1, n2, n3).energy_grid (ndarray
(ne,)) – Photon energies (eV).components (‘all’, ‘diag’, or sequence of
'abc'strings / index triples) – Tensor components(a, b, c): current (or polarisation) directiona, fieldsb, c.eta (float) – Width of the \(\delta\) functions (shift, injection) and imaginary part of the SHG resonances (eV).
smearing ({'gauss', 'lorentz'}) – Shape of the \(\delta\) functions.
adaptive_smearing (float, optional) – Yates prefactor
a: per-pair widths \(a|\mathbf v_n-\mathbf v_m|\Delta k\) floored ateta.scissor (float) – Rigid shift of the conduction bands (eV) in the resonance energies.
temperature (float) – Electronic temperature (K); 0 gives step occupations.
fermi_energy (float, optional) – Chemical potential (eV); default: band-index occupations at 0 K, the mid-gap at finite T.
degeneracy_tol (float) – Pairs closer than this (eV) are treated as degenerate and dropped from \(r\) and from the band sums. DFT-derived PAO Hamiltonians have many nearly degenerate pairs whose \(1/\omega\) factors amplify their meV-level numerical asymmetries (the leakage into symmetry-forbidden components of GaAs drops from 30 % to below 1 % between 0.1 and 10 meV), hence the 10 meV default; analytic models can use 1e-4.
spin_factor (float) – \(g_s\) (2 for spin-degenerate bands, 1 for spinors or per collinear channel).
ispin (int) – Spin channel of
HRs.kblock (int) – k-points per block.
want (sequence of {'shift', 'injection', 'shg'}) – Responses computed.
shg_bin (float, optional) – Histogram bin of the SHG transition energies (eV; default
eta / 5).hopping_cutoff (float, optional) – Drop real-space cells with
max |H(n)|below it (eV).position_dipoles (callable, optional) –
K_cryst (nk, 3) -> d (nk, 3, n, n), the Löwdin position dipoles of the orbital basis (bohr, lattice gauge), e.g.position_dipole_operator(): the position operator becomes \(\tau + d(\mathbf k)\) in \(r\) and \(r_{;a}\) (band_geometry()). Its k-gradient is taken by central differences of stepdipole_step(bohr^-1) and completed with the gauge term \(i(\tau_j - \tau_i)_a d_{ij}\).dipole_step (float, optional)
symmetry_ops_cryst (ndarray
(nops, 3, 3), optional) – Point-group operations as integer matrices on fractional k (k' = W k, the convention ofarrays['sym_rot']; time-reversal-combined operations excluded). The dense grid is reduced to its irreducible wedge (orbit sizes as weights), the closure of the requested components under the group is accumulated and the spectra are symmetrised once at the end (PAOFLOW.utils.point_groups), which is exact for the covariant integrands. The operations are checked on the coarse grid (band energies invariant).comm (MPI communicator, optional) – k-points are split over its ranks;
Noneruns serially.progress (bool, optional) – Print the k-block progress of rank 0.
- Returns:
'energy_ev','components'(labels),'shift'and'shiftm'(ncomp, ne)in A/V^2,'injectc'and'injectm'in A V^-2 s^-1,'shg'(ncomp, ne)complex in pm/V (keys present for the responses inwant),'nocc','gap_ev','direct_gap_ev','nk','scissor_ev','eta_ev','spin_factor'.- Return type:
- PAOFLOW.response.nonlinear_optics.write_nonlinear_outputs(data_controller, results, slab_height_bohr=None, suffix='')[source]#
Write
<prefix>_<abc><suffix>.dat(energy, value) through the data controller.- Parameters:
data_controller (DataController)
results (dict) – Of
nonlinear_optical_spectra().slab_height_bohr (float, optional) – For a 2D system the responses are multiplied by this length (shift and injection in nm units, SHG in pm):
nm uA/V^2,nm A V^-2 s^-1,pm^2/V.suffix (str, optional) – Appended to the file stem (e.g.
'_0'for a spin channel).
- Returns:
File names written.
- Return type: