Ask Your Question
0

Lattice of subspaces of a finite field vector space

asked 2020-08-16 18:22:51 +0100

klaaa gravatar image

updated 2020-08-16 18:29:41 +0100

slelievre gravatar image

Let $V$ be a vector space over a finite field with $q$ elements and dimension $n$.

How one can obtain the lattice $L_{n,q}$ of subspaces of $V$ as a poset in Sage?

edit retag flag offensive close merge delete

Comments

What have you tried?

slelievre gravatar imageslelievre ( 2020-08-16 18:30:23 +0100 )edit

I do not have a good approach to this problem as my expierence with SAGE is very limited. I was hoping there is an existing command to obtain this poset via SAGE since SAGE contains many posets in the catalog, but I was not able to find this.

klaaa gravatar imageklaaa ( 2020-08-16 18:37:22 +0100 )edit
rburing gravatar imagerburing ( 2020-08-16 19:04:31 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-16 20:39:51 +0100

slelievre gravatar image

updated 2020-08-16 20:44:55 +0100

The question is similar to a previous question, as pointed out by @rburing.

Let us however go through a step by step guided exploration of the question.

In passing we will recall ways to explore the documentation.

Choose the size of the finite field, and the dimension of the vector space.

sage: q = 3
sage: d = 3

Create the finite field and the vector space.

sage: F = GF(q)
sage: V = F^d

Check what methods are available for V using V.[TAB] (ie press the tab key).

In particular we find:

sage: V.dimension()
3

sage: V.subspaces(dim=2)
<generator object FreeModule_generic_field.subspaces at 0x1eb45c650>

Check the inline documentation for the Poset and the LatticePoset constructors:

sage: Poset?
sage: LatticePoset?
sage: browse_sage_doc(Poset)
sage: browse_sage_doc(LatticePoset)

Or browse the posets page of the Sage documentation in your browser, using one of:

The documentation reveals one can create a poset from a dictionary of upper covers.

The "defaultdict" variant of a dictionary will be more convenient; import it:

sage: from collections import defaultdict

Now run through subspaces by decreasing dimension, and add each to the list of upper covers of its subspaces of the next dimension down:

sage: upper_covers = defaultdict(list)
sage: for d in range(V.dimension(), 0, -1):
....:     S = V.subspaces(dim=d)
....:     for B in S:
....:         for A in B.subspaces(dim=d-1):
....:             upper_covers[A].append(B)
....:
sage: P = LatticePoset(data=upper_covers)
sage: P
Finite poset containing 28 elements
sage: p = P.plot()
sage: p.show()
Launched png viewer for Graphics object consisting of 107 graphics primitives

Labels in the rendered view are too verbose, so create a poset using the basis matrix of each subspace:

sage: upper_covers = defaultdict(list)
sage: for d in range(V.dimension(), 0, -1):
....:     S = V.subspaces(dim=d)
....:     for B in S:
....:         for A in B.subspaces(dim=d-1):
....:             upper_covers[A.basis_matrix()].append(B.basis_matrix())
....:
sage: P = LatticePoset(data=upper_covers)
sage: P
Finite poset containing 28 elements

Adjust the shape and size of the nodes for plotting the graph:

sage: p = P.plot(element_shape='s', element_size=1500)
sage: p.show(figsize=20)
Launched png viewer for Graphics object consisting of 107 graphics primitives
edit flag offensive delete link more

Comments

Thank you. And sorry, I forgot I asked a similar question before. I forgot about it since I did not work much with those lattices as they get too big quickly for most experiments.

klaaa gravatar imageklaaa ( 2020-08-16 20:48:50 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-08-16 18:22:51 +0100

Seen: 434 times

Last updated: Aug 16 '20