# Revision history [back]

Unless you have a very specific reason to have each of your sets designated by a unique global symbol, the same effect can be achieved by storing your sets in a list. E. g. :

sage: K=[GF(u) for u in (2..100) if u.is_prime()]


K is now a list of all finite fields of size less than or equal to 100 (and set(K) is the set of such fields). The filtering can be done on the set itself rather u. For example, the same list can be obtained by :

[v for v in [Integers(u) for u in (2..100)] if v.is_field()]


As pointed out, you can work on such sets by using K[j] to denote them. Here $j$ would denote the $j$th finite field, not the finite field of size $j$, which may not exist (e. g. one would have K[5] being $\mathbf{F}_{13}$).

You may also store them in a dictionary whose keys are their sizes :

sage: D={u:GF(u) for u in (2..100) if u.is_prime()}


D's elements are accessed by their size, not by their rank in the list :

sage: D.keys()
dict_keys([2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97])
sage: D[13]
Finite Field of size 13


If you still need a unique, distinct symbol to denote each of them, lookup sage.misc.misc.inject_variable?. But I fail to see the point...