Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid special casing the dot product in CliffordNumbers.mul #5

Closed
brainandforce opened this issue May 16, 2024 · 1 comment
Closed

Comments

@brainandforce
Copy link
Owner

In order to correctly calculate the dot product of two multivectors, there is an if statement to check if the CliffordNumbers.GradeFilter argument is the one used for the dot product. This is used because the dot product requires both masking the multiplications of certain grades and altering the signs associated with each multiplication:

# Special case for dot products
signs = sign.(inds)
if F <: GradeFilter{:dot}
    signs = signs .* Int8(-1).^(grade.(inds) .* (grade(a) .- grade.(inds)))
end

I think we should avoid specifically referencing any CliffordNumbers.GradeFilter instance in CliffordNumbers.mul. Perhaps we'll need an additional function to handle the sign manipulation.

@brainandforce
Copy link
Owner Author

Fixed with 7cb5747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant