Skip to content

Commit

Permalink
fixed bug i think
Browse files Browse the repository at this point in the history
  • Loading branch information
nmayhall-vt committed Mar 4, 2024
1 parent 2b92534 commit f88166a
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/type_TPSCIstate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f88166a

Please sign in to comment.