Giter VIP home page Giter VIP logo

compactbases.jl's Issues

Intermittent convergence estimate failures

The same set of data points can lead to different estimates of the convergence rate, which sometimes leads to tests failing:

image

It does not seem to be dependent on architecture or Julia version, e.g. a recent failure on Mac, nightly:
https://travis-ci.org/github/JuliaApproximation/CompactBases.jl/jobs/701688381#L386

transpose(::Basis) as opposed to adjoint(::Basis)

For discretization of non-Hermitian operators in non-uniform finite-differences, it can be advantageous to work with separate left- and right-vectors, where the inner product is computed as transpose(left)*right (i.e. the first argument is not conjugated), instead of u'*S*u. The reason is that the metric S is dense, and it's more efficient to work with a biorthogonal set of vectors.

How should this be represented in the ContinuumArrays framework? I'm thinking something like this:

R = Basis(...)

u = ...
# The current way of computing the norm (inner product) would be
u'*R'*R*u
# or equivalently
dot(u, R'R, u) # R'R is dense

uc = (R'R)*u # Left vector
# The new way of computing norms/inner products
transpose(uc)*transpose(R)*R*u
# or equivalently
dotu(uc, u)

I am not entirely satisfied by this, ideally one would always write an inner product as dot(u, S, v), and this would figure out if u is a left-vector that should be transposed in the biorthogonal case or adjointed in the normal case.

Cleanup densities

Remove old specialized densities and make broadcast dispatch to the new Density struct.

Update documentation plots to use CompactBases.ShiftAndInvert

Should use built-in functionality instead of duplicating

struct ShiftAndInvert{TA,TB,TT}
A⁻¹::TA
B::TB
temp::TT
end
Base.size(S::ShiftAndInvert, args...) = size(S.A⁻¹, args...)
Base.eltype(S::ShiftAndInvert) = eltype(S.A⁻¹)
function LinearAlgebra.mul!(y,M::ShiftAndInvert,x)
mul!(M.temp, M.B, x)
ldiv!(y, M.A⁻¹, M.temp)
end
construct_linear_map(A,B,σ=0) =
ShiftAndInvert(factorize(A-σ*B),B,Vector{eltype(A)}(undef, size(A,1)))
function bsplines_hydrogen_eigenstates()
k = 7
N = 31
a,b = 0,70
coulomb(r) = -1/r
nev = 5
σ = -0.5
n = 1:nev
cfigure("Hydrogen", figsize=(7,9)) do
for (j,(t,x,tol)) in enumerate([(LinearKnotSet(k, a, b, N),
range(a, stop=b, length=500)[2:end-1],
9e-3),
(ExpKnotSet(k, -1.0, log10(b), N),
10 .^ range(-1.0, stop=log10(b), length=500)[2:end-1],
2e-7)])
B = BSpline(t)[:,2:end-1]
xx = axes(B, 1)
S = B'B
χ = B[x,:]
D = Derivative(xx)
∇² = B'*D'*D*B
T = -∇²/2
V = B'*QuasiDiagonal(coulomb.(xx))*B
H = T + V
schurQR,history = partialschur(construct_linear_map(H, S, σ), nev=nev)

Alternate BandedMatrix/BandedBlockBandedMatrix storage for FE-DVR operators

b = A*x is not particularly fast for A isa BlockSkylineMatrix, at least not for the block sizes that commonly arise in FE-DVR. Maybe representing A as a BandedMatrix (thus explicitly storing structural zeros) could improve arithmetic performance due to cache-friendliness? When we get to distributed computing, we could similarly use a BandedBlockBandedMatrix, where each node essentially has a banded matrix with some number of finite elements stored in it, and the only communication between nodes would be the bridge function between two finite elements, i.e. a single scalar. I assume an incomplete factorization could be formed by factorizing each banded matrix, and this could be used as e.g. a preconditioner.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Fix ApplyStyle for restricted bases

R*c where R is a restricted basis will by default use LazyArrays.FlattenMulStyle, e.g.

julia> typeof(applied(*, R, cf))
Applied{LazyArrays.FlattenMulStyle,typeof(*),Tuple{QuasiArrays.SubQuasiArray{Float64,2,FEDVR{Float64,Float64,Fill{Int64,1,Tuple{Base.OneTo{Int64}}}},Tuple{Inclusion{Float64,Interval{:closed,:closed,Float64}},UnitRange{Int64}},false},Array{Float64,1}}}

which will result in dropping the restriction and padding the coefficient vector by zeroes, which we do not want.

Projectors

Projectors are non-trivial in non-orthogonal spaces, cf

  • Soriano, M., & Palacios, J. J. (2014). Theory of projections with
    nonorthogonal basis sets: partitioning techniques and effective
    hamiltonians. Physical Review B, 90(7),
    075128. http://dx.doi.org/10.1103/physrevb.90.075128

It could be useful to implement them in CompactBases.jl.

Reciprocal space

Add reciprocal space to uniform FiniteDifferences, where the derivative operators are diagonal, along with transforms between the spaces using FFT, i.e. spectral derivatives.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.