Convex.jl - LoadError: UndefVarError: AbstractExpr not defined

I am using Julia 1.5.3 but running some old code based on Julia 0.6.4 and ran into the following problem: LoadError: LoadError: UndefVarError: AbstractExpr not defined. The problem seems to be AbstractExpr no longer being recognized in Convex.jl. The code snippet is included below

using Pkg
Pkg.add(“SCS”)
Pkg.add(“Convex”)

function partialtranspose(ρ::Union{AbstractArray, AbstractExpr}, systems::Vector, dim::Vector)

Any help or suggestions is greatly appreciated.

If you download Julia 0.7 and run the code there it should give you deprecation warnings telling you what you need to modify.

Many thanks, the code runs in Julia 0.7. This gives me the base to migrate to 1.5.3.

It’s just not exported anymore, but you should be able to do

using Convex: AbstractExpr

to bring it into your namespace. By the way, Convex.jl now has a partial transpose function, so you may not need to define it yourself.

2 Likes