-
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
Rename cellsites
to sites
and polish indexing API
#277
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #277 +/- ##
=======================================
Coverage 92.52% 92.52%
=======================================
Files 37 37
Lines 6101 6129 +28
=======================================
+ Hits 5645 5671 +26
- Misses 456 458 +2 ☔ View full report in Codecov by Sentry. |
Note: we are still missing indexing of |
In the current unreleased master we may index
x::Lattice
s andx::GreenSolution
s usings = cellsites(cell, inds)
, likex[s]
orx[s,s´]
, wherex[s] === x[s,s]
.This PR does three things:
cellsites
to the simplersites
, which is already exported, and now takes on an additional new role. We intend this to be the stable API starting with Quantica v1.1.sites(inds)
withoutcell
, which defaults to a 0Dcell::SVector{0,Int}
. When indexing, we check if the cell is 0D, and in such case we sanitize it to be the zero cell of the appropriate lattice dimension. Hence cell-less indexing likelat[sites(inds)]
behaves as zero-cell indexinglat[sites(Quantica.zerocell(lat), inds)]
.h::AbstractHamiltonian
,h[sites(...)]
andh[sites(...), sites(...)]
. This returns always a flat block, much like forGreenSolutions
, but sparse.