Skip to content

The subtype relation of PlanewaveWavefunction is wrong #193

Description

@brainandforce

Currently, PlanewaveWavefunction{D,T} subtypes AbstractArray{T,D}. This runs into serious problems, primarily with indexing behavior.

I propose that we subtype DenseArray{ReciprocalDataGrid{D,T},3} for the following reasons:

  • DenseArray is a stronger bound than AbstractArray and better reflects the layout of the data. (on a related note, more data structures in this package should probably subtype DenseArray)
  • Indexing a PlanewaveWavefunction{D,T} at a single spin, k-point, and band index should return a ReciprocalSpaceData{D,T}. Indices beyond that reach into the contents to be interpreted as a ReciprocalSpaceData{D,T}, and so have fundamentally different behavior.

Such a change would be breaking (warranting a 0.2 release). I may implement this change as a set of unexported structs/methods before the 0.2 release.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingThis would be a breaking change

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions