From 9462cd43bf3d0af859a9b0f72e2306d0ecb76533 Mon Sep 17 00:00:00 2001 From: Nuwan Yapa Date: Mon, 6 Jan 2025 15:42:01 -0500 Subject: [PATCH] Absolute singular values --- helper.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helper.jl b/helper.jl index 8dd46a9..0264200 100644 --- a/helper.jl +++ b/helper.jl @@ -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