From f88166ab3e8a2b11c47a0657bff59b379c7189d0 Mon Sep 17 00:00:00 2001 From: Nick Mayhall Date: Mon, 4 Mar 2024 18:40:41 -0500 Subject: [PATCH] fixed bug i think --- src/type_TPSCIstate.jl | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/type_TPSCIstate.jl b/src/type_TPSCIstate.jl index 159237b..b76b342 100644 --- a/src/type_TPSCIstate.jl +++ b/src/type_TPSCIstate.jl @@ -697,21 +697,25 @@ function ct_analysis(s::TPSCIstate; ne_cluster=10, thresh=1e-5, nroots=1) ct = 0 for (fock,configs) in s.data prob = 0 + is_ct = false + for cluster in 1:length(s.clusters) if sum(fock[cluster]) != ne_cluster - prob = 0 - for (config, coeff) in configs - prob += coeff[root]*coeff[root] - end - if prob > thresh - @printf(" %-20.5f%-20i", prob,length(s.data[fock])) - for sector in fock - @printf("(%2i,%-2i)", sector[1],sector[2]) - end - println() + is_ct = true + end + end + + if is_ct + for (config, coeff) in configs + prob += coeff[root]*coeff[root] + end + if prob > thresh + @printf(" %-20.5f%-20i", prob,length(s.data[fock])) + for sector in fock + @printf("(%2i,%-2i)", sector[1],sector[2]) end + println() end - break end ct += prob end