Basic Query regarding function spaces

How we can write function space for tensor valued function ?
how we can write exact solution if it is a vector ?

func f = [-2pi^3cos(piy)sin(piy)(2cos(2pix) - 1), 2pi^3sin(pix)cos(pix)(2cos(2piy) - 1)];
This is correct?

How we can calculate error in L2 norm if u is a vector ?

please explain with an example

Let Th a mesh, so

     fespace Wh(Th,[P1,P1]);// is vectoriel Finite Space with 2 componante 

   Wh [u1,u2]=[x,sin(y)]; //. Interpole of function x,y -> [x,sin(y)] 
  // v1, v2 overdose fo-unctuion 
    réal errl2 = sqrt(int2d(Th)( (u1-v1)^2 + (u2-v2)^2));

Thankyou for your reply
Can you tell how we define function space for tensor valued function?

Sorry only vector valued, so to do tensor you have to use vector