Skip to content

Commit ffeb7a0

Browse files
committed
bandgap double function mistake
1 parent 8d1f9d6 commit ffeb7a0

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name = "DFControl"
22
uuid = "1e31e15d-4957-550d-a244-318eced754ae"
33
authors = ["Louis Ponet <[email protected]>"]
44
repo = "https://github.com/louisponet/DFControl.jl.git"
5-
version = "0.5.30"
5+
version = "0.5.31"
66

77
[deps]
88
ANSIColoredPrinters = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"

src/types.jl

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,21 +34,6 @@ StructTypes.StructType(::Type{<:AbstractBand}) = StructTypes.Mutable()
3434
bandgap(bands::AbstractVector{Band}, n_electrons::Int)
3535
bandgap(bands::AbstractVector{Band}, fermi::Float64)
3636
37-
Calculates the bandgap (possibly indirect) around the fermi level.
38-
"""
39-
function bandgap(bands::Union{Iterators.Flatten,AbstractVector{<:AbstractBand}},
40-
n_electrons::Int)
41-
bands = sort(bands, by = x->maximum(eigvals(x)))
42-
if length(bands) < n_electrons+1
43-
error("not enough bands for $n_electrons electrons ($(length(bands)) bands)." )
44-
end
45-
gap = minimum(eigvals(bands[n_electrons+1])) - maximum(eigvals(bands[n_electrons]))
46-
return gap < 0 ? 0.0 : gap
47-
end
48-
49-
"""
50-
bandgap(bands::AbstractVector{Band}, fermi=0.0)
51-
5237
Calculates the bandgap (possibly indirect) around the fermi level.
5338
"""
5439
function bandgap(bands::Union{Iterators.Flatten,AbstractVector{<:AbstractBand}},
@@ -63,7 +48,7 @@ function bandgap(bands::Union{Iterators.Flatten,AbstractVector{<:AbstractBand}},
6348
end
6449

6550
function bandgap(bands::Union{Iterators.Flatten,AbstractVector{<:AbstractBand}},
66-
fermi = 0.0)
51+
fermi::Float64)
6752
max_valence = -Inf
6853
min_conduction = Inf
6954
for b in bands

0 commit comments

Comments
 (0)