| 1 | initial version |
Symbolic functions, as created via function('V')(phi), accept only symbolic expressions (i.e. elements of the Symbolic Ring) for their arguments. Hence the error message that you get. To derive the equations of motion, I would advise to introduce, in addition to the scalar field phi, a symbolic expression, phi0 say, that will represent the scalar field as the argument of the potential V:
phi0 = var('phi0', latex_name=r'\phi')
V_phi = function('V')(phi0)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.