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

The typing of KPoint{D} needs to be changed #204

Closed
brainandforce opened this issue Nov 20, 2023 · 2 comments · Fixed by #208
Closed

The typing of KPoint{D} needs to be changed #204

brainandforce opened this issue Nov 20, 2023 · 2 comments · Fixed by #208
Labels
breaking This would be a breaking change

Comments

@brainandforce
Copy link
Owner

Currently, KPoint{D} is a subtype of DenseVector{Float64}. In general, we should not be subtyping DenseArray at all, and because the implementation of KPoint{D} is a wrapper for a StaticArray{D,Float64} plus a Float64 shift parameter, we should define the following:

struct KPoint{D,T} <: StaticVector{D,T}
    point::SVector{D,T}
    weight::T
end

This would be a breaking change, as it would propagate to KPointMesh{D}, ReciprocalDataGrid{D}, and PlanewaveWavefunction{D}.

@brainandforce brainandforce added the breaking This would be a breaking change label Nov 20, 2023
@brainandforce
Copy link
Owner Author

brainandforce commented Nov 26, 2023

I have a better idea: a ShiftVector{D,R<:BySpace{D},T} <: StaticVector{D,T} type which can accomodate data shifts in either real or reciprocal space, and KPoint{D,T} aliases ShiftVector{D,ByReciprocalSpace{D},T}.

This should also dramatically simplify the new data grid implementation coming in 0.2.0.

@brainandforce
Copy link
Owner Author

This is already implemented in the next branch and will be resolved by #208.

@brainandforce brainandforce linked a pull request Nov 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This would be a breaking change
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant