1 | initial version |
Here is a first attempt to answer your questions.
1) The comment should be addressed in order to give an instructive answer.
2) Assuming you want to consider only _linear_ subspace, the following code does the thing:
sage: dim = 2
sage: FF = FiniteField(3)
sage: VS = VectorSpace(FF,2)
sage: SS = {}
sage: SS[0] = set([VS.subspace([])])
sage: for dim in range(1,dim+1):
....: new_subspaces = set()
....: for v in VS:
....: for ss in SS[dim-1]:
....: new_ss = ss + VS.subspace([v])
....: if new_ss.dimension() == dim:
....: new_subspaces.add(new_ss)
....: SS[dim] = new_subspaces
....:
sage: ground_set = reduce(lambda x,y:x.union(y),SS.values())
sage: the_lattice = LatticePoset((ground_set,lambda x,y: x.is_subspace(y)))
3) See https://ask.sagemath.org/question/38938/finding-certain-posets-in-sage/ and https://ask.sagemath.org/question/38936/obtaining-lattices-quickly-in-sage/
2 | No.2 Revision |
Here is a first attempt to answer your questions.
1) The comment should be addressed in order to give an instructive answer.
2) Assuming you want to consider only _linear_ subspace, the following code does the thing:
sage: dim = 2
sage: FF = FiniteField(3)
sage: VS = VectorSpace(FF,2)
sage: SS = {}
sage: SS[0] = set([VS.subspace([])])
sage: for dim in range(1,dim+1):
....: new_subspaces = set()
....: for v in VS:
....: for ss in SS[dim-1]:
....: new_ss = ss + VS.subspace([v])
....: if new_ss.dimension() == dim:
....: new_subspaces.add(new_ss)
....: SS[dim] = new_subspaces
....:
sage: ground_set = reduce(lambda x,y:x.union(y),SS.values())
sage: the_lattice = LatticePoset((ground_set,lambda x,y: x.is_subspace(y)))x.is_subspace(y)))
3) See https://ask.sagemath.org/question/38938/finding-certain-posets-in-sage/ and https://ask.sagemath.org/question/38936/obtaining-lattices-quickly-in-sage/