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

Inverse of vectors with negative square #25

Closed
karlwessel opened this issue Jun 16, 2019 · 3 comments
Closed

Inverse of vectors with negative square #25

karlwessel opened this issue Jun 16, 2019 · 3 comments
Labels

Comments

@karlwessel
Copy link

The inverse of a vector a works like expected for vectors with positive square a² > 0 in the way that baa⁻¹ = b:

julia> using Grassmann

julia> basis"-+++"
(⟨-+++⟩, v, v₁, v₂, v₃, v₄, v₁₂, v₁₃, v₁₄, v₂₃, v₂₄, v₃₄, v₁₂₃, v₁₂₄, v₁₃₄, v₂₃₄, v₁₂₃₄)

julia> v2^2
v

julia> v1*v2*inv(v2), v1
(v₁, v₁)

It however does not give the correct result, I think, for vectors with negative square a² < 0:

julia> v1^2
-1v

julia> v2*v1*inv(v1), v2
(-1v₂, v₂)
@chakravala
Copy link
Owner

chakravala commented Jun 16, 2019

The inverse should be negative, according to the formula I am using

julia> (~v1)/((~v1)v1)
-1.0v₁

However, the formula for Basis elements is a more simple variant and doesn't take the whole formula into account yet. That can be fixed easily by just using the formula above.

@karlwessel
Copy link
Author

It is fixed now, but I think the same problem also exists for SValue (and MValue?):

julia> a = 2v1
2v₁

julia> typeof(a)
SValue{⟨-+⟩,1,v₁,Int64}

julia> v2*a*inv(a), v2
(-1.0v₂, v₂)

@karlwessel
Copy link
Author

Now the error is gone, but it is still not the expected result:

julia> using Test

julia> @test v2*(a*inv(a)) == v2
Test Failed at REPL[14]:1
  Expression: v2 * (a * inv(a)) == v2
   Evaluated: 2.0v₂ == v₂
ERROR: There was an error during testing

chakravala added a commit that referenced this issue Jun 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants