combinat::independentSetsOfVectorSpace – independent sets of a vector space
combinat::independentSetsOfVectorSpace represents the combinatorial class of the independent sets of a finite dimensional vector space over a finite field.
Details:
Let be a finite field, and be a -vector space of finite dimension . An independent set of size is an ordered family of vectors of which are linearly independent. It can be identified with a matrix whose columns are linearly independent. In particular, when , this combinatorial class describes the bases of or equivalently the elements of .
In this library, an independent set is encoded as a matrix in Dom::Matrix(K).
The ground field must provide a method generator for generating its elements. However, such a method does not exist yet by default in MuPAD finite fields. combinat::independentSetsOfVectorSpace modifies automatically the MuPAD domain Dom::IntegerMod in order to insert this method.
count – number of independent sets
combinat::independentSetsOfVectorSpace::count(finite field K, nonnegative integer n, nonnegative integer k)
Returns the number of independent sets of size k in a K-vector space of dimension n.
generator – generator for the independent sets
combinat::independentSetsOfVectorSpace::generator(finite field K, nonnegative integer n, nonnegative integer k)
Returns a generator for the independent sets of size k in a K-vector space of dimension n.
linearSpanGenerator – generator for the linear span of an independent set
combinat::independentSetsOfVectorSpace::linearSpanGenerator(list of vectors S)
combinat::independentSetsOfVectorSpace::linearSpanGenerator(matrix M)
Returns a generator for all the vectors in the linear span of S, starting from zero. The list should be non-empty (otherwise the system cannot guess in which vector space zero belongs to).
Same thing with S being the list of the column vectors of M.
Let be the finite field of size , and be the canonical -vector space of dimension . This space has independent set of size , non-zero vectors, bases, and no independent set of size or more:
Z2 := Dom::IntegerMod(2):
n := 2:
combinat::independentSetsOfVectorSpace::count(Z2, n, k) $ k = 0..3
Here is the first basis of :
g := combinat::independentSetsOfVectorSpace::generator(Z2, n, n):
M := g()
For the sake of readability in the following examples, we define the following pretty-printing function:
printMatrix := M -> output::asciiArt::fromArray(expr(M), Packed):
printMatrix(M)
01
10
Now, here are all the non zero vectors of :
map(combinat::independentSetsOfVectorSpace(Z2, n, 1), printMatrix)
0 1 1
[1, 0, 1]
and all the bases of :
map(combinat::independentSetsOfVectorSpace(Z2, n, 2), printMatrix)
01 01 10 11 10 11
[10, 11, 01, 01, 11, 10]
To conclude, here are all the bases of :
map(combinat::independentSetsOfVectorSpace(Z2, 3, 3), printMatrix)
-- 001 001 001 001 010 010 011 011 010 010 011 011 001 001 001 001 010 010 011 011 010 010 011
| 010, 010, 011, 011, 001, 001, 001, 001, 011, 011, 010, 010, 010, 010, 011, 011, 001, 001, 001, 001, 011, 011, 010,
-- 100 101 100 101 100 101 100 101 100 101 100 101 110 111 111 110 110 111 111 110 110 111 111
011 001 001 001 001 010 010 011 011 010 010 011 011 001 001 001 001 010 010 011 011 010 010
010, 100, 100, 101, 101, 100, 101, 100, 101, 100, 101, 100, 101, 110, 110, 111, 111, 110, 111, 111, 110, 110, 111,
110 010 011 010 011 001 001 001 001 011 011 010 010 010 011 010 011 001 001 001 001 011 011
011 011 001 001 001 001 010 010 011 011 010 010 011 011 001 001 001 001 010 010 011 011 010
111, 110, 100, 100, 101, 101, 100, 101, 100, 101, 100, 101, 100, 101, 110, 110, 111, 111, 110, 111, 111, 110, 110,
010 010 110 111 111 110 101 100 101 100 111 110 110 111 100 101 101 100 111 110 110 111 101
010 011 011 100 100 101 101 100 100 101 101 100 100 101 101 110 110 111 111 110 110 111 111
111, 111, 110, 001, 001, 001, 001, 010, 011, 010, 011, 010, 011, 010, 011, 001, 001, 001, 001, 010, 011, 010, 011,
100 101 100 010 011 010 011 001 001 001 001 011 010 011 010 010 011 010 011 001 001 001 001
110 110 111 111 100 100 101 101 100 100 101 101 100 100 101 101 110 110 111 111 110 110 111
010, 011, 010, 011, 001, 001, 001, 001, 010, 011, 010, 011, 010, 011, 010, 011, 001, 001, 001, 001, 010, 011, 010,
011 010 011 010 110 111 111 110 101 101 100 100 111 110 110 111 100 101 101 100 111 111 110
111 110 110 111 111 100 100 101 101 100 100 101 101 100 100 101 101 110 110 111 111 110 110
011, 010, 011, 010, 011, 101, 101, 100, 100, 110, 111, 111, 110, 110, 111, 111, 110, 111, 111, 110, 110, 100, 101,
110 101 100 100 101 010 011 010 011 001 001 001 001 011 010 011 010 010 011 010 011 001 001
111 111 110 110 111 111 100 100 101 101 100 100 101 101 100 100 101 101 110 110 111 111 110
101, 100, 100, 101, 101, 100, 101, 101, 100, 100, 110, 111, 111, 110, 110, 111, 111, 110, 111, 111, 110, 110, 100,
001 001 011 010 011 010 110 111 111 110 101 101 100 100 111 110 110 111 100 101 101 100 111
110 111 111 110 110 111 111 --
101, 101, 100, 100, 101, 101, 100 |
111 110 110 101 100 100 101 --
Background:
The generation algorithm uses the straight-forward recursion, which has a reasonable complexity.
However, the elements of the combinatorial class can also be considered as cosets in the quotient of two finite groups. Therefore, it would be much nicer to use general group-theoretical algorithms based on strong generating set for generating such cosets (either by implementing it directly in MuPAD or by calling an external system like GAP). This would give fast random generation, ranking, and unranking algorithms, and would allow for generating unordered independent sets as well.
Changes in MuPAD 3.2
New Function.