-
Notifications
You must be signed in to change notification settings - Fork 8
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
Eigenpair accessors #120
Comments
As a side comment: using the |
@fernandopenaranda brings up a good point in slack: in the presence of degeneracies it might be best to have I would argue that So, this would be the revised syntax, with notation
For the moment we will define "degenerate" as we do in bandstructures: energies within |
I fear that indexing a bandstructure with interpolation The obvious way out is to try to leverage tree search algorithms to locate the relevant simplices in O(log(M)) time. I'm not talking about NearestNeighbors.jl, however, but rather something like IntervalTrees.jl or similar that can deal with intervals. So that's one more dependence :-(. IntervalTrees is light, fortunately, but I'd have to see how to implement N-dimensional intervals with it (because our simplices are not 1D). |
What a rabbit hole this is turning out to be! It happens that there is no higher-dimensional version of IntervalTrees.jl in the Julia ecosystem yet (that I could find). I did find a number of intriguing packages that might do do searches of higher dimensional interval sets (e.g. RegionTrees.jl, SpatialIndexing.jl,...), but they are somewhat heavy, and are actually too general for what we need here. The fact is that our search intervals (defined by the bounding boxes of simplices) are not completely arbitrary. Simplices stitch together to form a mesh. Actually, in the current version, simplicesform a structured mesh after projecting out the energy coordinate. (Structured means that vertices are the direct product of given sets of grid values along each axis). I think we can use this structured property to great effect for efficiency, as long as we give up the possibility of having bands with non-structured meshes. Note that a future Dirac-cone point splitting strategy does not need to violate the structured assumption. Locally adaptive band refinement, however, would not be possible. It's important to note that even if we assume structured grids for the k-space, bands are not single values currently (and probably never will, because of the complicated topologies that are possible -- and common), so they are not simply matrices of energies on the structured grid. If bands could be written as matrices, indexing into them So, to start, we need a way to efficiently go In summary, by adding two mapping arrays per band and keeping vertices and simplices lexicographically ordered, we could achieve O(1) retrieval of the simplices that enclose a given |
A completely different alternative:
The There is no need to copy the results of Computing the interpolated energies of a (1) obtain the unique simplex This should avoid all copying until the very end (6). It also requires reimplementing all the |
Oh, I just realized that |
I moved the discussion of the redesign of |
Currently, if we have a
sp = Spectrum(ham)
, we can doenergies(sp)
to obtain the eigenenergies andstates(sp)
to obtain a matrix with the eigenstates. If we have abs = bandstructure(ham, mesh)
, we can dobands(bs)
to obtain a vector ofBand
objects,energies(bs)
to obtain a vector of all energies of all bands andstates(bs, i)
to obtain all the eigenvectors of bandi
.This is a bit of a mess. It also doesn't allow us to directly access one specific eigenvalue of a spectrum or bandstructure. If we want to plot the spatial profile of an eigenstate close to a given energy at a given momentum of
bs
, there is no easy way.I propose redesigning the way we extract eigenvalues and eigenvectors from
Spectrum
,Band
andBandstructure
by defining a convenientgetindex
indexing syntax. The following possibility comes to mind:Spectrum
sp
Band
b
Bandstructure
bs
The trickiest bit here is
b[(ϕᵢ...)]
, which requires identifying the simplices which contain(ϕᵢ...)
inside, and then using linear interpolation of eigenpairs on each. With our current definition of multivalued bands, there can be several such simplices, and as a resultb[(ϕᵢ...)]
can yield several eigenenergies and eigenstates. In order to keep this type-stable, we might need to makeb[(ϕᵢ...)]
aTuple{Vector,Matrix}
, even though the energy vector will most often have a single element. As a result, alsobs[1, (ϕᵢ...)]
will yield aTuple{Vector,Matrix}
. The only methods that may return a singleTuple{Number, Vector}
aresp[1]
,sp[around=0.2]
andbs[(ϕᵢ...), around = 0.2]
. It might be worth considering making all these method returnTuple{Vector,Matrix}
instead.The text was updated successfully, but these errors were encountered: