From 522f784babfeb6c10be81edd10379f8a8ac1be3f Mon Sep 17 00:00:00 2001 From: Brandon Flores Date: Tue, 27 Feb 2024 02:41:06 -0600 Subject: [PATCH] Added docstring for multiplication of `BitIndex` objects --- src/bitindex.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bitindex.jl b/src/bitindex.jl index f06a032..304d296 100644 --- a/src/bitindex.jl +++ b/src/bitindex.jl @@ -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