1 | initial version |
Here is an example code. It answers my own question.
Sage: V = VectorSpace(GF(2),100) # example vector space
Sage: def dim_(V):
if V.dimension() == 0:
return 0
else:
#choose a nonzero element whenever it exists, for e.g. first element after 0 vector
return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()
Sage: def dim_(V):
Sage: 100
2 | No.2 Revision |
Here is an example code. It answers my own question.
Sage: V = VectorSpace(GF(2),100) # example vector space
Sage: def dim_(V):
if V.dimension() == 0:
return 0
else:
#choose a nonzero element whenever it exists, for e.g. first element after 0 vector
return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()
Sage: def dim_(V):
Sage: 100
3 | No.3 Revision |
Here is an example code. It answers my own question.
Sage: V = VectorSpace(GF(2),100) # example vector space
Sage: def dim_(V):
if V.dimension() == 0:
return 0
else:
#choose a nonzero element whenever it exists, for e.g. first element after 0 vector
return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()
Sage: dim_(V):
Sage: 100
4 | No.4 Revision |
Here is an example code. It answers my own question.
Sage: V = VectorSpace(GF(2),100) # example vector space
Sage: def dim_(V):
if V.dimension() == 0:
return 0
else:
#choose a nonzero element whenever it exists, for e.g. first element after 0 vector
return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()
Sage: dim_(V):
dim_(V):
Sage: 100
5 | No.5 Revision |
Here is an example code. It answers my own question.
Sage: V = VectorSpace(GF(2),100) # example vector space
Sage: def dim_(V):
if V.dimension() == 0:
return 0
else:
#choose a nonzero element whenever it exists, for e.g. first element after 0 vector
return span([V[1]]).dimension() + dim(V.quotient(span([V[1]])))#.dimension()
Sage: dim_(V): dim_(V)
Sage: 100