Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168756
Image: ubuntu2004
#Here insert the Graph and subsystem which is to be trace out g = {0: [1,2]} sub = [0] partition = [[0,3,1],[4,5]]
G = Graph(g, boundary = sub); G;
Graph on 3 vertices
G.plot()
MS = MatrixSpace(GF(2), G.order());MS
Full MatrixSpace of 3 by 3 dense matrices over Finite Field of size 2
I = MS.identity_matrix(); I;
[1 0 0] [0 1 0] [0 0 1]
adj = matrix(GF(2), G); adj
[0 1 1] [1 0 0] [1 0 0]
generator = block_matrix([adj,I], ncols = 2); generator
[0 1 1|1 0 0] [1 0 0|0 1 0] [1 0 0|0 0 1]
trace = generator.echelon_form();trace
[1 0 0|0 0 1] [0 1 1|1 0 0] [0 0 0|0 1 1]
stab = trace.row_space();stab; v = stab([0,1,1,1,1,1]); v
Vector space of degree 6 and dimension 3 over Finite Field of size 2 Basis matrix: [1 0 0 0 0 1] [0 1 1 1 0 0] [0 0 0 0 1 1] (0, 1, 1, 1, 1, 1)
stab.subspace([v])
Vector space of degree 6 and dimension 1 over Finite Field of size 2 Basis matrix: [0 0 0 0 1 1]
stab.subspace?

File: /usr/local/sage2/local/lib/python2.6/site-packages/sage/modules/free_module.py

Type: <type ‘instancemethod’>

Definition: stab.subspace(gens, check=True, already_echelonized=False)

Docstring:

Return the subspace of self spanned by the elements of gens.

INPUT:

  • gens - list of vectors
  • check - bool (default: True) verify that gens are all in stab.
  • already_echelonized - bool (default: False) set to True if you know the gens are in Echelon form.

EXAMPLES:

First we create a 1-dimensional vector subspace of an ambient 3-dimensional space over the finite field of order 7.

sage: V = VectorSpace(GF(7), 3)
sage: W = V.subspace([[2,3,4]]); W
Vector space of degree 3 and dimension 1 over Finite Field of size 7
Basis matrix:
[1 5 2]

Next we create an invalid subspace, but it’s allowed since check=False. This is just equivalent to computing the span of the element.

sage: W.subspace([[1,1,0]], check=False)
Vector space of degree 3 and dimension 1 over Finite Field of size 7
Basis matrix:
[1 1 0]

With check=True (the default) the mistake is correctly detected and reported with an ArithmeticError exception.

sage: W.subspace([[1,1,0]], check=True)
...
ArithmeticError: Argument gens (= [[1, 1, 0]]) does not generate a submodule of stab.
tg = trace.submatrix(0,0,G.order(),G.order());tg
[1 0 0] [0 1 1] [0 0 0]
tg.plot()