Skip to content

Commit

Permalink
Uncomment contributed build commands (#306)
Browse files Browse the repository at this point in the history
Also add seed to LSWT rotational invariance test for robustness.
  • Loading branch information
ddahlbom authored Aug 30, 2024
1 parent 50075d5 commit ef91b92
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ spinw_sources = filter(endswith(".jl"), readdir(pkgdir(Sunny, "examples", "spinw
spinw_names = [splitext(basename(src))[1] for src in spinw_sources]
spinw_mds = build_examples(spinw_sources, joinpath("examples", "spinw"))

# contributed_mds = isdraft ? [] : prepare_contributed()
contributed_mds = isdraft ? [] : prepare_contributed()


# Build docs as HTML, including the `examples/name.md` markdown built above
Expand All @@ -114,8 +114,8 @@ Documenter.makedocs(;
"index.md",
"Examples" => [
example_mds...,
# "Contributed" => contributed_mds,
"SpinW ports" => spinw_mds,
"Contributed" => contributed_mds,
],
"Guides" => [
"structure-factor.md",
Expand Down
11 changes: 6 additions & 5 deletions test/test_lswt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -459,13 +459,13 @@ end


@testitem "Invariance to spin rotation" begin
using LinearAlgebra
using LinearAlgebra, Random

function build_system(R, D1, D2, J, K1, K2, h, g)
latvecs = lattice_vectors(1, 1, 1, 92, 93, 94)
cryst = Crystal(latvecs, [[0,0,0], [0.4,0,0]]; types=["A", "B"])
infos = [1 => Moment(s=1, g=2), 2 => Moment(s=2, g=R*g*R')]
sys = System(cryst, infos, :dipole)
sys = System(cryst, infos, :dipole; seed=101)

set_onsite_coupling!(sys, S -> S'*R*(D1+D1')*R'*S, 1)
set_onsite_coupling!(sys, S -> S'*R*(D2+D2')*R'*S, 2)
Expand All @@ -479,13 +479,14 @@ end
return sys
end

g = randn(3,3)
Random.seed!(101)
g = randn(3,3)
D1 = randn(3,3)
D2 = randn(3,3)
J = randn(3,3)
J = randn(3,3)
K1 = randn(3,3)
K2 = randn(3,3)
h = randn(3)
h = randn(3)
R1 = Sunny.Mat3(I)
R2 = Sunny.axis_angle_to_matrix(randn(3), 0.46)
sys1 = build_system(R1, D1, D2, J, K1, K2, h, g)
Expand Down

0 comments on commit ef91b92

Please sign in to comment.