Skip to content

Commit

Permalink
Merge pull request #161 from pablosanjose/c1deflate_smalljordan
Browse files Browse the repository at this point in the history
Deflating Schur algorithm for quasi1D Green functions
  • Loading branch information
pablosanjose authored May 14, 2021
2 parents adddeae + ea7bc06 commit 6118d1a
Show file tree
Hide file tree
Showing 11 changed files with 742 additions and 495 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"

[compat]
ExprTools = "^0.1"
Expand Down
4 changes: 2 additions & 2 deletions src/Quantica.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function __init__()
end

using StaticArrays, NearestNeighbors, SparseArrays, LinearAlgebra, OffsetArrays,
ProgressMeter, LinearMaps, Random
ProgressMeter, LinearMaps, Random, SuiteSparse

using ExprTools

Expand All @@ -29,7 +29,7 @@ export sublat, bravais, lattice, dims, supercell, unitcell,
bands, vertices,
energies, states, degeneracy,
momentaKPM, dosKPM, averageKPM, densityKPM, bandrangeKPM,
greens, greensolver, SingleShot1D
greens, greensolver, Schur1D

export RegionPresets, RP, LatticePresets, LP, HamiltonianPresets, HP

Expand Down
9 changes: 6 additions & 3 deletions src/bandstructure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Subspace(h::Hamiltonian, args...) = Subspace(h.orbstruct, args...)
Subspace(::Missing, energy, basis, basevert...) =
Subspace(OrbitalStructure(eltype(basis), size(basis, 1)), energy, basis, basevert...)
Subspace(o::OrbitalStructure, energy, basis, basevert...) =
Subspace(energy, unflatten_or_reinterpret(basis, o), o, basevert...)
Subspace(energy, unflatten_orbitals_or_reinterpret(basis, o), o, basevert...)
Subspace(energy::T, basis, orbstruct) where {T} = Subspace(energy, basis, orbstruct, SVector{0,T}())
Subspace(energy::T, basis, orbstruct, basevert) where {T} = Subspace(energy, basis, orbstruct, SVector(T.(basevert)))

Expand All @@ -38,9 +38,10 @@ degeneracy(m::AbstractMatrix) = isempty(m) ? 1 : size(m, 2) # To support sentin

orbitalstructure(s::Subspace) = s.orbstruct

flatten(s::Subspace) = Subspace(s.energy, _flatten(s.basis, s.orbstruct), s.orbstruct, s.basevert)
flatten(s::Subspace) =
Subspace(s.energy, flatten(s.basis, s.orbstruct), s.orbstruct, s.basevert)

unflatten(s::Subspace, o::OrbitalStructure) = Subspace(s.energy, unflatten(s.basis, o), o, s.basevert)
unflatten(s::Subspace, o::OrbitalStructure) = Subspace(s.energy, unflatten_orbitals(s.basis, o), o, s.basevert)

# destructuring
Base.iterate(s::Subspace) = s.energy, Val(:basis)
Expand All @@ -51,6 +52,8 @@ Base.first(s::Subspace) = s.energy
Base.last(s::Subspace) = s.basis
Base.length(s::Subspace) = 2

Base.copy(s::Subspace) = deepcopy(s)

#######################################################################
# Spectrum
#######################################################################
Expand Down
2 changes: 1 addition & 1 deletion src/diagonalizer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ end

function (d::Diagonalizer)(φs)
ϵ, ψ = d(φs, NoUnflatten())
ψ´ = unflatten_or_reinterpret(ψ, d.orbstruct)
ψ´ = unflatten_orbitals_or_reinterpret(ψ, d.orbstruct)
return ϵ, ψ´
end

Expand Down
Loading

0 comments on commit 6118d1a

Please sign in to comment.