Hi, consider the following snippet
from dolfin import *
import numpy as np
mesh = UnitSquareMesh(3, 3)
V = VectorFunctionSpace(mesh, 'CG', 1)
u = Expression(('x[0]*x[1]', 'x[1]*x[1]'), domain=mesh)
I = Identity(2)
F = I + grad(u)
C = F.T*F
# Convenient inverse
Cinv0 = inv(C)
# Less convenient inverse
Cinv1 = as_tensor([[C[1, 1], -C[0, 1]], [-C[1, 0], C[0, 0]]])/det(C)
# Assemble the tensor fields
T = TensorFunctionSpace(mesh, 'CG', 1)
C0 = project(Cinv0, T)
C1 = project(Cinv1, T)
# Check that the fields are equal
assert np.allclose(C0.vector().array(), C1.vector().array())