Skip to content

Commit

Permalink
[ITensors] Faster QN addition and filling (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
corbett5 authored Jan 25, 2024
1 parent e1939b6 commit 9a037df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/qn/qn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function (a::QN + b::QN)
!isactive(b[1]) && return a

ma = MQNStorage(data(a))
for nb in 1:maxQNs
@inbounds for nb in 1:maxQNs
!isactive(b[nb]) && break
bname = name(b[nb])
for na in 1:maxQNs
Expand Down Expand Up @@ -293,6 +293,7 @@ function fillqns_from(qn1::QN, qn2::QN)
# If qn1 has no non-trivial qns, fill
# with qn2
!isactive(qn1) && return zero(qn2)
!isactive(qn2) && return qn1
for qv2 in qn2
if !hasname(qn1, qv2)
qn1 = addqnval(qn1, zero(qv2))
Expand Down

0 comments on commit 9a037df

Please sign in to comment.