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

Pseudoinverse for multivectors #366

Open
tBuLi opened this issue Oct 8, 2020 · 5 comments
Open

Pseudoinverse for multivectors #366

tBuLi opened this issue Oct 8, 2020 · 5 comments

Comments

@tBuLi
Copy link

tBuLi commented Oct 8, 2020

Would it be possible to add an option to use the matrix pseudoinverse instead of the normal matrix inverse into the method for computing inverses for multivectors? Having read the relevant chapter in Christian Perwass' book, he also mentions there that a pseudoinverse should work. I think it would be very nice to add an option to e.g. the .inv() method that allows something like

M.inv(pseudo=True)

given that in some situations this is still meaningful to do.

@eric-wieser
Copy link
Member

I assume this is for degenerate basis vectors, when sometimes there is no inverse?

@tBuLi
Copy link
Author

tBuLi commented Oct 8, 2020

Yes that's one case, and another one I've found is when performing bivector splits: when the two bivectors in the split B = B_1 + B_2 start to become to similar. As they become more and more identical the real inverse gives a LinAlgError at some point, but the pseudoinverse returns B_1 = B_2 = B / 2. This is much friendlier ;).

*I should say that this is what I hope and strongly suspect it will return, because I replaced the inverse with a pseudoinverse in the algorithm as it was stated in geometric calculus and got this much nicer result.

@eric-wieser
Copy link
Member

eric-wieser commented Oct 8, 2020

If you update to the development version of clifford, you should find that the linear algebra method is not used at all (edit: in small algebras).

@hugohadfield
Copy link
Member

I think we still use it for algebras greater than dimension 6?

@tBuLi
Copy link
Author

tBuLi commented Oct 9, 2020

I've taken the liberty of making a PR for this with a slightly different API then suggested above: I added a .pinv() method to really make it easy to distinguish. Let me know if you like it or want to see some changes!

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

No branches or pull requests

3 participants