Skip to content

Commit

Permalink
Simplify check
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Sep 20, 2024
1 parent 0bafe76 commit 0bfdd48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/System/OnsiteCoupling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ 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 && norm(matrep) > 1e-12 && matrep matrep[1, 1] * I
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
Expand Down

0 comments on commit 0bfdd48

Please sign in to comment.