Ask Your Question

Revision history [back]

Well, in Python, when you write

g[0] = x^2

this means that the element 0 in the list g, which was initialized to g_0, is replaced x^2. The symbolic variable g_0 remains unchanged; simply it is no longer the element 0 of g:

sage: g = list(var('g_%d' % i) for i in range(4))
sage: g
[g_0, g_1, g_2, g_3]
sage: g[0] = x^2
sage: g
[x^2, g_1, g_2, g_3]
sage: g_0
g_0

In particular, g_0 is still there in d_00. If you want to replace it by x^2, you have to run d[0][0] [eU, 2, 0] = g[0] again:

sage: d[0][0] [eU, 2, 0] = g[0]
sage: d[0][0].display(eU)
d_00 = -x^2 dx/\dX

Well, in Python, when you write

g[0] = x^2

this means that the element 0 in the list g, which was initialized to g_0, is replaced by x^2. The symbolic variable g_0 remains unchanged; simply it is no longer the element 0 of g:

sage: g = list(var('g_%d' % i) for i in range(4))
sage: g
[g_0, g_1, g_2, g_3]
sage: g[0] = x^2
sage: g
[x^2, g_1, g_2, g_3]
sage: g_0
g_0

In particular, g_0 is still there in d_00. If you want to replace it by x^2, you have to run d[0][0] [eU, 2, 0] = g[0] again:

sage: d[0][0] [eU, 2, 0] = g[0]
sage: d[0][0].display(eU)
d_00 = -x^2 dx/\dX