Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

Hi

When I type

in: KroneckerDelta;

the delta symbols is printed, but when I type

in: \delta{#}::KroneckerDelta;

out: TokenError: ('EOF in multi-line statement', (2, 0))

At: /home/irvin/miniconda3/lib/python3.7/tokenize.py(579): _tokenize

Jupyter-notebook-screenshot

When I run same line in cadabra interface have no problem. I do not have any other problem using cadabra on the notebook and don't have a clue on how to solve it.

Thanks

in Bug reports by (180 points)

1 Answer

+2 votes

Are you sure you are using a Cadabra kernel, not a standard Python kernel? What does

print(__cdbkernel__.version)

show when you evaluate it in a cell?

by (82.6k points)

Thanks. Yes I am using a Cadabra kernel

in: print(cdbkernel.version)

out: 2.3.0

Cadabra Kernel output

I opened a new Cadabra Kernel and was able to define kronecker delta. In the previous notebook I was using also sympy and might have done something that prevented from defining the kronecker delta.

Indeed, if you do

from sympy import *

then

\delta{#}::KroneckerDelta;

fails. I haven't chased this down yet. In general, you are running all sorts of risks by doing a blanket import like that first line above (not just with sympy), as it can overwrite any symbols/functions that are already present. It's better to do

import sympy as sp

or something like that (and in fact Cadabra already does import sympy for you).

Makes sense. Many thanks

...