Skip to content

Commit

Permalink
add is_real to cft_data (#19)
Browse files Browse the repository at this point in the history
* cft_brtrg_implemented

* hello

* aaa

* aaa

* aaaaaa

* aaaaaaaaa
  • Loading branch information
dartsushi authored Feb 12, 2025
1 parent 591cccf commit 0c03469
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utility/cft.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function cft_data(scheme::TNRScheme; v=1, unitcell=1)
function cft_data(scheme::TNRScheme; v=1, unitcell=1, is_real=true)
# make the indices
indices = [[i, -i, i + 1, -(i + unitcell)] for i in 1:unitcell]
indices[end][3] = 1
Expand All @@ -20,7 +20,11 @@ function cft_data(scheme::TNRScheme; v=1, unitcell=1)
end
end

data = reverse(sort(real.(filter(x -> real(x) > 0, data))))
data = filter(x -> real(x) > 0, data)
data = sort(data; by=x -> real(x), rev=true)
if is_real
data = real(data)
end
return unitcell * (1 / (2π * v)) * log.(data[1] ./ data)
end

Expand Down

0 comments on commit 0c03469

Please sign in to comment.