Closed davibarreira closed 1 year ago
That's not really a bug. I am using the most commonly used definition of a norm in Clifford algebras, and for this definition there is no real norm for all vectors if the underlying quadratic form of the algebra has negative eigenvalues. You could modify the definition by adding an abs()
in norm_sqr()
, which would still give you a proper norm, but you'd make the norm less useful in a number of situations.
If you really want an imaginary result, then you can use the commit I've just made which enables a special case treatment for algebras with negative eigenvalues. In this case norm()
will return a complex number instead of a real one. But it will always do that, even if the actual result is real.
I hope this solves your problem.
Perfect! Thanks a lot for all the answers!
The
norm
function is giving an error becausenorm_sqr
is returning a negative value. Here is the case: