Skip to content

Commit

Permalink
Slightly modified definition of CliffordNumbers.signbit_of_square
Browse files Browse the repository at this point in the history
  • Loading branch information
brainandforce committed Jun 4, 2024
1 parent 348eb5e commit 500474a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/bitindex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,11 @@ end
CliffordNumbers.signbit_of_square(b::BitIndex) -> Bool
Returns the signbit associated with squaring the basis blade indexed by `b`.
For basis blades squaring to zero, the result is not meaningful.
"""
function signbit_of_square(b::BitIndex{Q}) where Q
return xor(!iszero(grade(b) & 2), isodd(count_ones(UInt(b) & ~positive_square_bits(Q))))
return xor(!iszero(grade(b) & 2), isodd(count_ones(UInt(b) & negative_square_bits(Q))))
end

"""
Expand Down

0 comments on commit 500474a

Please sign in to comment.