SpinToolkit python documentation
Classes
- class spintoolkit_py.k_cut
Bases:
pybind11_builtins.pybind11_objectTrajectories in k space.
- __init__(self: spintoolkit_py.k_cut, *, lattice: spintoolkit_py.lattice, density: int = 50) None
Constructor.
- Parameters:
lattice – The lattice.
density – Number of points to interpolate between adjacent input momenta. (Default: 50)
- add_k(self: spintoolkit_py.k_cut, *, k_new: list[float]) spintoolkit_py.k_cut
Add new momentum k_new, ALONG WITH many points (determined by “density”) connected to the last momentum in the list.
- Parameters:
k_new – The new momentum end point to be added.
- add_k_discrete(self: spintoolkit_py.k_cut, *, k_new: list[float], l: list[int]) spintoolkit_py.k_cut
Add new momentum k_new, ALONG WITH points connected to the last momentum in the list.
Here, only discrete \(\boldsymbol{k}\)’s allowed on a finite lattice of size \(\{l_0, l_1, ...\}\) will be added.
- Parameters:
k_new – The new momentum point to add.
l – The finite lattice dimensions.
- add_k_single(self: spintoolkit_py.k_cut, *, k_new: list[float]) spintoolkit_py.k_cut
Add new momentum k_new, while OMITTING all intermediate points connected to the last momentum in the list.
- Parameters:
k_new – The new momentum end point to be added.
- jump_k(self: spintoolkit_py.k_cut, *, k_new: list[float]) spintoolkit_py.k_cut
Replace the last momentum in k_list by k_new.
- Parameters:
k_new – The new momentum end point to replace the last one in k_list.
- prt(self: spintoolkit_py.k_cut) None
Print out the full list of momenta.
- size(self: spintoolkit_py.k_cut) int
Return total number of momenta in the trajectory.
- property k_list
All momenta traversed (list[list[float]].
- property len_list
Length of the trajectory in k space (list[float]).
- class spintoolkit_py.k_map
Bases:
pybind11_builtins.pybind11_object2D mesh in k space.
- __init__(self: spintoolkit_py.k_map, *, dim: int, density: int, k0: list[float], k1: list[float], k2: list[float]) None
Construct a parallelogram mesh in k space.
- Parameters:
dim – Dimension of the lattice.
density – Number of points along each linear dimension.
k0 – Position of one vertex of the parallelogram.
k1 – Position of one vertex of the parallelogram.
k2 – Position of one vertex of the parallelogram.
- size(self: spintoolkit_py.k_map) int
Return total number of momenta in the mesh.
- property k_list
All momenta in the mesh (list[list[float]]).
Core Functions
- spintoolkit_py.SSSF(*, lattice: spintoolkit_py.lattice, s: spintoolkit_py.Vec3List, k: list[float], broadening: str, sigma_or_eta: SupportsFloat) tuple[float, float, float, float, float, float, float, float, float]
Calculate the static spin structure factor \(\mathcal{S}^{\mu \nu}(\boldsymbol{k})=S_{\boldsymbol{k}}^\mu S_{-\boldsymbol{k}}^\nu\).
- Parameters:
lattice – Underlying lattice.
s – List of spins.
k – \([k_0, k_1, \ldots]\) that represents momentum \(\boldsymbol{k}= \sum_i k_i \boldsymbol{b}_i\).
broadening – “Lorentzian” or “Gaussian”.
sigma_or_eta – Broadening factor (\(\sigma\) in Gaussian function, or \(\eta\) in Lorentzian function). If sigma_or_eta=0, use discrete Fourier transform.
- Returns:
Sxx (float) – \(\mathcal{S}^{xx}(\boldsymbol{k})\).
Syy (float) – \(\mathcal{S}^{yy}(\boldsymbol{k})\).
Szz (float) – \(\mathcal{S}^{zz}(\boldsymbol{k})\).
SxyPyx_R (float) – \(\mathcal{S}^{xy}(\boldsymbol{k})+\mathcal{S}^{yx}(\boldsymbol{k})\).
SyzPzy_R (float) – \(\mathcal{S}^{yz}(\boldsymbol{k})+\mathcal{S}^{zy}(\boldsymbol{k})\).
SzxPxz_R (float) – \(\mathcal{S}^{zx}(\boldsymbol{k})+\mathcal{S}^{xz}(\boldsymbol{k})\).
SxyMyx_I (float) – \(\left(\mathcal{S}^{xy}(\boldsymbol{k})-\mathcal{S}^{yx}(\boldsymbol{k})\right)/i\), i.e., imaginary part of \(\mathcal{S}^{xy}(\boldsymbol{k})-\mathcal{S}^{yx}(\boldsymbol{k})\).
SyzMzy_I (float) – \(\left(\mathcal{S}^{yz}(\boldsymbol{k})-\mathcal{S}^{zy}(\boldsymbol{k})\right)/i\), i.e., imaginary part of \(\mathcal{S}^{yz}(\boldsymbol{k})-\mathcal{S}^{zy}(\boldsymbol{k})\).
SzxMxz_I (float) – \(\left(\mathcal{S}^{zx}(\boldsymbol{k})-\mathcal{S}^{xz}(\boldsymbol{k})\right)/i\), i.e., imaginary part of \(\mathcal{S}^{zx}(\boldsymbol{k})-\mathcal{S}^{xz}(\boldsymbol{k})\).
- spintoolkit_py.DOS_LSW(*, model: spintoolkit_py.model_spin, R: list[spintoolkit_py.Mat3_rotation], k: list[float], omega_list: list[float], maxeval_2magnon: int, maxeval_3magnon: int, broadening: str, sigma_or_eta: SupportsFloat, epsilon: SupportsFloat) tuple[list[float], float, float]
Calculate the n-magnon density of states (DOS) \(\mathcal{D}_n(\boldsymbol{k},\omega)\) and min/max n-magnon energies at given \(\boldsymbol{k}\), using dipole mode.
Warning: should only be used with the minimal magnetic unit cell.
- Parameters:
model – Underlying model.
R – Rotation matrices of all sites in the magnetic unit cell.
k – \([k_0, k_1, \ldots]\) that represents momentum \(\boldsymbol{k}= \sum_i k_i \boldsymbol{b}_i\).
omega_list – List of energies where \(\mathcal{D}_n(\boldsymbol{k},\omega)\) are calculated.
maxeval_2magnon – Number of integration steps for computing the 2-magnon DOS. If >= 10000 (then maxeval_3magnon must be set to 0), {dos, omega_min, omega_max} will be overwritten by the 2-magnon properties.
maxeval_3magnon – Number of integration steps for computing the 3-magnon DOS. If >= 10000 (then maxeval_2magnon must be set to 0), {dos, omega_min, omega_max} will be overwritten by the 3-magnon properties.
broadening – “Lorentzian” or “Gaussian”.
sigma_or_eta – Broadening factor (\(\sigma\) in Gaussian function, or \(\eta\) in Lorentzian function). If sigma_or_eta<=0, then dos is skipped (only calculate omega_min and omega_max if maxeval >= 10000).
epsilon – Shift \(H_{\tilde{\boldsymbol{k}}}\) by a tiny positive number (\(H_{\tilde{\boldsymbol{k}}} \rightarrow H_{\tilde{\boldsymbol{k}}} + \epsilon \mathbb{1}\)) to improve numerical stability.
- Returns:
dos (list[float]) – \(\mathcal{D}_n(\boldsymbol{k},\omega)\).
omega_min (float) – The minimal energy of the n-magnon band (if maxeval_2magnon >= 10000, then 2-magnon; if maxeval_3magnon >= 10000, then 3-magnon).
omega_max (float) – The maximal energy of the n-magnon band (if maxeval_2magnon >= 10000, then 2-magnon; if maxeval_3magnon >= 10000, then 3-magnon).
- spintoolkit_py.DOS_GLSW(*, model: spintoolkit_py.model_spin, k: list[float], omega_list: list[float], maxeval_2boson: int, maxeval_3boson: int, broadening: str, sigma_or_eta: SupportsFloat, epsilon: SupportsFloat) tuple[list[float], float, float]
Calculate the n-boson density of states (DOS) \(\mathcal{D}_n(\boldsymbol{k},\omega)\) and min/max n-boson energies at given \(\boldsymbol{k}\), using SU(N) mode.
Warning: should only be used with the minimal magnetic unit cell.
- Parameters:
model – Underlying model.
k – \([k_0, k_1, \ldots]\) that represents momentum \(\boldsymbol{k}= \sum_i k_i \boldsymbol{b}_i\).
omega_list – List of energies where \(\mathcal{D}_n(\boldsymbol{k},\omega)\) are calculated.
maxeval_2boson – Number of integration steps for computing the 2-boson DOS. If >= 10000 (then maxeval_3boson must be set to 0), {dos, omega_min, omega_max} will be overwritten by the 2-boson properties.
maxeval_3boson – Number of integration steps for computing the 3-boson DOS. If >= 10000 (then maxeval_2boson must be set to 0), {dos, omega_min, omega_max} will be overwritten by the 3-boson properties.
broadening – “Lorentzian” or “Gaussian”.
sigma_or_eta – Broadening factor (\(\sigma\) in Gaussian function, or \(\eta\) in Lorentzian function). If sigma_or_eta<=0, then dos is skipped (only calculate omega_min and omega_max if maxeval >= 10000).
epsilon – Shift \(H_{\tilde{\boldsymbol{k}}}\) by a tiny positive number (\(H_{\tilde{\boldsymbol{k}}} \rightarrow H_{\tilde{\boldsymbol{k}}} + \epsilon \mathbb{1}\)) to improve numerical stability.
- Returns:
dos (list[float]) – \(\mathcal{D}_n(\boldsymbol{k},\omega)\).
omega_min (float) – The minimal energy of the n-boson band (if maxeval_2boson >= 10000, then 2-boson; if maxeval_3boson >= 10000, then 3-boson).
omega_max (float) – The maximal energy of the n-boson band (if maxeval_2boson >= 10000, then 2-boson; if maxeval_3boson >= 10000, then 3-boson).
- spintoolkit_py.DSSF_GLSW(*, model: spintoolkit_py.model_spin, T: SupportsFloat, k: list[float], omega_list: list[float], eval_1boson: bool, maxeval_2boson: int, maxeval_3boson: int, maxeval_0boson: int, broadening: str, sigma_or_eta: SupportsFloat, epsilon: SupportsFloat) tuple[list[float], list[float], list[float], list[float], list[float], list[float], list[float], list[float], list[float], list[float]]
Calculate the dispersion \(\{\omega_{\boldsymbol{k},1}, \omega_{\boldsymbol{k},2}, \ldots\}\) and the dynamic spin structure factor (DSSF) \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\), using SU(N) mode.
\[\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega) = \frac{1}{2\pi}\int_{-\infty}^{\infty}\text{d}t e^{i \omega t} \left( \langle \hat{S}_{\boldsymbol{k}}^\mu (t) \hat{S}_{-\boldsymbol{k}}^\nu (0) \rangle - \langle \hat{S}_{\boldsymbol{k}}^\mu \rangle \langle \hat{S}_{-\boldsymbol{k}}^\nu \rangle \right),\]where
\[\hat{S}_{\boldsymbol{k}}^\mu = \frac{1}{\sqrt{N_\infty}} \sum_i e^{-i\boldsymbol{k}\cdot \boldsymbol{r}_i} \hat{S}_i^\mu .\]- Parameters:
model – Underlying model.
T – Temperature.
k – \([k_0, k_1, \ldots]\) that represents momentum \(\boldsymbol{k}= \sum_i k_i \boldsymbol{b}_i\).
omega_list – List of energies where \(\mathcal{S}^{\mu \nu}(\boldsymbol{k},\omega)\) are calculated.
eval_1boson – If true, the spectral weight of 1-boson excitation \(\mathcal{S}_1^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
maxeval_2boson – Number of integration steps for computing the 2-boson DSSF. If >= 10000, the free 2-boson continuum \(\mathcal{S}_2^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
maxeval_3boson – Number of integration steps for computing the 3-boson DSSF. If >= 10000, the free 3-boson continuum \(\mathcal{S}_3^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
maxeval_0boson – Number of integration steps for computing the 0-boson DSSF (finite-T transition between excited states). If >= 10000 and T > 0, the free 0-boson continuum \(\mathcal{S}_0^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
broadening – “Lorentzian” or “Gaussian”.
sigma_or_eta – Broadening factor (\(\sigma\) in Gaussian function, or \(\eta\) in Lorentzian function). If sigma_or_eta<=0, then DSSF is skipped (only calculate dispersion).
epsilon – Shift \(H_{\tilde{\boldsymbol{k}}}\) by a tiny positive number (\(H_{\tilde{\boldsymbol{k}}} \rightarrow H_{\tilde{\boldsymbol{k}}} + \epsilon \mathbb{1}\)) to improve numerical stability.
- Returns:
disp (list[float]) – The dispersion \(\{\omega_{\boldsymbol{k},1}, \omega_{\boldsymbol{k},2}, \ldots\}\).
Sxx (list[float]) – \(\mathcal{S}^{xx}(\boldsymbol{k},\omega)\).
Syy (list[float]) – \(\mathcal{S}^{yy}(\boldsymbol{k},\omega)\).
Szz (list[float]) – \(\mathcal{S}^{zz}(\boldsymbol{k},\omega)\).
SxyPyx_R (list[float]) – \(\mathcal{S}^{xy}(\boldsymbol{k},\omega) + \mathcal{S}^{yx}(\boldsymbol{k},\omega)\).
SyzPzy_R (list[float]) – \(\mathcal{S}^{yz}(\boldsymbol{k},\omega) + \mathcal{S}^{zy}(\boldsymbol{k},\omega)\).
SzxPxz_R (list[float]) – \(\mathcal{S}^{zx}(\boldsymbol{k},\omega) + \mathcal{S}^{xz}(\boldsymbol{k},\omega)\).
SxyMyx_I (list[float]) – \(\left(\mathcal{S}^{xy}(\boldsymbol{k},\omega) - \mathcal{S}^{yx}(\boldsymbol{k},\omega)\right)/i\), i.e., imaginary part of \(\mathcal{S}^{xy}(\boldsymbol{k},\omega) - \mathcal{S}^{yx}(\boldsymbol{k},\omega)\).
SyzMzy_I (list[float]) – \(\left(\mathcal{S}^{yz}(\boldsymbol{k},\omega) - \mathcal{S}^{zy}(\boldsymbol{k},\omega)\right)/i\), i.e., imaginary part of \(\mathcal{S}^{yz}(\boldsymbol{k},\omega) - \mathcal{S}^{zy}(\boldsymbol{k},\omega)\).
SzxMxz_I (list[float]) – \(\left(\mathcal{S}^{zx}(\boldsymbol{k},\omega) - \mathcal{S}^{xz}(\boldsymbol{k},\omega)\right)/i\), i.e., imaginary part of \(\mathcal{S}^{zx}(\boldsymbol{k},\omega) - \mathcal{S}^{xz}(\boldsymbol{k},\omega)\).
- spintoolkit_py.DSSF_LSW(*, model: spintoolkit_py.model_spin, R: list[spintoolkit_py.Mat3_rotation], T: float, k: list[float], omega_list: list[float], eval_1magnon: bool, maxeval_2magnon: int, maxeval_3magnon: int, maxeval_0magnon: int, broadening: str, sigma_or_eta: float, epsilon: float) tuple[list[float], list[float], list[float], list[float], list[float], list[float], list[float], list[float], list[float], list[float]]
Calculate the dispersion \(\{\omega_{\boldsymbol{k},1}, \omega_{\boldsymbol{k},2}, \ldots\}\) and the dynamic spin structure factor (DSSF) \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\), using dipole mode.
\[\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega) = \frac{1}{2\pi}\int_{-\infty}^{\infty}\text{d}t e^{i \omega t} \left( \langle \hat{S}_{\boldsymbol{k}}^\mu (t) \hat{S}_{-\boldsymbol{k}}^\nu (0) \rangle - \langle \hat{S}_{\boldsymbol{k}}^\mu \rangle \langle \hat{S}_{-\boldsymbol{k}}^\nu \rangle \right),\]where
\[\hat{S}_{\boldsymbol{k}}^\mu = \frac{1}{\sqrt{N_\infty}} \sum_i e^{-i\boldsymbol{k}\cdot \boldsymbol{r}_i} \hat{S}_i^\mu .\]- Parameters:
model – Underlying model.
R – Rotation matrices of all sites in the magnetic unit cell.
T – Temperature.
k – \([k_0, k_1, \ldots]\) that represents momentum \(\boldsymbol{k}= \sum_i k_i \boldsymbol{b}_i\).
omega_list – List of energies where \(\mathcal{S}^{\mu \nu}(\boldsymbol{k},\omega)\) are calculated.
eval_1magnon – If true, the spectral weight of 1-magnon excitation \(\mathcal{S}_1^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
maxeval_2magnon – Number of integration steps for computing the 2-magnon DSSF. If >= 10000, the free 2-magnon continuum \(\mathcal{S}_2^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
maxeval_3magnon – Number of integration steps for computing the 3-magnon DSSF. If >= 10000, the free 3-magnon continuum \(\mathcal{S}_3^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
maxeval_0magnon – Number of integration steps for computing the 0-magnon DSSF (finite-T transition between excited states). If >= 10000 and T > 0, the free 0-magnon continuum \(\mathcal{S}_0^{\mu\nu}(\boldsymbol{k},\omega)\) is included in \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
broadening – “Lorentzian” or “Gaussian”.
sigma_or_eta – Broadening factor (\(\sigma\) in Gaussian function, or \(\eta\) in Lorentzian function). If sigma_or_eta<=0, then DSSF is skipped (only calculate dispersion).
epsilon – Shift \(H_{\tilde{\boldsymbol{k}}}\) by a tiny positive number (\(H_{\tilde{\boldsymbol{k}}} \rightarrow H_{\tilde{\boldsymbol{k}}} + \epsilon \mathbb{1}\)) to improve numerical stability.
- Returns:
disp (list[float]) - The dispersion \(\{\omega_{\boldsymbol{k},1}, \omega_{\boldsymbol{k},2}, \ldots\}\).
Sxx (list[float]) - \(\mathcal{S}^{xx}(\boldsymbol{k},\omega)\).
Syy (list[float]) - \(\mathcal{S}^{yy}(\boldsymbol{k},\omega)\).
Szz (list[float]) - \(\mathcal{S}^{zz}(\boldsymbol{k},\omega)\).
SxyPyx_R (list[float]) - \(\mathcal{S}^{xy}(\boldsymbol{k},\omega) + \mathcal{S}^{yx}(\boldsymbol{k},\omega)\).
SyzPzy_R (list[float]) - \(\mathcal{S}^{yz}(\boldsymbol{k},\omega) + \mathcal{S}^{zy}(\boldsymbol{k},\omega)\).
SzxPxz_R (list[float]) - \(\mathcal{S}^{zx}(\boldsymbol{k},\omega) + \mathcal{S}^{xz}(\boldsymbol{k},\omega)\).
SxyMyx_I (list[float]) - \(\left(\mathcal{S}^{xy}(\boldsymbol{k},\omega) - \mathcal{S}^{yx}(\boldsymbol{k},\omega)\right)/i\), i.e., imaginary part of \(\mathcal{S}^{xy}(\boldsymbol{k},\omega) - \mathcal{S}^{yx}(\boldsymbol{k},\omega)\).
SyzMzy_I (list[float]) - \(\left(\mathcal{S}^{yz}(\boldsymbol{k},\omega) - \mathcal{S}^{zy}(\boldsymbol{k},\omega)\right)/i\), i.e., imaginary part of \(\mathcal{S}^{yz}(\boldsymbol{k},\omega) - \mathcal{S}^{zy}(\boldsymbol{k},\omega)\).
SzxMxz_I (list[float]) - \(\left(\mathcal{S}^{zx}(\boldsymbol{k},\omega) - \mathcal{S}^{xz}(\boldsymbol{k},\omega)\right)/i\), i.e., imaginary part of \(\mathcal{S}^{zx}(\boldsymbol{k},\omega) - \mathcal{S}^{xz}(\boldsymbol{k},\omega)\).
- spintoolkit_py.DSSF_LSW(*, model: spintoolkit_py.model_spin, k_cut: spintoolkit_py.k_cut, omega_min: float, omega_max: float, dt: float, maxtime: float, dump_dir: str, filename_prefix: str = 'DSSF')
Calculate the dynamic spin structure factor (DSSF) \(\mathcal{S}_\text{quantum}^{\mu\nu}(\boldsymbol{k},\omega)\) by equation of motion (EOM), using dipole mode.
\[\mathcal{S}^{\mu\nu}_\text{quantum}(\boldsymbol{k},\omega) = \frac{1}{2\pi}\int_{-\infty}^{\infty}\text{d}t e^{i \omega t} \left( \langle \hat{S}_{\boldsymbol{k}}^\mu (t) \hat{S}_{-\boldsymbol{k}}^\nu (0) \rangle - \langle \hat{S}_{\boldsymbol{k}}^\mu \rangle \langle \hat{S}_{-\boldsymbol{k}}^\nu \rangle \right),\]where
\[\hat{S}_{\boldsymbol{k}}^\mu = \frac{1}{\sqrt{L}} \sum_i e^{-i\boldsymbol{k}\cdot \boldsymbol{r}_i} \hat{S}_i^\mu .\]To compare with quantum mechanical results, we have multiplied the final intensities by \(\beta \omega\) (valid for \(\beta \omega \gg 1\)):
\[\mathcal{S}^{\mu\nu}_\text{quantum}(\boldsymbol{k},\omega) = \beta \omega \mathcal{S}^{\mu\nu}_\text{classical}(\boldsymbol{k},\omega).\]Note: for Hamiltonian which conserves magnetization in EOM, when \(\mathrm{d}t \rightarrow 0\) (exactly solving), there should be nothing at finite-omega at \(\boldsymbol{k}=0\) (just fourier transforming a constant). So, the tiny numbers at \(\boldsymbol{k}=0\) for small \(\omega\) are artifacts of the numerics with finite \(\mathrm{d}t\). In fact, with small \(\mathrm{d}t\), the weight at finite \(\omega\) and \(\boldsymbol{k}=0\) is indeed negligible; To fully suppress the weight, should use integrator which conserves magnetization in the future.
- Parameters:
model – Underlying model.
k_cut – k-space trajectory for computing \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
omega_min – Lower bound of the energy window for computing \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
omega_max – Upper bound of the energy window for computing \(\mathcal{S}^{\mu\nu}(\boldsymbol{k},\omega)\).
dt – Time step size used in EOM.
maxtime – Total integration time.
dump_dir – The location where the initial equilibrium spin configuration should be prepared; also the location where the final output will be written to.
filename_prefix – Prefix of the output files (“xxx_half.dat” and “xxx_full.dat”). (Default: “DSSF”)
Extension Functions
- spintoolkit_py.generate_lsw_mat(*, model: spintoolkit_py.model_spin, ktilde: list[float], R: list[spintoolkit_py.Mat3_rotation], epsilon: SupportsFloat) spintoolkit_py.MatrixZ
Collect contributions from all terms in the model to the matrix \(H_{\tilde{\boldsymbol{k}}}\), using dipole mode.
- Parameters:
model – Underlying model.
ktilde – \([\tilde{k}_0, \tilde{k}_1, \ldots ]\) that represents momentum \(\tilde{\boldsymbol{k}}= \sum_i \tilde{k}_i \boldsymbol{B}_i\).
R – Rotation matrices of all sites in the magnetic unit cell.
epsilon – Shift \(H_{\tilde{\boldsymbol{k}}}\) by a tiny positive number (\(H_{\tilde{\boldsymbol{k}}} \rightarrow H_{\tilde{\boldsymbol{k}}} + \epsilon \mathbb{1}\)) to improve numerical stability.
- Returns:
H_ktilde – The LSW matrix \(H_{\tilde{\boldsymbol{k}}}\).
- Return type:
- spintoolkit_py.generate_glsw_mat(*, model: spintoolkit_py.model_spin, ktilde: list[float], epsilon: SupportsFloat) spintoolkit_py.MatrixZ
Collect contributions from all terms in the model to the matrix \(H_{\tilde{\boldsymbol{k}}}\), using SU(N) mode.
- Parameters:
model – Underlying model.
ktilde – \([\tilde{k}_0, \tilde{k}_1, \ldots ]\) that represents momentum \(\tilde{\boldsymbol{k}}= \sum_i \tilde{k}_i \boldsymbol{B}_i\).
epsilon – Shift \(H_{\tilde{\boldsymbol{k}}}\) by a tiny positive number (\(H_{\tilde{\boldsymbol{k}}} \rightarrow H_{\tilde{\boldsymbol{k}}} + \epsilon \mathbb{1}\)) to improve numerical stability.
- Returns:
H_ktilde – The GLSW matrix \(H_{\tilde{\boldsymbol{k}}}\).
- Return type:
- spintoolkit_py.Bogoliubov(H_ktilde: spintoolkit_py.MatrixZ) tuple[list[float], list[float], spintoolkit_py.MatrixZ, spintoolkit_py.MatrixZ, spintoolkit_py.MatrixZ, spintoolkit_py.MatrixZ]
Bogoliubov transformation.
\[T_{\tilde{\boldsymbol{k}}}^\dagger H_{\tilde{\boldsymbol{k}}} T_{\tilde{\boldsymbol{k}}} = \text{diag}\{ \omega_{\tilde{\boldsymbol{k}},1},\omega_{\tilde{\boldsymbol{k}},2},\ldots, \omega_{-\tilde{\boldsymbol{k}},1},\omega_{-\tilde{\boldsymbol{k}},2},\ldots \},\]and
\[\begin{split}T_{\tilde{\boldsymbol{k}}}= \begin{pmatrix} X_{\tilde{\boldsymbol{k}}} & Y_{-\tilde{\boldsymbol{k}}}^{*}\\ Y_{\tilde{\boldsymbol{k}}} & X_{-\tilde{\boldsymbol{k}}}^{*} \end{pmatrix}.\end{split}\]Additionally, we require \(T_{\tilde{\boldsymbol{k}}}^\dagger \Sigma^z T_{\tilde{\boldsymbol{k}}} = \Sigma^z\), where \(\Sigma^z = \sigma^z \otimes 1\) is the para-unit matrix.
- Parameters:
H_ktilde – The matrix \(H_{\tilde{\boldsymbol{k}}}\).
- Returns:
disp_ktilde (list[float]) – \(\{\omega_{\tilde{\boldsymbol{k}},1}, \omega_{\tilde{\boldsymbol{k}},2}, \ldots \}\).
disp_mktilde (list[float]) – \(\{\omega_{-\tilde{\boldsymbol{k}},1}, \omega_{-\tilde{\boldsymbol{k}},2}, \ldots \}\).
X_ktilde (~spintoolkit_py.MatrixZ) – \(X_{\tilde{\boldsymbol{k}}}\).
X_mktilde (~spintoolkit_py.MatrixZ) – \(X_{-\tilde{\boldsymbol{k}}}\).
Y_ktilde (~spintoolkit_py.MatrixZ) – \(Y_{\tilde{\boldsymbol{k}}}\).
Y_mktilde (~spintoolkit_py.MatrixZ) – \(Y_{-\tilde{\boldsymbol{k}}}\).
- spintoolkit_py.fourier_spin(*, lattice: spintoolkit_py.lattice, s: spintoolkit_py.Vec3List, k: list[float], sub_index: int = -1) tuple[complex, complex, complex]
Fourier transform of spins.
\[\vec{S}_{\boldsymbol{k}} = \frac{1}{\sqrt{L}} \sum_i e^{-i \boldsymbol{k} \cdot \boldsymbol{r}_i} \vec{S}_i,\]where \(L\) is the total number of lattice sites.
Note: \(\{\boldsymbol{b}_0, \boldsymbol{b}_1, \ldots\}\) are the basis of the original reciprocal space.
- Parameters:
lattice – Underlying lattice.
s – List of spins to be Fourier transformed.
k – \([k_0, k_1, \ldots ]\) that represents momentum \(\boldsymbol{k}= \sum_i k_i \boldsymbol{b}_i\).
sub_index – Index of the sublattice to be used in the Fourier transform. If set to -1 (default), contributions from all sublattices will be added up.
- Returns:
sx_k (complex) – The x-component of the Fourier transformed spins.
sy_k (complex) – The y-component of the Fourier transformed spins.
sz_k (complex) – The z-component of the Fourier transformed spins.
- spintoolkit_py.fourier_spin_fft(*, lattice: spintoolkit_py.lattice, s: spintoolkit_py.Vec3List, BZ: list[int], sub_index: int = -1) tuple[list[complex], list[complex], list[complex]]
Fast Fourier transform of spins for all allowed momenta in a given BZ.
\[\vec{S}_{\boldsymbol{k}}=\frac{1}{\sqrt{L}} \sum_{i} e^{-i \boldsymbol{k} \cdot \boldsymbol{r}_i} \vec{S}_{i},\]where \(L\) is the total number of lattice sites.
The index of \(\boldsymbol{k}= \sum_i \frac{m_i}{l_i} \boldsymbol{b}_i + \boldsymbol{G}\) (\(m_i = 0,\ldots,l_i - 1\)) is:
\(m_0 + m_1 l_0 + m_2 l_0 l_1\) (\(D = 3\));
\(m_0 + m_1 l_0\) (\(D = 2\));
\(m_0\) (\(D = 1\)).
Note: \(\{\boldsymbol{b}_0, \boldsymbol{b}_1, \ldots\}\) are the basis of the original reciprocal space.
Note: for now, only regular lattices (\(\boldsymbol{A}_i \parallel \boldsymbol{a}_i\)) are allowed.
- Parameters:
lattice – Underlying lattice.
s – List of spins to be Fourier transformed.
BZ – The indices of the BZ to be used: \(\boldsymbol{G} = \sum_i \text{BZ}[i] \, \boldsymbol{b}_i\).
sub_index – Index of the sublattice to be used in the Fourier transform. If set to -1 (default), contributions from all sublattices will be added up.
- Returns:
sx_k (list[complex]) – The x-component of the Fourier transformed spins for all \(\boldsymbol{k}\) in the specified BZ.
sy_k (list[complex]) – The y-component of the Fourier transformed spins for all \(\boldsymbol{k}\) in the specified BZ.
sz_k (list[complex]) – The z-component of the Fourier transformed spins for all \(\boldsymbol{k}\) in the specified BZ.