# newField(String) -- constructor of a vector field

## Synopsis

• Function: newField
• Usage:
newField(expression)
• Inputs:
• expression, , the expression to be evaluated
• Outputs:
• an instance of the type DiffAlgField, the vector field written in expression

## Description

This function defines the particular vector field written in the given expression as elements of type DiffAlgField. If any parameters are founded in the given expression, they are automatically included in the ring of scalar coefficients.

In the following example we define two particular vector fields, X and Y, and compute the addition X+Y. Notice that in the definition of X we are introducing a scalar parameter named a, also the variable x_2 is missing from the ring of X. When computing X+Y, the rings of both vector fields are automatically merged.

 i1 : X = newField("2*a*x_0*ax_1") o1 = 2a*x ax 0 1 o1 : DiffAlgField i2 : ring X QQ[i] o2 = ------[][a][x ..x ][ax ..ax ] 2 0 1 0 1 i + 1 o2 : PolynomialRing i3 : Y = newField("x_0*ax_2") o3 = x ax 0 2 o3 : DiffAlgField i4 : ring Y QQ[i] o4 = ------[][x ..x ][ax ..ax ] 2 0 2 0 2 i + 1 o4 : PolynomialRing i5 : X+Y o5 = 2a*x ax + x ax 0 1 0 2 o5 : DiffAlgField i6 : ring (X+Y) QQ[i] o6 = ------[][a][x ..x ][ax ..ax ] 2 0 2 0 2 i + 1 o6 : PolynomialRing

In this example we show that the variables will always start from the index 0 and go up to the highest index encountered in the expression defining the vector field.

 i7 : Z = newField("ax_5") o7 = ax 5 o7 : DiffAlgField i8 : ring Z QQ[i] o8 = ------[][x ..x ][ax ..ax ] 2 0 5 0 5 i + 1 o8 : PolynomialRing

## Caveat

By default, the affine coordinates will be x_0,...,x_n and the partial derivatives are denoted as ax_0,...ax_n, respectively. The coefficient i is the imaginary unit.