Skip to content
Condensed Matter Physics · Spintronics & Magnetism

Spintronics, Spin-Orbit Coupling & Magnon Transport

Formally model Rashba/Dresselhaus SOC, Dzyaloshinskii-Moriya interactions, spin Hall conductivity, Holstein-Primakoff magnon expansions, and spin-transfer torque in Weyl.

Spintronics investigates the coupled transport and collective excitations of electron spin alongside charge, lattice, orbital, and electromagnetic degrees of freedom. From a formal-methods perspective, many of its foundational results—Moriya symmetry constraints on the Dzyaloshinskii–Moriya interaction (DMI), the distinct time-reversal signatures of spin Hall versus anomalous Hall conductivity, the hidden SU(2)SU(2) conservation law at the persistent spin helix (PSH), and 1/S1/S truncation orders in spin-wave theory—are decidable algebraic and symmetry invariants.

Weyl encodes these physical laws directly into the operator type Op_𝔄[γ; q; ρ; h; S] @ ε of its core calculus λWeyl\lambda_{\text{Weyl}}, enforcing symmetry selection rules, dimensional consistency, Hermiticity, and truncation-remainder propagation before any numerical kernel is generated.

1. Physical Background & Type-System Alignment ​

In conventional symbolic or numerical workflows, anti-unitary time reversal T\mathcal{T}, spatial inversion P\mathcal{P}, O(3)O(3) polar/axial vector parity, spin-group representations, and Hermiticity live only in hand derivations. In Weyl, a single given declaration assigns a fundamental field its full physical identity (e.g., S : spin-S on sites(Λ) automatically carries the SU(2)SU(2) algebra, axial-vector (ℓ=1,+)(\ell=1,+) character, T\mathcal{T}-odd and P\mathcal{P}-even parities, and dimension ℏ\hbar), and compound expressions inherit their types homomorphically:

QuantitySymbolP\mathcal{P} ParityT\mathcal{T} ParityO(3)O(3) CharacterWeyl Static Check & Typical Diagnostic
Crystal momentumk\mathbf{k}Odd (−-)Odd (−-)Polar vectorE0510 (product kak a must be dimensionless)
Spin operatorSi,σ\mathbf{S}_i, \boldsymbol{\sigma}Even (++)Odd (−-)Axial vectorE0521 (forbids adding polar and axial vectors)
DMI vectorDij\mathbf{D}_{ij}Odd (−-) (bond center)Even (++)Axial vectorE0530 (inferred as Zero under bond inversion)
Spin currentJia=12{vi,sa}J_i^a = \frac{1}{2}\{v_i, s^a\}Odd (−-)Even (++)PseudotensorE0301 (unsymmetrized visav_i s^a is non-Hermitian)
Spin Hall conductivityσxyz\sigma_{xy}^zEven (++)Even (++)Response tensorOnsager transpose & point-group selection rules
Unit magnetizationm(r)\mathbf{m}(\mathbf{r})Even (++)Odd (−-)Axial vector∣m∣2=1|\mathbf{m}|^2 = 1 refinement constraint

Types as Physical Laws

Any quantity forbidden by declared symmetries receives the singleton type Zero in Weyl. Zero is sound: once the type checker verifies via character inner products that an observable transforms without the trivial irrep, it vanishes identically. Unforbidden quantities are marked allowed and passed to the exact kernel or numerical estimator.

2. Spin-Group Selection Rules ​

This part runs in the current compiler. A symmetry element acts on declared fibers, spin and real space, plus one antilinear bit; momentum transforms with the space part and flips under antilinear elements. A spin group is written by its generators [R_spin ‖ R_space] and closed as an explicit finite group. "Time reversal" is one element, [𝒯_s C₂⊥ ‖ 𝒯_r]: a declaration such as [𝒯_s ‖ E], which would flip spins without being antilinear, is rejected with E0520.

Expectation values and response tensors are declared together with the state they are taken in, and a claim about a component is decided from the invariant subspace of the tensor, computed exactly by averaging over the group:

weyl
model  d-wave altermagnet on the square lattice

units  ℏ = 1
given  Λ : square lattice (lattice constant a : length)
given  t, t_J : energy
given  𝒢 : spin group generated by [E ‖ mmm], [C₂⊥ ‖ C₄z], [𝒯_s C₂⊥ ‖ 𝒯_r], spin rotations about z
given  ρ : equilibrium state invariant under 𝒢
given  M : magnetization in ρ
given  σ_ij : charge conductivity, response of electric current to electric field in ρ
given  σˢ_ij : z-spin conductivity, response of z-spin current to electric field in ρ

define ε(k) ≔ − 2 t (cos(k_x a) + cos(k_y a))
define J(k) ≔ 2 t_J (cos(k_x a) − cos(k_y a))
define Δ(k) ≔ 2 J(k)

claim  Δ : B₁g of 4/mmm
claim  Δ(k) = 0  on  k_x = ± k_y
claim  M_z = 0
claim  σ_[xy] = 0
claim  σ_(xy) = 0
claim  σ_xy = 0
claim  σˢ_xx − σˢ_yy : allowed
bash
$ weylc check examples/altermagnet_selection.weyl
ok: `examples/altermagnet_selection.weyl` passed all static checks

A response tensor is not an equal-time expectation value. An antilinear element maps χAB\chi_{AB} to χBA\chi_{BA} (Onsager), which constrains a single tensor only when AA and BB are the same kind of observable. So the antisymmetric charge conductivity σ_[xy] is removed by the effective time reversal, while the spin conductivity is not constrained by it and σˢ_xx − σˢ_yy survives: the dd-wave spin-splitter response of an altermagnet. Each accepted claim has a rejected counterpart:

bash
error[E0530]: `M_z` is claimed allowed, but `𝒢` forces it to vanish
error[E0530]: `σˢ_xx − σˢ_yy` is not forced to vanish by `𝒢`
error[E0520]: `Δ` transforms as B1g of 4/mmm, not as A1g of 4/mmm

Replacing [C₂⊥ ‖ C₄z] by [E ‖ C₄z] turns the group into that of a ferromagnet: M_z = 0 is then rejected and the dd-wave spin conductivity is forbidden. The quantities that can be declared today are magnetization, electric polarization, orbital moment, charge conductivity and spin conductivity; point groups are the subgroups of m3ˉmm\bar{3}m (hexagonal and trigonal groups are not covered). Sections 3–7 below describe designs that the compiler does not yet accept.

3. Rashba–Dresselhaus SOC & the Persistent Spin Helix Draft ​

In two-dimensional electron gases and heterostructure interfaces lacking spatial inversion symmetry, structural inversion asymmetry (SIA) induces Rashba SOC while bulk inversion asymmetry (BIA) induces linear Dresselhaus SOC:

HR=αR(k×σ)⋅z^=αR(kxσy−kyσx),HD=βD(kxσx−kyσy)H_{\text{R}} = \alpha_R (\mathbf{k} \times \boldsymbol{\sigma}) \cdot \hat{\mathbf{z}} = \alpha_R (k_x \sigma_y - k_y \sigma_x), \qquad H_{\text{D}} = \beta_D (k_x \sigma_x - k_y \sigma_y)

Because k\mathbf{k} is a P\mathcal{P}-odd, T\mathcal{T}-odd polar vector and σ\boldsymbol{\sigma} is a P\mathcal{P}-even, T\mathcal{T}-odd axial vector, every bilinear term is T\mathcal{T}-even and P\mathcal{P}-odd. Declaring spatial inversion invariance on a model containing HRH_{\text{R}} immediately raises E0520 during type checking.

At the fine-tuned point αR=βD=α\alpha_R = \beta_D = \alpha, rotating to the [11ˉ0][1\bar{1}0] and [110][110] axes (k−=kx−ky2k_- = \frac{k_x - k_y}{\sqrt{2}}, σ+=σx+σy2\sigma_+ = \frac{\sigma_x + \sigma_y}{\sqrt{2}}) collapses the SOC into a momentum shift along a single spin axis:

H(k)=ℏ2k22m+2αk−σ+,Q0=4mαℏ2e^−H(\mathbf{k}) = \frac{\hbar^2 k^2}{2m} + 2\alpha k_- \sigma_+, \qquad \mathbf{Q}_0 = \frac{4m\alpha}{\hbar^2}\hat{\mathbf{e}}_-

This produces an exact emergent SU(2)SU(2) Persistent Spin Helix (PSH) symmetry generated by SQ0+=∑kck+Q0,+†ck,−S_{\mathbf{Q}_0}^+ = \sum_{\mathbf{k}} c^\dagger_{\mathbf{k}+\mathbf{Q}_0,+} c_{\mathbf{k},-}, which commutes with HH and suppresses Dyakonov–Perel spin relaxation:

weyl
model  2DEG with Rashba and Dresselhaus spin-orbit coupling

units  ℏ = 1
given  k        : wavevector in ℝ²
given  m        : mass
given  α_R, β_D : energy · length
given  c_{kσ}   : fermion,  σ ∈ {↑, ↓}
given  𝒯        : time reversal        -- anti-unitary: (k, σ) ↦ (−k, −σ)
given  𝒫        : spatial inversion    -- unitary:      (k, σ) ↦ (−k, +σ)

define H_kin ≔ Σ_k (|k|² / (2 m)) Σ_σ c†_{kσ} c_{kσ}
define H_R   ≔ α_R Σ_k Σ_{σσ′} (k_x σʸ − k_y σˣ)_{σσ′} c†_{kσ} c_{kσ′}
define H_D   ≔ β_D Σ_k Σ_{σσ′} (k_x σˣ − k_y σʸ)_{σσ′} c†_{kσ} c_{kσ′}
define H     ≔ H_kin + H_R + H_D

claim  H : Hermitian, invariant under 𝒯
claim  H_R, H_D : 𝒯-even, 𝒫-odd        -- adding `invariant under 𝒫` triggers E0520

-- Persistent Spin Helix (α_R = β_D): rotated spin basis {+, −} of σ₊ = (σˣ + σʸ)/√2
define Q₀    ≔ 4 m α_R · (e_x − e_y) / √2
define Q_PSH ≔ Σ_k c†_{k + Q₀, +} c_{k, −}

claim  [H, Q_PSH] = 0   at α_R = β_D   -- discharged by the exact symbolic kernel

Static Detection of Symmetry Violations

If a contributor accidentally adds claim H : invariant under 𝒫 to the program above, weylc check pinpoints k_x σʸ as P\mathcal{P}-odd (polar coupled to axial) and halts with E0520—with zero matrix construction or diagonalization.

4. Dzyaloshinskii-Moriya Interaction & Chiral Magnetic Textures Draft ​

In magnetic insulators and heavy-metal/ferromagnet bilayers, broken inversion symmetry plus SOC generates the antisymmetric Dzyaloshinskii–Moriya interaction (DMI), competing with symmetric Heisenberg exchange and anisotropy to stabilize spin spirals and magnetic Skyrmions:

Hmag=−J∑⟨i,j⟩Si⋅Sj+∑⟨i,j⟩Dij⋅(Si×Sj)−K∑i(Siz)2−B⋅∑iSiH_{\text{mag}} = -J \sum_{\langle i,j \rangle} \mathbf{S}_i \cdot \mathbf{S}_j + \sum_{\langle i,j \rangle} \mathbf{D}_{ij} \cdot (\mathbf{S}_i \times \mathbf{S}_j) - K \sum_i (S_i^z)^2 - \mathbf{B} \cdot \sum_i \mathbf{S}_i

Moriya's selection rules reduce directly to point-group representation checks at the bond midpoint OijO_{ij}. When OijO_{ij} is an inversion center, the bond-exchanging operation POij:(Si,Sj)↦(Sj,Si)\mathcal{P}_{O_{ij}}: (\mathbf{S}_i, \mathbf{S}_j) \mapsto (\mathbf{S}_j, \mathbf{S}_i) flips the sign of Si×Sj\mathbf{S}_i \times \mathbf{S}_j, forcing Dij=0\mathbf{D}_{ij} = \mathbf{0}. By the same symmetry reasoning, a mirror plane m⊥m_\perp bisecting the bond perpendicularly constrains the DMI vector to lie within the plane (Dij∥m⊥\mathbf{D}_{ij} \parallel m_\perp), whereas a mirror plane m∥m_\parallel containing the bond forces Dij⊥m∥\mathbf{D}_{ij} \perp m_\parallel, which yields the interfacial Néel DMI Dij=D(z^×r^ij)\mathbf{D}_{ij} = D(\hat{\mathbf{z}} \times \hat{\mathbf{r}}_{ij}).

In the continuum limit, a 2D texture m(r)∈S2\mathbf{m}(\mathbf{r}) \in S^2 carries the quantized Skyrmion topological charge:

Q=14π∫m⋅(∂xm×∂ym) d2r∈ZQ = \frac{1}{4\pi} \int \mathbf{m} \cdot (\partial_x \mathbf{m} \times \partial_y \mathbf{m})\, d^2 r \in \mathbb{Z}

Because naive finite differences break integer quantization on a lattice, Weyl models QQ via the Berg–Lüscher spherical solid-angle discretization Ωijk\Omega_{ijk} over oriented triangular plaquettes:

tan⁡Ωijk2=mi⋅(mj×mk)1+mi⋅mj+mj⋅mk+mk⋅mi,Q=14π∑△ijkΩijk\tan\frac{\Omega_{ijk}}{2} = \frac{\mathbf{m}_i \cdot (\mathbf{m}_j \times \mathbf{m}_k)}{1 + \mathbf{m}_i \cdot \mathbf{m}_j + \mathbf{m}_j \cdot \mathbf{m}_k + \mathbf{m}_k \cdot \mathbf{m}_i}, \qquad Q = \frac{1}{4\pi} \sum_{\triangle_{ijk}} \Omega_{ijk}

weyl
model  Interfacial chiral magnet with Néel DMI and Skyrmion charge

given  Λ       : triangular lattice (periodic L × L)
given  S       : spin-S on sites(Λ)
given  J, D, K : energy
given  𝒢       : point group C_{6v}    -- vertical mirrors m_∥ present, inversion 𝒫 broken

define r̂_{ij} ≔ (r_j − r_i) / |r_j − r_i|
define D_{ij}  ≔ D · (ê_z × r̂_{ij})   -- obeys m_∥ constraint: D_{ij} ⊥ mirror plane
define H_mag   ≔ − J Σ_{⟨i,j⟩} S_i · S_j + Σ_{⟨i,j⟩} D_{ij} · (S_i × S_j) − K Σ_i (Sᶻ_i)²

claim  H_mag : Hermitian, local, invariant under 𝒢
claim  D_{ij} = 0   when 𝒫_{O_{ij}} ∈ 𝒢    -- Moriya's first rule discharged statically

-- Berg–Lüscher topological charge on normalized classical spins m_i ∈ S²
given  m : unit axial vector on sites(Λ)
define Ω_{ijk} ≔ 2 atan2(m_i · (m_j × m_k), 1 + m_i · m_j + m_j · m_k + m_k · m_i)
define Q_sky   ≔ (1 / (4 π)) Σ_{△_{ijk} ∈ faces(Λ)} Ω_{ijk}
claim  Q_sky   : integer               -- quantized topological invariant under PBC

5. Spin Current, Kubo Formula & Intrinsic Spin Hall Conductivity Draft ​

In the spin Hall effect (SHE), a longitudinal electric field EyE_y drives a transverse spin current Jxz=σxyzEyJ_x^z = \sigma_{xy}^z E_y even in T\mathcal{T}-invariant materials. Unlike charge current, the conventional symmetrized spin current Jia=12{vi,sa}J_i^a = \frac{1}{2}\{v_i, s^a\} is not conserved in the presence of SOC; its continuity equation acquires a spin-torque source Ta=1iℏ[sa,HSOC]\mathcal{T}^a = \frac{1}{i\hbar}[s^a, H_{\text{SOC}}]:

∂sa∂t+∇⋅Ja=Ta,Jia=Jia+Pτai(∇⋅Pτa=−Ta)\frac{\partial s^a}{\partial t} + \nabla \cdot \mathbf{J}^a = \mathcal{T}^a, \qquad \mathcal{J}_i^a = J_i^a + P_\tau^{ai} \quad (\nabla \cdot \mathbf{P}_\tau^a = -\mathcal{T}^a)

where PτaiP_\tau^{ai} is the torque-dipole density defining the conserved Shi–Zhang–Xiao–Niu spin current. In the DC linear-response limit (ω→0\omega \to 0), the intrinsic spin Hall conductivity is given by the Kubo formula in terms of the spin Berry curvature Ωn,xyz(k)\Omega_{n,xy}^z(\mathbf{k}):

σxyz=−eℏ∫BZddk(2π)d∑nfnk Ωn,xyz(k),Ωn,xyz(k)=−2ℏ2Im⁡∑m≠n⟨unk∣Jxz∣umk⟩⟨umk∣vy∣unk⟩(εnk−εmk)2\sigma_{xy}^z = -\frac{e}{\hbar} \int_{\text{BZ}} \frac{d^d k}{(2\pi)^d} \sum_n f_{n\mathbf{k}}\, \Omega_{n,xy}^z(\mathbf{k}), \qquad \Omega_{n,xy}^z(\mathbf{k}) = -2\hbar^2 \operatorname{Im} \sum_{m \neq n} \frac{\langle u_{n\mathbf{k}} | J_x^z | u_{m\mathbf{k}} \rangle \langle u_{m\mathbf{k}} | v_y | u_{n\mathbf{k}} \rangle}{(\varepsilon_{n\mathbf{k}} - \varepsilon_{m\mathbf{k}})^2}

Because both JxzJ_x^z and EyE_y are T\mathcal{T}-even, σxyz\sigma_{xy}^z is allowed under time-reversal symmetry (in contrast to the T\mathcal{T}-odd anomalous Hall conductivity σxy\sigma_{xy}). When integrating over a discrete Nk×NkN_k \times N_k Brillouin-zone mesh, the result should carry a source recording the mesh, written Epi{BZ-Grid(N_k)} below.

weyl
define v_i      ≔ ∂H / ∂k_i
define Jˣ_z     ≔ (1 / 2) {v_x, sᶻ}             -- anticommutator ensures Jˣ_z : Hermitian
define τᶻ       ≔ − i [sᶻ, H]                    -- spin torque operator (nonzero ⇒ sᶻ not conserved)

claim  Jˣ_z     : Hermitian, 𝒯-even, 𝒫-odd
claim  σˢ_xy    : allowed   under 𝒯              -- not forbidden by time-reversal symmetry

define Ω_{n,xy}^z(k) ≔ − 2 Im Σ_{m ≠ n} ⟨u_{nk} | Jˣ_z | u_{mk}⟩ ⟨u_{mk} | v_y | u_{nk}⟩ / (ε_{nk} − ε_{mk})²
estimate σˢ_xy from − (e / ℏ) ∫_{BZ(N_k)} (d²k / (2π)²) Σ_n f(ε_{nk}) Ω_{n,xy}^z(k)
         -- inferred type: Scalar[conductance] @ (Exact, Epi{BZ-Grid(N_k)})

require uncertainty of σˢ_xy < 10⁻⁴
        otherwise refine N_k by adaptive_berry_mesh

Separating Truncation from Epistemic Uncertainty

Brillouin-zone quadrature introduces no perturbative series truncation, so the truncation component of its tag is the zero ideal and the source component is the grid quadrature. Near small SOC-induced avoided crossings where Ωn,xyz(k)\Omega_{n,xy}^z(\mathbf{k}) spikes, the require check may fail; the otherwise branch then refines the local mesh. The numerical estimate never becomes Exact.

6. Holstein-Primakoff Magnon Expansion & Error-Lattice Truncation Draft ​

To derive collective spin-wave (magnon) excitations around an ordered magnetic state, one maps spin operators to local bosons ai,ai†a_i, a_i^\dagger ([ai,aj†]=δij[a_i, a_j^\dagger] = \delta_{ij}) via the Holstein–Primakoff (HP) transformation and expands in the small parameter 1/S1/S:

Si+=2S1−ni2S ai=2S(ai−ai†aiai4S−ai†ai†aiaiai32S2+O(S−3)),Siz=S−ai†aiS_i^+ = \sqrt{2S}\sqrt{1 - \frac{n_i}{2S}}\,a_i = \sqrt{2S}\left(a_i - \frac{a_i^\dagger a_i a_i}{4S} - \frac{a_i^\dagger a_i^\dagger a_i a_i a_i}{32 S^2} + \mathcal{O}(S^{-3})\right), \quad S_i^z = S - a_i^\dagger a_i

In hand calculations, mixed truncation orders between quartic magnon–magnon interactions (H4H_4) and weak exchange couplings (D/JD/J) are notoriously error-prone. Weyl's error tags record truncation remainders as monomial ideals stored by their minimal generators: linear spin-wave theory (LSWT) retains the quadratic Bogoliubov–de Gennes Hamiltonian H2H_2 under the tag Trunc(O(1/S)), while interacting magnon theory (Dyson–Maleev or quartic self-energy expansions) includes H4H_4 scattering under Trunc(O(1/S²)). In multivariate expansions over (1/S,λ)(1/S, \lambda), products propagate remainders conservatively via I⋅Supp⁡(b0)+J⋅Supp⁡(a0)+IJI \cdot \operatorname{Supp}(b_0) + J \cdot \operatorname{Supp}(a_0) + IJ, avoiding silent rounding to coarse boxes.

In honeycomb or kagome ferromagnets, next-nearest-neighbor DMI D∑⟨ ⁣⟨i,j⟩ ⁣⟩νijz^⋅(Si×Sj)D \sum_{\langle\!\langle i,j \rangle\!\rangle} \nu_{ij} \hat{\mathbf{z}} \cdot (\mathbf{S}_i \times \mathbf{S}_j) maps under HP to complex magnon hopping teffe±iϕai†ajt_{\text{eff}} e^{\pm i\phi} a_i^\dagger a_j—a bosonic Haldane model with nonzero magnon Chern numbers CnC_n and a magnon thermal Hall conductivity:

κxy(T)=−kB2TℏV∑n,kc2(ρB(εnk)) Ωn,xy(k),c2(ρ)=∫0ρ(ln⁡1+tt)2dt\kappa_{xy}(T) = -\frac{k_B^2 T}{\hbar V} \sum_{n, \mathbf{k}} c_2\big(\rho_B(\varepsilon_{n\mathbf{k}})\big)\, \Omega_{n,xy}(\mathbf{k}), \qquad c_2(\rho) = \int_0^\rho \left(\ln\frac{1+t}{t}\right)^2 dt

weyl
model  Honeycomb ferromagnet with NNN DMI (topological magnon insulator)

given  Λ     : honeycomb lattice (sublattices A, B)
given  S     : large spin parameter           -- expansion variable ε_S ≔ 1 / S
given  a_i   : boson on sites(Λ)
given  J, D  : energy

-- Holstein-Primakoff expansion with exact 1/S Dickson-basis truncation
expand S⁺_i ≔ √(2 S) √(1 − a†_i a_i / (2 S)) a_i    to Trunc(O(1/S²))
define Sᶻ_i ≔ S − a†_i a_i

define H_spin ≔ − J Σ_{⟨i,j⟩} S_i · S_j + D Σ_{⟨⟨i,j⟩⟩} ν_{ij} (Sˣ_i Sʸ_j − Sʸ_i Sˣ_j)

expand H_LSWT ≔ bosonic expansion of H_spin   to Trunc(O(1/S))     -- quadratic BdG H₂
expand H_int  ≔ bosonic expansion of H_spin   to Trunc(O(1/S²))    -- includes quartic H₄ scattering

claim  H_LSWT : Hermitian, conserves N_magnon
define C_n    ≔ (1 / (2 π)) ∫_{BZ} Ω_{n,xy}(k) d²k
estimate κ_xy(T) from H_LSWT by bosonic_thermal_hall(T)

7. Spin-Transfer Torque & LLG Dynamics Lowering Draft ​

For device-scale micromagnetics and current-driven domain-wall or Skyrmion motion, magnetization dynamics follows the Landau–Lifshitz–Gilbert–Slonczewski (LLGS) equation with adiabatic and non-adiabatic spin-transfer torque (STT) terms:

∂m∂t=−γ m×Heff+α m×∂m∂t−(u⋅∇)m+β m×(u⋅∇)m\frac{\partial \mathbf{m}}{\partial t} = -\gamma\, \mathbf{m} \times \mathbf{H}_{\text{eff}} + \alpha\, \mathbf{m} \times \frac{\partial \mathbf{m}}{\partial t} - (\mathbf{u} \cdot \nabla)\mathbf{m} + \beta\, \mathbf{m} \times (\mathbf{u} \cdot \nabla)\mathbf{m}

where the effective field Heff=−1μ0MsδE[m]δm\mathbf{H}_{\text{eff}} = -\frac{1}{\mu_0 M_s} \frac{\delta E[\mathbf{m}]}{\delta \mathbf{m}} is obtained variationally from the exchange, DMI, and anisotropy functional, u=gμBP2eMsje\mathbf{u} = \frac{g \mu_B P}{2 e M_s}\mathbf{j}_e is the spin-drift velocity, α\alpha is Gilbert damping, and β\beta is the non-adiabaticity parameter.

Weyl lowers verified spintronic models through its four-layer IR (HIR → SIR → KIR → TIR). At the HIR and SIR layers, the compiler symbolically differentiates E[m]E[\mathbf{m}] to derive Heff\mathbf{H}_{\text{eff}} and verifies norm preservation (m⋅∂tm=0\mathbf{m} \cdot \partial_t \mathbf{m} = 0). Validated stencil loops and RK4 or implicit-midpoint integrators then descend from TIR into MLIR linalg/vector dialects and compile via LLVM AOT into vectorized native libraries. Alongside this path, an isolated ED referee cross-checks small-cluster quantum spin dynamics and magnon dispersions via compare ... with exact diagonalization, while ensuring that floating-point referee data never leaks back into symbolic derivations.

rust
// Vectorized LLGS RHS kernel lowered from Weyl TIR to MLIR/LLVM AOT
pub unsafe extern "C" fn llgs_rhs_kernel(
    m: *const [f64; 3],
    h_eff: *const [f64; 3],
    u_grad_m: *const [f64; 3],
    dm_dt: *mut [f64; 3],
    n_sites: usize,
    gamma: f64, alpha: f64, beta: f64,
) {
    let inv = 1.0 / (1.0 + alpha * alpha);
    for i in 0..n_sites {
        let mi = *m.add(i);
        let hi = *h_eff.add(i);
        let ug = *u_grad_m.add(i);
        let prec = cross(mi, hi);                     // m × H_eff
        let damp = cross(mi, prec);                   // m × (m × H_eff)
        let stt_ad = scale(-1.0, ug);                 // −(u·∇)m
        let stt_na = scale(beta, cross(mi, ug));      // β m × (u·∇)m
        // Explicit Landau-Lifshitz form preserves |m| = 1 invariant
        *dm_dt.add(i) = combine_llgs(mi, prec, damp, stt_ad, stt_na, gamma, alpha, inv);
    }
}

Running weylc performs static symmetry/type checking, ED referee validation, and—on the Draft LLVM AOT path—MLIR compilation. The check half works today; the build invocation below is the planned interface (as noted in Cranelift JIT, LLVM AOT & FFI, there is no weylc build subcommand yet):

bash
$ weylc check spintronics_psh_dmi.weyl
  [ok] H_R, H_D       : Op[Even; 0; 𝒯-even ∧ 𝒫-odd; Herm; local] @ (Exact, ∅)
  [ok] [H, Q_PSH] = 0 : verified by exact symbolic kernel at α_R = β_D
  [ok] Moriya rule    : D_{ij} inferred as Zero under 𝒫_{O_{ij}} ∈ 𝒢
  [ok] H_int (HP)     : bosonic expansion tagged Trunc(O(1/S²)) (Dickson basis: {S⁻²})
  [ok] σˢ_xy          : allowed under 𝒯, uncertainty < 10⁻⁴ @ Epi{BZ-Grid(256×256)}

$ weylc build spintronics_llgs.weyl --target mlir-llvm --verify-ed L=4x4   # planned CLI, not yet implemented
  [ok] ED referee     : max |Δω_magnon| = 2.41e-5 (consistent with Trunc(O(1/S²)))
  [ok] AOT kernel     : emitted target/llgs_rhs_kernel.so (AVX-512 vectorized)

Weyl v0.1 · MIT License