You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Julia v1.5.3 with SymPy v1.0.35 is not able to infer adjoint(::Sym) correctly as ::Sym. As a result, the return type of multiplying adjoint matrices of Sym by matrices of Sym are matrices with eltype Any. I recognized this issue since Matrix{Any} is really printed worse than Matrix{Sym} in Jupyter. Example:
julia>using SymPy
julia> A =ones(Sym, 1, 1)
1×1 Array{Sym,2}:1
julia> A * A # is inferred correctly1×1 Array{Sym,2}:1
julia> A * A'# is inferred with eltype Any1×1 Array{Any,2}:1
julia> A'* A # is inferred with eltype Any1×1 Array{Any,2}:1
julia>adjoint(one(Sym)) |> typeof
Sym
julia>@code_warntypeadjoint(one(Sym))
Variables
#self#::Core.Compiler.Const(adjoint, false)
ex::Sym
args::Tuple{}
Body::Any1 ─ %1= Core.NamedTuple()::Core.Compiler.Const(NamedTuple(), false)
│ %2= Base.pairs(%1)::Core.Compiler.Const(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}(), false)
│ %3= Core.tuple(%2, #self#, ex)::Core.Compiler.PartialStruct(Tuple{Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}},typeof(adjoint),Sym}, Any[Core.Compiler.Const(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}(), false), Core.Compiler.Const(adjoint, false), Sym])
│ %4= Core._apply_iterate(Base.iterate, SymPy.:(var"#adjoint#151"), %3, args)::Any
└── return%4
Could an additional definition with type hint for the method adjoint(::Sym)::Sym help here?
The text was updated successfully, but these errors were encountered:
Currently, Julia
v1.5.3
with SymPyv1.0.35
is not able to inferadjoint(::Sym)
correctly as::Sym
. As a result, the return type of multiplying adjoint matrices ofSym
by matrices ofSym
are matrices with eltypeAny
. I recognized this issue sinceMatrix{Any}
is really printed worse thanMatrix{Sym}
in Jupyter. Example:Could an additional definition with type hint for the method
adjoint(::Sym)::Sym
help here?The text was updated successfully, but these errors were encountered: