Skip to content

safe_unwrap does not work on Complex{Num} #20

@aplund

Description

@aplund

The safe_unwrap function leaves complex defined variables wraped. This can lead to breakages if the terms are assumed to be unwraped. (e.g. the use of operation in the chain_flatten_array_variables function). Below is a simple test.

using Symbolics
using PDEBase

@variables r c::Complex

println(typeof(r))
println(typeof(PDEBase.safe_unwrap(r)))
println()
println(typeof(c))
println(typeof(PDEBase.safe_unwrap(c)))

The output I get is

Num
SymbolicUtils.BasicSymbolic{Real}

Complex{Num}
Complex{Num}

The unwrap function in Symbolics returns a ComplexTerm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions