-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
338 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
struct TempPsik2{T <: Real} | ||
basis::PlaneWaveBasis{T} | ||
kpoint::Kpoint{T} | ||
ψk::AbstractArray{Complex{T}} | ||
#ψk::AbstractArray3{T} | ||
n_components::Int | ||
n_Gk::Int | ||
n_bands::Int | ||
end | ||
Psik = TempPsik2 | ||
|
||
# Base.@kwdef struct Psi{T <: Real} | ||
# basis::PlaneWaveBasis{T} | ||
# ψ::Vector{Psik{T}} | ||
# end | ||
# Base.length(ψ::Psi) = length(ψ.ψ) | ||
function Psi(basis, ψ) | ||
if length(size(ψ[1])) == 2 | ||
@warn "Temp Hack" | ||
ψ_n = [reshape(ψk, 1, size(ψk)...) for ψk in ψ] | ||
else | ||
ψ_n = ψ | ||
end | ||
[Psik(basis, kpt, ψ_n[ik], size(ψ_n[ik], 1), size(ψ_n[ik], 2), size(ψ_n[ik], 3)) for (ik, kpt) in enumerate(basis.kpoints)] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
@timing function ortho_qr(φk::ArrayType) where {ArrayType <: AbstractArray} | ||
x = convert(ArrayType, qr(φk).Q) | ||
lead_dim = prod(size(φk)[1:2]) | ||
Q = qr(reshape(φk, lead_dim, :)).Q | ||
# TODO: Does not work on the CI, but Ok locally… | ||
#x = convert(ArrayType, reshape(Q, size(φk, 1), size(φk, 2), size(Q, 2))) | ||
T = eltype(φk) | ||
x = convert(ArrayType, reshape(convert(Matrix{T}, Q), size(φk, 1), size(φk, 2), size(φk, 3))) | ||
if size(x) == size(φk) | ||
return x | ||
else | ||
# Sometimes QR (but funnily not always) CUDA messes up the size here | ||
return x[:, 1:size(φk, 2)] | ||
return x[:, :, 1:size(φk, 3)] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.