Feature or bug? using SymPy; Sym(-1)^(1//4)

In Jupyter, I get some sort of broken output:

See https://github.com/JuliaLang/IJulia.jl/issues/409

OK so this is maybe some sort of upstream bug. Thanks.

Hm actually,

This seems to have been fixed upstreams years ago. Older versions of sympy would output \root{a}{b} which was wrong, but more recent versions output \sqrt[a]{b}. Why is the builtin Julia python sympy doing this old thing?

By default, PyCall and SymPy.jl use the Anaconda Python distribution, so they get whatever SymPy version Anaconda ships. There is no “Julia python” per se.

The issue seems to be that SymPy.jl is calling latex(expr, itex=true), and the itex=true keyword causes sympy to use \root. I’m not sure why SymPy.jl uses the itex=true setting.

Hm, even putting itex=false doesn’t fully solve the problem. The wrong brackets come out.

Should I file an issue with SymPy.jl?

Nevermind, this works fully. Maybe indeed file a bug with SymPy.jl?

Yes. There may be some other reason that it is using itex=true, but a SymPy.jl issue would be the place to have that discussion.

1 Like

thanks for linking the issue :slight_smile: