Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataGrid and PlanewaveWavefunction now subtype DenseArray #194

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/data/grids.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ correct_shift(k::KPoint) = k

#---Struct definition------------------------------------------------------------------------------#
"""
Electrum.DataGrid{D,B<:LatticeBasis,S<:AbstractVector{<:Real},T} <: AbstractArray{T,D}
Electrum.DataGrid{D,B<:LatticeBasis,S<:AbstractVector{<:Real},T} <: DenseArray{T,D}

Stores a grid of values of type `T` defined in a `D`-dimensional crystal lattice basis of type `B`
with a shift parameter of type `S`.
Expand All @@ -34,7 +34,7 @@ Note that `ReciprocalDataGrid` uses a `KPoint{D}` to represent the shift, as opp
`SVector{D}`. This allows for the concurrent storage of a weight along with the shift, which may be
relevant for wavefunctions which exploit the symmetry of the k-point mesh.
"""
struct DataGrid{D,B<:LatticeBasis,S<:AbstractVector{<:Real},T} <: AbstractArray{T,D}
struct DataGrid{D,B<:LatticeBasis,S<:AbstractVector{<:Real},T} <: DenseArray{T,D}
data::Array{T,D}
basis::B
shift::S
Expand Down
4 changes: 2 additions & 2 deletions src/data/wavefunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Base.LinearIndices(p::PlanewaveIndices) = LinearIndices((p.grange..., p.bands, p
=#

"""
PlanewaveWavefunction{D,T} <: AbstractArray{T,D}
PlanewaveWavefunction{D,T} <: DenseArray{T,D}

Stores the components of a wavefunction constructed from a planewave basis. Usually, the coefficient
data type `T` will be a `ComplexF32`, as in DFT calculations, double precision convergence of the
Expand All @@ -127,7 +127,7 @@ a `D`-dimensional `CartesianIndex` used for accessing each coefficient associate
`PlanewaveWavefunction` instances are mutable, with `getindex()` and `setindex!()` defined for them,
but they are not resizable, and the backing array should not be resized.
"""
struct PlanewaveWavefunction{D,T} <: AbstractArray{T,D}
struct PlanewaveWavefunction{D,T} <: DenseArray{T,D}
basis::ReciprocalBasis{D,Float64}
spins::Vector{SVector{D,Float64}}
kpoints::KPointMesh{D}
Expand Down
Loading