Skip to content

Commit

Permalink
Added docstring for multiplication of BitIndex objects
Browse files Browse the repository at this point in the history
  • Loading branch information
brainandforce committed Feb 27, 2024
1 parent cbbe2da commit 522f784
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/bitindex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,13 @@ sign_of_mult(a::GenericBitIndex, b::GenericBitIndex) = Int8(-1)^signbit_of_mult(
sign_of_mult(i) = sign_of_mult(i,i)

#---Multiplication and duals-----------------------------------------------------------------------#
"""
*(a::BitIndex{Q}, b::BitIndex{Q}) -> BitIndex{Q}
function Base.:*(a::BitIndex{Q}, b::BitIndex{Q}) where Q
return BitIndex{Q}(signbit_of_mult(a,b), xor(a.blade, b.blade))
end
Returns the `BitIndex` corresponding to the basis blade resulting from the geometric product of the
basis blades indexed by `a` and `b`.
"""
Base.:*(a::T, b::T) where T<:BitIndex = T(signbit_of_mult(a,b), xor(a.blade, b.blade))

"""
CliffordNumbers.has_wedge(a::BitIndex{Q}, b::BitIndex{Q}) -> Bool
Expand Down

0 comments on commit 522f784

Please sign in to comment.