Skip to content

Commit

Permalink
bypass LAPACK bug in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosanjose committed May 14, 2021
1 parent 647f561 commit db363c9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/test_greens.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,31 @@ end
end

@testset "greens singleshot spectra" begin
# Broken until https://github.com/Reference-LAPACK/lapack/issues/477 comes to julia
h = LP.honeycomb() |> hamiltonian(hopping(1)) |> unitcell((1,-1), region = r->abs(r[2])<3)
g = greens(h, Schur1D())
dos = [-imag(tr(g(w))) for w in range(-3.2, 3.2, length = 101)]
@test all(x -> Quantica.chop(x) >= 0, dos)

# Broken until https://github.com/Reference-LAPACK/lapack/issues/477 comes to julia
h = LP.honeycomb() |> hamiltonian(hopping(1, range = 2)) |> unitcell((1,-1), region = r->abs(r[2])<3)
g = greens(h, Schur1D())
dos = [-imag(tr(g(w))) for w in range(-6, 6, length = 101)]
@test all(x -> Quantica.chop(x) >= 0, dos)

# Broken until https://github.com/Reference-LAPACK/lapack/issues/477 comes to julia
h = LatticePresets.honeycomb() |> hamiltonian(hopping(1)) |> unitcell((1,-1),(2,2)) |> wrap(2)
g = greens(h, Schur1D())
dos = [-imag(tr(g(w))) for w in range(-3.2, 3.2, length = 101)]
@test all(x -> Quantica.chop(x) >= 0, dos)

# Broken until https://github.com/Reference-LAPACK/lapack/issues/477 comes to julia
h = LatticePresets.honeycomb() |> hamiltonian(hopping((r, dr) -> 1/(dr'*dr), range = 1)) |> unitcell((1,-1),(2,2)) |> wrap(2)
g = greens(h, Schur1D())
dos = [-imag(tr(g(w))) for w in range(-3.2, 3.2, length = 101)]
@test all(x -> Quantica.chop(x) >= 0, dos)
if VERSION >= v"1.7.0-DEV"
h = LatticePresets.honeycomb() |> hamiltonian(hopping((r, dr) -> 1/(dr'*dr), range = 1)) |> unitcell((1,-1),(2,2)) |> wrap(2)
g = greens(h, Schur1D())
dos = [-imag(tr(g(w))) for w in range(-3.2, 3.2, length = 101)]
@test all(x -> Quantica.chop(x) >= 0, dos)
end

h = LP.honeycomb() |> hamiltonian(hopping(1)) |> unitcell((2,-2),(3,3)) |> unitcell(1, 1, indices = not(1)) |> wrap(2)
g = greens(h, Schur1D())
# @test_broken Quantica.chop(imag(tr(g(0.2)))) <= 0
g = greens(h, Schur1D())
@test Quantica.chop(imag(tr(g(0.2)))) <= 0
dos = [-imag(tr(g(w))) for w in range(-3.2, 3.2, length = 101)]
Expand Down

0 comments on commit db363c9

Please sign in to comment.