Revision history [back]

psi_1 and psi_2 are kind of not completely defined, for example at this stage it is not clear how many symbolic variable do they use, see:

sage: parent(psi_1)
<class 'sage.symbolic.function_factory.function_factory.<locals>.NewSymbolicFunction'>

sage: psi_1(x)
psi_1(x)
sage: var('y')
y
sage: psi_1(x,y)
psi_1(x, y)

sage: parent(psi_1(x))
Symbolic Ring

If you decide that those are function of a single variable, it works:

sage: psi = 1/sqrt(2) * (psi_1(x) + psi_2(x) * i)
sage: psi
1/2*sqrt(2)*(psi_1(x) + I*psi_2(x))

psi_1 and psi_2 are kind of not completely defined, defined (in particular, they are not member of the symbolic ring, hence they can not benefit from the coercions between the symbolic ring and other rings), for example at this stage it is not clear how many symbolic variable do they use, see:

sage: parent(psi_1)
<class 'sage.symbolic.function_factory.function_factory.<locals>.NewSymbolicFunction'>

sage: psi_1(x)
psi_1(x)
sage: var('y')
y
sage: psi_1(x,y)
psi_1(x, y)

sage: parent(psi_1(x))
Symbolic Ring

If you decide that those are function of a single variable, it works:

sage: psi = 1/sqrt(2) * (psi_1(x) + psi_2(x) * i)
sage: psi
1/2*sqrt(2)*(psi_1(x) + I*psi_2(x))