Open jagot opened 3 years ago
Why not just add dotu(u, A, v)
?
Basically, I envision being able to run the same calculation in two "modes":
V = Matrix{ComplexF64}(...) # Right-vectors
# Right vectors and metric
U,S = if mode == :hermitian
adjoint(V), R'R
else
(R'R)*V, Diagonal(...)
end
for i = 1:steps
propagate_right_vectors!(V)
mode == :non_hermitian && propagate_left_vectors!(U)
u = transpose(view(U, m, :)) # Some left-vector
v = view(V, :, n) # Some right-vector
uv = dot(u, S, v) # Correct inner product, regardless of propagation mode
end
Maybe this already works, as-is?
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 ofu'*S*u
. The reason is that the metricS
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:
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 ifu
is a left-vector that should be transposed in the biorthogonal case or adjointed in the normal case.