Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosanjose committed Jan 30, 2025
1 parent 93c4938 commit 7bb89c5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/test_hamiltonian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ end
for o in (1, (2,3))
h = LatticePresets.honeycomb() |> hamiltonian(hopping((r, dr) -> 1/norm(dr) * I, range = 10), orbitals = o)
@test_throws ArgumentError torus(h, (1,2,3))
@test_throws ArgumentError torus(h, 1)
@test_throws MethodError torus(h, 1)
wh = h |> torus((1,2))
@test wh(()) h(SA[1,2])
wh = torus(h, (1,:))
Expand All @@ -239,15 +239,15 @@ end
wh = torus(h, (:,:))
@test wh == h
@test wh !== h
h = LP.linear() |> supercell(2) |> hopping(1) |> @hopping!((t, r, dr) -> t*(r[1]-1/2))
@test_warn "unexpected results for position-dependent modifiers" torus(h, (0.2,))
end
h2D = LP.square() |> supercell(2, 2) |> hopping(1)
@test_warn "A modified and a non-modified hopping have been wrapped into one" @torus(h2D, SA[2], ϕ)
h2D = LP.square() |> supercell(3, 2) |> hopping(1, range = 2)
@test_warn "Two modified hoppings have been wrapped into one" @torus(h2D, SA[2], ϕ)
h2D = LP.square() |> supercell(3, 3) |> hopping(1, range = 2)
@test_nowarn @torus(h2D, SA[2], ϕ)
h = LP.linear() |> supercell(2) |> hopping(1) |> @hopping!((t, r, dr) -> t*(r[1]-1/2))
@test_warn "Two modified hoppings have been wrapped into one" torus(h, (0.2,))
h = LP.square() |> supercell(2, 2) |> hopping(1)
@test_warn "A modified and a non-modified hopping have been wrapped into one" @torus(h, SA[2], ϕ)
h = LP.square() |> supercell(3, 2) |> hopping(1, range = 2)
@test_warn "Two modified hoppings have been wrapped into one" @torus(h, SA[2], ϕ)
h = LP.square() |> supercell(3, 3) |> hopping(1, range = 2)
@test_nowarn @torus(h, SA[2], ϕ)
end

@testset "hamiltonian HybridSparseMatrix" begin
Expand Down

0 comments on commit 7bb89c5

Please sign in to comment.