Skip to content

Commit

Permalink
Merge pull request #431 from emstoudenmire/issue_430_z3qn
Browse files Browse the repository at this point in the history
Fix missing return statement in QNVal constructor
  • Loading branch information
emstoudenmire authored Jun 17, 2020
2 parents 9b75c27 + 8aa749b commit bcecd90
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/qn/qn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct QNVal
function QNVal(name,v::Int,m::Int=1)
am = abs(m)
if am > 1
new(SmallString(name),mod(v,am),m)
return new(SmallString(name),mod(v,am),m)
end
new(SmallString(name),v,m)
end
Expand All @@ -25,9 +25,9 @@ isfermionic(qv::QNVal) = modulus(qv) < 0
Base.:<(qv1::QNVal,qv2::QNVal) = (name(qv1) < name(qv2))

function qn_mod(val::Int,modulus::Int)
modulus = abs(modulus)
(modulus == 0 || modulus == 1) && return val
return mod(val,modulus)
amod = abs(modulus)
amod <= 1 && return val
return mod(val,amod)
end

function Base.:-(qv::QNVal)
Expand Down

0 comments on commit bcecd90

Please sign in to comment.