function T = template_form(a)
% crudely assumes a length 6 or 3 vector for 
% a symmetric 5x5 or 3x3 template

sz = length(a);

if (sz == 6)
C = [ 6 5 4 5 6
      5 3 2 3 5
      4 2 1 2 4
      5 3 2 3 5
      6 5 4 5 6 ];

T = reshape(a(C),5,5);

elseif (sz == 3)

C = [ 3 2 3
      2 1 2
      3 2 3 ];

T = reshape(a(C),3,3);

else

T = []

end;
