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

method ambiguity for exponentiation of Complex{Num} #556

Closed
simeonschaub opened this issue Oct 8, 2023 · 2 comments
Closed

method ambiguity for exponentiation of Complex{Num} #556

simeonschaub opened this issue Oct 8, 2023 · 2 comments

Comments

@simeonschaub
Copy link

MWE:

julia> Complex{Symbolics.Num}(Symbolics.Sym{Real}(:x), 0)^Symbolics.Num(2)
ERROR: MethodError: ^(::Complex{Num}, ::Num) is ambiguous.

Candidates:
  ^(z::Complex{T}, p::S) where {T<:Real, S<:Real}
    @ Base complex.jl:876
  ^(z::Complex{T}, p::T) where T<:Real
    @ Base complex.jl:863
  ^(a::Number, b::Num)
    @ Symbolics ~/.julia/packages/SymbolicUtils/ssQsQ/src/methods.jl:76

Possible fix, define
  ^(::Complex{T}, ::Num) where T<:Real

Stacktrace:
 [1] top-level scope
   @ REPL[63]:1
@Azercoco
Copy link

I am having the same issue ... Did you find a solution ?

@karlwessel
Copy link
Contributor

Seems to be fixed. Here is the output with Symbolics v6.12.0:

julia> using Symbolics

julia> Complex{Symbolics.Num}(Symbolics.Sym{Real}(:x), 0)^Symbolics.Num(2)
(x)^2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants