Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #232
We define a new type of
OrbitalSliceArray
, following the discussion in #232, that is designed to hold (in principle dense) matrices defined over the orbitals in a givenOrbitalSlice
. This is now the default output of fully evaluating a Green function, and of observables such asldos
(which gives anOrbitalSliceVector
) anddensitymatrix
(which gives anOrbitalSliceMatrix
). The orbital axes of anm::OrbitalSliceArray
can be obtained withorbaxes(m)
, and are in general a tuple ofOrbitalSliceGrouped
(which represents groups of orbitals over a lattice grouped by sites).For non-orbital dimensions these
orbaxes
could also beMissing
. This possibility was brought up by @BacAmorim in #232One critical property of this PR is that
view(::OrbitalSliceMatrix, cellsites(cell1, i::Int), cellsites(cell2, j::Int))
is a non-allocating view of the underlying matrix. This allows us to compute adensitymatrix(...)::OrbitalSliceMatrix
, and use it as a parameter for a mean field model, which will now be able to do fast lookups over thisOrbitalSliceMatrix
for individual sites to update aParametricHamiltonian
in-place, hence implementing a self-consistent mean field efficiently. The remaining changes required to close #229 are now relatively simple.