Open Sollovin opened 4 months ago
Hi Sollovin, my apologies for the late reply.
I checked out the issue, and it seems like the root is an ambiguity related to VectorInterface. This package defines a "hard zero" Zero
and "hard one" One
, and these method definitions are ambiguous with the ones defined in Symbolics for Num
. I am not entirely sure where to add the fix, and maybe some package extension for VectorIterface-Symbolics is necessary at some point, but you should be able to at least locally resolve the issue by just defining the following methods:
# point ambigous methods to the ones defined in VectorInterface
using Symbolics: Num
using TensorOperations: One, Zero # alternatively: using VectorInterface: One, Zero
Base.:*(x::Num, y::One) = invoke(Base.:*, Tuple{Number, One}, x, y)
Base.:*(x::One, y::Num) = invoke(Base.:*, Tuple{One, Number}, x, y)
Base.:*(x::Num, y::Zero) = invoke(Base.:*, Tuple{Number, Zero}, x, y)
Base.:*(x::Zero, y::Num) = invoke(Base.:*, Tuple{Zero, Number}, x, y)
After which your example runs on my machine. Feel free to let me know if you encounter any more issues :)
Hi lkdvos, thanks a lot for your reply.
It now works well with the above definition.
Thanks again and hoping you making progress in fixing it properly.
Hi, I got a problem when I'm trying to use Symbolics.jl and TensorOperations.jl together.
tensortrace
not working on Arrays of Symbolic Expressions from Symbolics.jl.Minimal code reproduces the error:
which gives out