Absolute singular values
This commit is contained in:
parent
4815366e36
commit
9462cd43bf
|
|
@ -71,12 +71,12 @@ function gram_schmidt(vecs, ws, precision=1e-10, verbose=false)
|
|||
end
|
||||
|
||||
"Rank of a basis set (pre-normalized) under c-product"
|
||||
c_rank(vecs, ws, threshold=1e-8) = count(abs.(c_singular_values(vecs, ws)) .> threshold)
|
||||
c_rank(vecs, ws, threshold=1e-8) = count(c_singular_values(vecs, ws) .> threshold)
|
||||
|
||||
"Singular values of a basis set (pre-normalized) under c-product"
|
||||
"Singular values (magnitudes) of a basis set (pre-normalized) under c-product"
|
||||
function c_singular_values(vecs, ws)
|
||||
basis = hcat(vecs...)
|
||||
N = transpose(basis) * spdiagm(ws) * basis
|
||||
singular_values = eigvals(N) .|> complex .|> sqrt
|
||||
singular_values = eigvals(N) .|> abs .|> sqrt
|
||||
return singular_values
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue