Here is a snippet of code that should do:
sage: Q = RootSystem('E8').weight_lattice()
sage: B = Q.basis()
sage: the_set = set()
sage: finished = False
sage: i = 1
sage: value = 4
sage: while not finished:
....: smaller_or_eq_values = False
....: int_vectors = IntegerVectors(n=i,k=8)
....: for vect in int_vectors:
....: weight = sum(vect[j]*B[j+1] for j in range(8)) # Create the weight
....: wns = weight.norm_squared()
....: if wns <= value:
....: smaller_or_eq_values = True
....: if wns == value:
....: print(weight)
....: the_set.add(weight)
....: if not smaller_or_eq_values:
....: finished = True
....: i += 1
You will get a set the_set
which above contains all the (positive) weights that have the norm squared to be equal to value=4
.
The norm squared seem to deliver the same as the symmetric form:
sage: B[1]+B[2]
Lambda[1] + Lambda[2]
sage: a_weight = B[1]+B[2]
sage: a_weight.symmetric_form(a_weight)
22
sage: a_weight.norm_squared()
22
Could you explain what is meant by "canonical bilinear form", the one coming from the geometric representation?
This will affect how to give you a better answer.
The one coming from the Killing for on the Cartan algebra.