chakravala / chakravala/Grassmann.jl

Log broken in some cases - may not be log but inv?

Open
#112 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
514
Forks
41
PR merge metrics
No merged PRs in 30d

Description

Error occurs in the last line.
Code to reproduce
```
using Grassmann
_basis = basis"1,1,1,1"

beta = pi/4
B1 = beta * v1 * v2
rotor1 = exp(B1/2)

gamma = pi/6
B2 = gamma * v3 * v4
rotor2 = exp(B2/2)

rotor = rotor2 * rotor1
B = log(rotor)
```
Output
```
inv(1.8924 + 0.369644v₁₂ + 0.0v₁₃ + 0.0v₁₄ + 0.0v₂₃ + 0.0v₂₄ + 0.239118v₃₄ + 0.0990458v₁₂₃₄) is undefined

Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] inv(m::Spinor{⟨1,1,1,1⟩, Float64, 8})
@ Grassmann [~/.julia/packages/Grassmann/RyCGA/src/algebra.jl:510](http://localhost:8888/home/pencetn/.julia/packages/Grassmann/RyCGA/src/algebra.jl#line=509)
[3] [/](http://localhost:8888/)
@ [~/.julia/packages/AbstractTensors/rjoE8/src/AbstractTensors.jl:320](http://localhost:8888/home/pencetn/.julia/packages/AbstractTensors/rjoE8/src/AbstractTensors.jl#line=319) [inlined]
[4] log(t::Spinor{⟨1,1,1,1⟩, Float64, 8})
@ Grassmann [~/.julia/packages/Grassmann/RyCGA/src/composite.jl:370](http://localhost:8888/home/pencetn/.julia/packages/Grassmann/RyCGA/src/composite.jl#line=369)
[5] top-level scope
@ In[46]:13
```
Note this doesn't happen if B1 and B2 share a basis vector (for example B2 = gamma * v2 * v3 works just fine)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the reproduction in the issue, then inspect Grassmann's src/algebra.jl around line 510 and src/composite.jl around line 370, along with AbstractTensors.jl around line 320 in the stack trace. Confirm that log(rotor) fails when B1 and B2 use disjoint basis vectors, and that the existing shared-vector case still works; done means the reported reproduction no longer raises the undefined-inverse error.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.