diff --git a/src/System/OnsiteCoupling.jl b/src/System/OnsiteCoupling.jl index 9c617cd99..3f7c9d132 100644 --- a/src/System/OnsiteCoupling.jl +++ b/src/System/OnsiteCoupling.jl @@ -3,6 +3,11 @@ function onsite_coupling(sys, site, matrep::AbstractMatrix) size(matrep) == (N, N) || error("Invalid matrix size.") matrep ≈ matrep' || error("Operator is not Hermitian") + if N == 2 && isapprox(matrep, matrep[1, 1] * I; atol=1e-8) + suggest = sys.mode == :dipole ? " (use :dipole_large_s to reproduce legacy calculations)" : "" + @warn "Onsite coupling is always trivial for quantum spin s=1/2" * suggest + end + if sys.mode == :SUN return Hermitian(matrep) elseif sys.mode == :dipole