You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OrbitalSliceArrays are flat AbstractArrays{<:Number}, so iteration occurs over orbitals, not sites. We can also index them using a[sites(...)...] or view(a, sites[...]...) to get orbital blocks corresponding to stored sites, but often what we need is to simply iterate over all stored sites, and get all the blocks one after the other. We can currently do Quantica.cellsites(orbaxes(a)[1]) to get an iterator of CellSite indices that can be used to index a, but these are not exported.
Proposal
sites(a::OrbitalSliceArrays, i) should be equivalent to Quantica.cellsites(orbaxes(a)[i])
sites(a::OrbitalSliceArrays) should be a CartesianIndices iterator over all indices
The text was updated successfully, but these errors were encountered:
I had forgotten we have an exported siteindexdict(orbaxes(a)[1]) that gives a dictionary over CellIndices and flat indices.
It can be argued that sites means site positions in Quantica, so the above proposal would not be consistent. A more idiomatic interface would be o = orbaxes(a, 1) to be iterable, returning flat index ranges, i.e. the values of siteindexdict(o). Then we could do
for js inorbaxes(m, 2), is inorbaxes(m, 1)
v =view(m, is, js)
#do something with vend
Note that orbaxes(a, n) = orbaxes(a)[n] would also need to be added.
OrbitalSliceArrays are flat AbstractArrays{<:Number}, so iteration occurs over orbitals, not sites. We can also index them using
a[sites(...)...]
orview(a, sites[...]...)
to get orbital blocks corresponding to stored sites, but often what we need is to simply iterate over all stored sites, and get all the blocks one after the other. We can currently doQuantica.cellsites(orbaxes(a)[1])
to get an iterator ofCellSite
indices that can be used to indexa
, but these are not exported.Proposal
sites(a::OrbitalSliceArrays, i)
should be equivalent toQuantica.cellsites(orbaxes(a)[i])
sites(a::OrbitalSliceArrays)
should be a CartesianIndices iterator over all indicesThe text was updated successfully, but these errors were encountered: