#EvaluateForm and Isotropic subspaces test. quadratic forms (2);
q := 5;
f := GF(q);
dim := 5;
v := f^dim;
mat := IdentityMat(dim,f);
form := QuadraticFormByMatrix(mat,f);
lines := Subspaces(v,1);
matrices := List(lines,x->BasisVectors(Basis(x)));;
vectors := List(matrices,x->x[1]);;
results := Collected(List(vectors,x->EvaluateForm(form,x)));;
[Zero(f),(q^(dim-1)-1)/(q-1)] in results;
results := Collected(List(matrices,x->x^form));;
[[[Zero(f)]],(q^(dim-1)-1)/(q-1)] in results;
Length(Filtered(vectors,x->IsSingularVector(form,x)))=(q^(dim-1)-1)/(q-1);
Length(Filtered(matrices,x->IsTotallySingularSubspace(form,x)))=(q^(dim-1)-1)/(q-1);
planes := Subspaces(v,2);
matrices := List(planes,x->BasisVectors(Basis(x)));;
results := Collected(List(matrices,x->x^form));;
z := Zero(f);
[[[z,z],[z,z]],(q^(dim-1)-1)/(q-1)] in results;
Length(Filtered(matrices,x->IsTotallySingularSubspace(form,x)))=(q^(dim-1)-1)/(q-1);
quit;
