Skip to content

Commit

Permalink
orbsdict -> cellorbsdict
Browse files Browse the repository at this point in the history
  • Loading branch information
pablosanjose committed Jan 15, 2024
1 parent f96cbe0 commit a30d937
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/greenfunction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ sites_to_orbs(c::CellSites{<:Any,<:Union{Symbol,AbstractUnitRange,Integer}}, g)
CellOrbitals(cell(c), flatrange(hamiltonian(g), siteindices(c)))
sites_to_orbs(c::CellOrbitals, g) = c
# fallback for cases where i and j are not *both* contact indices -> convert to OrbitalSlice
sites_to_orbs(::Colon, g) = orbsdict(contactorbitals(g)) # reads ContactOrbitals
sites_to_orbs(i::Integer, g) = orbsdict(contactorbitals(g), i) # reads ContactOrbitals
sites_to_orbs(::Colon, g) = cellorbsdict(contactorbitals(g)) # reads ContactOrbitals
sites_to_orbs(i::Integer, g) = cellorbsdict(contactorbitals(g), i) # reads ContactOrbitals

Base.getindex(g::GreenSolution, i::OrbitalSlice, j::OrbitalSlice) =
mortar((g[si, sj] for si in subcelldict(i), sj in subcelldict(j)))
Expand Down
18 changes: 9 additions & 9 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1862,23 +1862,23 @@ end

#region ## API ##

orbsdict(c::Contacts) = orbsdict(c.orbitals)
cellorbsdict(c::Contacts) = cellorbsdict(c.orbitals)

orbsdict(c::ContactOrbitals) = c.orbsdict
orbsdict(c::ContactOrbitals, i) = c.corbdict[i]
cellorbsdict(c::ContactOrbitals) = c.orbsdict
cellorbsdict(c::ContactOrbitals, i) = c.corbdict[i]

# orbital size of merged contacts or specific contact
flatsize(c::ContactOrbitals) = last(siteoffsets(c))
flatsize(c::ContactOrbitals, i::Integer) = length(contactinds(c, i))
# # orbital size of merged contacts or specific contact
# flatsize(c::ContactOrbitals) = last(siteoffsets(c))
# flatsize(c::ContactOrbitals, i::Integer) = length(contactinds(c, i))

unflatsize(c::ContactOrbitals) = length(siteoffsets(c)) - 1
# unflatsize(c::ContactOrbitals) = length(siteoffsets(c)) - 1

siteoffsets(c::ContactOrbitals, i...) = siteoffsets(orbslice(c), i...)
# siteoffsets(c::ContactOrbitals, i...) = siteoffsets(orbslice(c), i...)

# flatrange(c::ContactOrbitals, iunflat::Integer) =
# siteoffsets(c, iunflat)+1:siteoffsets(c, iunflat+1)

orbranges(c::ContactOrbitals, contact...) = orbranges(orbslice(c, contact...))
# orbranges(c::ContactOrbitals, contact...) = orbranges(orbslice(c, contact...))

# function subcellindex(c::ContactOrbitals, cell::SVector)
# for (i, cell´) in enumerate(c.cells)
Expand Down

0 comments on commit a30d937

Please sign in to comment.