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

Add OrbitalSliceArray #245

Merged
merged 1 commit into from
Feb 28, 2024
Merged

Add OrbitalSliceArray #245

merged 1 commit into from
Feb 28, 2024

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Feb 28, 2024

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 given OrbitalSlice. This is now the default output of fully evaluating a Green function, and of observables such as ldos (which gives an OrbitalSliceVector) and densitymatrix (which gives an OrbitalSliceMatrix). The orbital axes of an m::OrbitalSliceArray can be obtained with orbaxes(m), and are in general a tuple of OrbitalSliceGrouped (which represents groups of orbitals over a lattice grouped by sites).

For non-orbital dimensions these orbaxes could also be Missing. This possibility was brought up by @BacAmorim in #232

One 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 a densitymatrix(...)::OrbitalSliceMatrix, and use it as a parameter for a mean field model, which will now be able to do fast lookups over this OrbitalSliceMatrix for individual sites to update a ParametricHamiltonian in-place, hence implementing a self-consistent mean field efficiently. The remaining changes required to close #229 are now relatively simple.

OrbitalSliceMatrix draft

tests pass?

more tests

update docs

no doctest for OrbitalSliceArrays
@pablosanjose pablosanjose merged commit 3f4445b into master Feb 28, 2024
9 checks passed
@pablosanjose pablosanjose deleted the obsarray branch February 28, 2024 17:52
@pablosanjose pablosanjose mentioned this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant