Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ReducedShiftedKrylov.jl

CI Documentation

Reduced-Shifted Conjugate Gradient (RSCG) method for solving multiply shifted linear systems with Hermitian matrices.

Overview

Solves (σⱼI + A) x(σⱼ) = b for multiple shifts σ₁, σ₂, ..., σₘ simultaneously, with the same computational cost as a single system.

Key feature: Reduced mode computes Ξ = V * x directly without storing full solution vectors, enabling memory-efficient Green's function calculations.

Installation

using Pkg
Pkg.add(url="https://github.com/hsugawa8651/ReducedShiftedKrylov.jl")

Quick Start

using LinearAlgebra
using ReducedShiftedKrylov

# Hermitian matrix and right-hand side
n = 100
H = rand(ComplexF64, n, n)
A = Hermitian(H + H' + 2n * I)
b = rand(ComplexF64, n)

# Multiple shifts (can be complex)
shifts = [0.1im, 0.2im, 0.3im, 0.4im, 0.5im]

# Solve all systems simultaneously
x, stats = rscg(A, b, shifts)

# x[j] is the solution for (A + shifts[j]*I) x = b

Reduced Mode (for Green's function)

# Reduction matrix: extract specific components
m = 5  # reduced dimension
V = zeros(ComplexF64, m, n)
for i in 1:m
    V[i, i] = 1.0
end

# Compute Ξ = V * x directly (memory efficient)
Ξ, stats = rscg(A, b, shifts, V)

# Ξ[j] ∈ C^m instead of x[j] ∈ C^n

References

License

MIT License

About

Reduced shifted Krylov subspace methods

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages