greenWTE.sources
Module for setting up predefined source terms for the WTE solver.
Provides energy-injection sources (diag, full, offdiag) and a gradient-driven source (gradT) used by the
solvers. All functions return a complex tensor with shape (nq, nat3, nat3) and will promote real inputs to
complex64/complex128 based on the floating dtype of the provided arrays.
Functions
|
Temperature-gradient source via anticommutator. |
|
Diagonal heating source. |
|
Full heating source. |
|
Temperature-gradient source. |
|
Off-diagonal heating source. |
- greenWTE.sources.source_term_anticommutator(k_ft: float, velocity_operator: ndarray, phonon_freq: ndarray, linewidth: ndarray, heat_capacity: ndarray, volume: float) ndarray
Temperature-gradient source via anticommutator.
Constructs the same source as
source_term_gradT(). This function is kept for backward compatibility and will be removed in a future release.Deprecated since version 0.2.0: Use
source_term_gradT()instead.- Parameters:
k_ft (float) – Thermal grating wavevector in rad/m.
velocity_operator (cupy.ndarray) – Velocity operator in m/s, shape (nq, nat3, nat3).
phonon_freq (cupy.ndarray) – Phonon frequencies in rad/s, shape (nq, nat3).
linewidth (cupy.ndarray) – Linewidths of each mode in rad/s, shape (nq, nat3).
heat_capacity (cupy.ndarray) – Heat capacity of each mode in J/m^3/K, shape (nq, nat3).
volume (float) – Volume of the system in m^3.
- Returns:
Source term for the temperature gradient, shape (nq, nat3, nat3).
- Return type:
cupy.ndarray
- greenWTE.sources.source_term_diag(heat_capacity: ndarray) ndarray
Diagonal heating source.
Construct \(P(q)\) with diagonal entries proportional to the mode heat capacity at each \(q\), with all off-diagonal entries set to zero. The diagonal is normalized by the total heat capacity summed over all
(q, m)so that the sum over all diagonal elements across allqequals 1.- Parameters:
heat_capacity (cupy.ndarray) – Heat capacity in J/m^3/K of the phonon modes, shape (nq, nat3).
- Returns:
Source term for diagonal heating, shape (nq, nat3, nat3).
- Return type:
cupy.ndarray
- greenWTE.sources.source_term_full(heat_capacity: ndarray) ndarray
Full heating source.
Construct \(P(q)\) with entries proportional to the outer product of per-mode heat capacities at the same \(q\), normalized by the square of the total heat capacity:
P[q] = (h ⊗ h) / (∑ h)^2, whereh = heat_capacity[q]and the sum is over all(q, m).- Parameters:
heat_capacity (cupy.ndarray) – Heat capacity in J/m^3/K of the phonon modes, shape (nq, nat3).
- Returns:
Source term for full heating, shape (nq, nat3, nat3).
- Return type:
cupy.ndarray
- greenWTE.sources.source_term_gradT(k_ft: float, velocity_operator: ndarray, phonon_freq: ndarray, linewidth: ndarray, heat_capacity: ndarray, volume: float) ndarray
Temperature-gradient source.
For each \(q\), define \(\bar N(q) = \mathrm{diag}\!\left(\frac{V\,n_q}{\hbar\,\omega(q)}\,C(q)\right)\) and \(G(q) = \mathrm{diag}(\Gamma(q))\), where \(V\) is the cell volume and \(n_q\) is the number of \(q\)-points. Here \(\omega\) is the phonon frequency, \(\Gamma\) the linewidth, and \(C\) the mode heat capacity. The source is
\[S(q) = \frac{i\,k}{2}\,\{V(q), \bar N(q)\} \;-\; \frac{1}{2}\,\{G(q), \bar N(q)\},\]with the anticommutator \(\{A,B\} = AB + BA\). The overall factor of \(\Delta T\) is intentionally omitted; the outer solver applies it.
- Parameters:
k_ft (float) – Thermal grating wavevector in rad/m.
velocity_operator (cupy.ndarray) – Velocity operator in m/s, shape (nq, nat3, nat3).
phonon_freq (cupy.ndarray) – Phonon frequencies in rad/s, shape (nq, nat3).
linewidth (cupy.ndarray) – Linewidths of each mode in rad/s, shape (nq, nat3).
heat_capacity (cupy.ndarray) – Heat capacity in J/m^3/K of the phonon modes, shape (nq, nat3).
volume (float) – Volume of the system in m^3.
- Returns:
Source term for the temperature gradient, shape (nq, nat3, nat3).
- Return type:
cupy.ndarray
- greenWTE.sources.source_term_offdiag(heat_capacity: ndarray) ndarray
Off-diagonal heating source.
Construct a dense source as in
source_term_full(), then zero the diagonal entries of eachP[q]- Parameters:
heat_capacity (cupy.ndarray) – Heat capacity in J/m^3/K of the phonon modes, shape (nq, nat3).
- Returns:
Source term for off-diagonal heating, shape (nq, nat3, nat3).
- Return type:
cupy.ndarray