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

Finish implementing dyadic tensor evaluation #50

Closed
eschnett opened this issue Apr 22, 2020 · 3 comments
Closed

Finish implementing dyadic tensor evaluation #50

eschnett opened this issue Apr 22, 2020 · 3 comments

Comments

@eschnett
Copy link
Contributor

I am experimenting with mixedbasis to represent non-trivial metric tensors. (Is there a better way to represent them?) I receive these errors:

julia> using Grassmann
julia> S = S"-+++"
julia> @mixedbasis S

julia> v1w1(v1)
ERROR: MethodError: no method matching evaluate2(::SubManifold{v₁₂₃₄w¹²³⁴,2,0x0000000000000011}, ::SubManifold{⟨-++++---⟩*,1,0x0000000000000001})
Closest candidates are:
  evaluate2(::A, ::B) where {V, A<:TensorTerm{V,1}, B<:TensorTerm{V,1}} at /Users/eschnett/.julia/packages/DirectSum/Ng7R9/src/operations.jl:229
Stacktrace:
 [1] (::SubManifold{v₁₂₃₄w¹²³⁴,2,0x0000000000000011})(::SubManifold{⟨-++++---⟩*,1,0x0000000000000001}) at /Users/eschnett/.julia/packages/DirectSum/Ng7R9/src/operations.jl:249
 [2] interform at /Users/eschnett/.julia/packages/AbstractTensors/zchWS/src/AbstractTensors.jl:124 [inlined]
 [3] (::SubManifold{⟨-++++---⟩*,2,0x0000000000000011})(::SubManifold{⟨-+++⟩,1,0x0000000000000001}) at /Users/eschnett/.julia/packages/DirectSum/Ng7R9/src/operations.jl:255
 [4] top-level scope at REPL[10]:1
 [5] eval(::Module, ::Any) at ./boot.jl:331
 [6] eval_user_input(::Any, ::REPL.REPLBackend) at /Users/eschnett/src/julia-1.4/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [7] run_backend(::REPL.REPLBackend) at /Users/eschnett/.julia/packages/Revise/C272c/src/Revise.jl:1075
 [8] top-level scope at none:0

It seems that operations are not defined on pure basis vectors, only on linear combinations of them. However:

julia> (-v1w1+v2w2)(v1)
ERROR: InexactError: Bool(-1)
Stacktrace:
 [1] Bool at ./float.jl:73 [inlined]
 [2] convert at ./number.jl:7 [inlined]
 [3] convert at ./essentials.jl:310 [inlined] (repeats 2 times)
 [4] setindex! at ./array.jl:826 [inlined]
 [5] dualform(::SubManifold{⟨-++++---⟩*,8,0x00000000000000ff}) at /Users/eschnett/.julia/dev/Grassmann/src/forms.jl:142
 [6] (::Chain{⟨-++++---⟩*,2,Int64,28})(::SubManifold{⟨-++++---⟩*,1,0x0000000000000001}) at /Users/eschnett/.julia/dev/Grassmann/src/forms.jl:187
 [7] interform at /Users/eschnett/.julia/packages/AbstractTensors/zchWS/src/AbstractTensors.jl:124 [inlined]
 [8] (::Chain{⟨-++++---⟩*,2,Int64,28})(::SubManifold{⟨-+++⟩,1,0x0000000000000001}) at /Users/eschnett/.julia/dev/Grassmann/src/forms.jl:176
 [9] top-level scope at REPL[11]:1
 [10] eval(::Module, ::Any) at ./boot.jl:331
 [11] eval_user_input(::Any, ::REPL.REPLBackend) at /Users/eschnett/src/julia-1.4/usr/share/julia/stdlib/v1.4/REPL/src/REPL.jl:86
 [12] run_backend(::REPL.REPLBackend) at /Users/eschnett/.julia/packages/Revise/C272c/src/Revise.jl:1075
 [13] top-level scope at none:0

The latter seems to happen in line 142 of forms.jl:

            @inbounds mV[Q] = (intlog(Y)+1,V[intlog(x)+1])

Should the second tuple element have an != 0 added to handle negative signatures?

@eschnett
Copy link
Contributor Author

Another issue (with a positive metric signature):

julia> using Grassmann
julia> @mixedbasis 2
julia> (1v1w1+0v2w2)(v12)
ERROR: StackOverflowError:
Stacktrace:
 [1] interform(::Chain{⟨++--⟩*,2,Int64,6}, ::SubManifold{⟨++--⟩*,2,0x0000000000000003}) at /Users/eschnett/.julia/packages/AbstractTensors/zchWS/src/AbstractTensors.jl:116
 [2] (::Chain{⟨++--⟩*,2,Int64,6})(::SubManifold{⟨++--⟩*,2,0x0000000000000003}) at /Users/eschnett/.julia/packages/Grassmann/9da5V/src/forms.jl:176
 ... (the last 2 lines are repeated 39990 more times)
 [79983] interform(::Chain{⟨++--⟩*,2,Int64,6}, ::SubManifold{⟨++--⟩*,2,0x0000000000000003}) at /Users/eschnett/.julia/packages/AbstractTensors/zchWS/src/AbstractTensors.jl:116

@chakravala
Copy link
Owner

The tensor evaluation feature is not currently fully implemented, since it's not completely essential to do math with geometric algebra.

It is planned to eventually fully implement this, but it's not a high priority at the moment and requires a lot of detail work to get right for every type of basis (there are a lot of different nuances).

I can't give an exact timeline at the moment for when I'll finish implementing it, since I have a lot of other ideas I want to work on as well. There's a lot of stuff that can still be improved and added.

@chakravala chakravala added this to To do in Differential Geometric Algebra via automation Apr 22, 2020
@chakravala chakravala changed the title Errors with mixedbasis operations Finish implementing dyadic tensor evaluation Apr 22, 2020
@chakravala
Copy link
Owner

I think the error you got is due to the fact that I previously used a Bool there, but then I generalized it so it can take on values other than 1 and -1, which is why it expects currently a Bool. In other words, this feature has not been updated to the new format where no longer only use a Bool.

@chakravala chakravala added the bug label Apr 22, 2020
chakravala added a commit that referenced this issue Sep 17, 2020
Differential Geometric Algebra automation moved this from To do to Done Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants