Closed 6r4ph closed 2 years ago
It is not recommended to use the @force using Reduce.Algebra
command combined with using Grassmann
.
Instead, you should just do using Reduce, Grassmann
and dispatch Reduce.Algebra
manually.
Thank you for this very fast answer and for this precision !
I added it thinking it may solve some errors, which I also get with using Reduce, Grassmann
only :
julia> using Reduce, Grassmann
julia> @basis ℝ^3
(⟨+++⟩, v, v₁, v₂, v₃, v₁₂, v₁₃, v₂₃, v₁₂₃)
julia> :x * v1 + v12
ERROR: MethodError: no method matching setmulti!(::AbstractTensors.Variables{8,Any}, ::Symbol, ::UInt64, ::Val{3})
Closest candidates are:
setmulti!(::AbstractTensors.Variables{M,T}, ::S, ::Any) where {M, T, S} at C:\Users\maison\.julia\packages\Grassmann\Tvf1n\src\products.jl:166
setmulti!(::Q, ::S, ::UInt64, ::Val{N}) where {M, T, S, N, Q<:AbstractTensors.FixedVector{M,T}} at C:\Users\maison\.julia\packages\Grassmann\Tvf1n\src\products.jl:139
setmulti!(::Q, ::S, ::UInt64, ::Val{N}) where {M, T<:Number, S<:Number, N, Q<:AbstractTensors.Variables{M,T}} at C:\Users\maison\.julia\packages\Grassmann\Tvf1n\src\products.jl:139
...
Stacktrace:
[1] macro expansion at C:\Users\maison\.julia\packages\Grassmann\Tvf1n\src\algebra.jl:538 [inlined]
[2] macro expansion at C:\Users\maison\.julia\packages\Grassmann\Tvf1n\src\products.jl:326 [inlined]
[3] +(::Simplex{⟨+++⟩,1,v₁,Symbol}, ::SubManifold{⟨+++⟩,2,0x0000000000000003}) at C:\Users\maison\.julia\packages\Grassmann\Tvf1n\src\products.jl:326
[4] top-level scope at none:1
julia> (:a * v1 + :b * v2) ∧ (:c * v1 + :d * v2)
ERROR: StackOverflowError:
Stacktrace:
[1] promote_result(::Type{T} where T, ::Type{T} where T, ::Type{Any}, ::Type{Chain{⟨+++⟩,1,Any,3}}) at .\promotion.jl:237
[2] promote_type at .\promotion.jl:223 [inlined]
... (the last 2 lines are repeated 79982 more times)
Thanks for reporting these examples. This situation can probably be improved; however, it is not my immediate concern to improve the situation involving symbolic computation interoperability, although I may attend to this in the future when I feel like addressing it.
@KabalGraph all of the issues described in this issue have now been fixed in v0.8 of Grassmann
, which is available on the latest commit but hasn't been released as of yet.
Hi,
I'm just getting started with Julia in order to experiment with Grassmann.jl (for Lie Sphere Algebra, multi-qubits, etc), which seems like a very interesting library to work with.
Setup : Julia 1.5.3 (fresh install), Reduce v1.2.10, Grassmann v0.7.2, on Windows 8.1 x64, I also installed all packages listed as possible dependencies (AbstractTensors, ComputedFieldTypes, etc). Grassmann v0.7.1 and Reduce v1.2.9 also create these errors.
Reduce and Grassmann seem to be working quite fine on their own. However I necessarily have to use
@force using Reduce.Algebra
and when using bothusing Reduce; @force using Reduce.Algebra; using Grassmann
doesn't allow the same operations asusing Reduce; @force using Reduce.Algebra; using Grassmann
(see below). Grassmann generates bases of all kinds with no troubles and correctly performs operations on multivectors using operators (∧, ⋅, ^2, etc). However when using both (eg. defining r = :x v1 + :y v12, say) I run into a lot of errors, which are listed below. Some operations do work, and return the correct results, other produce weird results or errors, please see below for examples of outputs in various cases. The problems seem mostly related to expressions returning mixed-grades multivectors. (:x + v1 + :y v2 works fine, 1 + :x v12 doesn't). I'm also having trouble when using SymEngine instead of Reduce, which is why I'm posting it in this rep, although it seems quite related to Reduce.jl issue #38.Any ideas where this might be coming from ?
Thanks and best regards, Julien
Changing the order of
using
and@force using
produces a different behavior of/
and⋅
Same kind of errors using SymEngine instead