# Revision history [back]

### how to simplify differential form

I try the source code:

r,theta=var('r,theta')

U=CoordinatePatch((r,theta))

F=DifferentialForms(U)

x=DifferentialForm(F,0,r*cos(theta))

y=DifferentialForm(F,0,r*sin(theta))

a=x.diff().wedge(y.diff())

the output is: (rcos(theta)^2 + rsin(theta)^2)*dr/\dtheta

then I want to simplify_trig to the coefficients. Unfortunately a.simplify_trig() not working and all the map_coefficients and map_item are not defined.

Although in such case I can use: a[0,1]=a[0,1].simplify_trig() to do the job, for general case, maybe a 3 form depends on 6 variables, it is very cumbersome to apply simplify_trig to each coefficients.

One ugly method is: for i in a._components: a[i]=a[i].simplify_trig()

However it depends to real implementation not the interface. I want to ask whether there is an elegant way to do the same job, but just rely on the interface of class sage.tensor.differential_form_element.DifferentialForm

 2 None kcrisman 11847 ●35 ●117 ●236

### how to simplify differential form

I try the source code:

r,theta=var('r,theta')

r,theta=var('r,theta')
U=CoordinatePatch((r,theta))
U=CoordinatePatch((r,theta))F=DifferentialForms(U)
x=DifferentialForm(F,0,r*cos(theta))
F=DifferentialForms(U)y=DifferentialForm(F,0,r*sin(theta))
a=x.diff().wedge(y.diff())
x=DifferentialForm(F,0,r*cos(theta)) y=DifferentialForm(F,0,r*sin(theta)) a=x.diff().wedge(y.diff()) the output is: (rcos(theta)^2 (r*cos(theta)^2 + rsin(theta)^2)*dr/\dthetar*sin(theta)^2)*dr/\dtheta


then I want to simplify_trig to the coefficients. Unfortunately a.simplify_trig() not working and all the map_coefficients and map_item are not defined.

Although in such case I can use: a[0,1]=a[0,1].simplify_trig() to do the job, for general case, maybe a 3 form depends on 6 variables, it is very cumbersome to apply simplify_trig to each coefficients.

One ugly method is: for i in a._components: a[i]=a[i].simplify_trig()

However it depends to real implementation not the interface. I want to ask whether there is an elegant way to do the same job, but just rely on the interface of class sage.tensor.differential_form_element.DifferentialForm