Affine Subspaces of a Vector Space#
An affine subspace of a vector space is a translation of a linear subspace. The affine subspaces here are only used internally in hyperplane arrangements. You should not use them for interactive work or return them to the user.
EXAMPLES:
sage: from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace
sage: a = AffineSubspace([1,0,0,0], QQ^4)
sage: a.dimension()
4
sage: a.point()
(1, 0, 0, 0)
sage: a.linear_part()
Vector space of dimension 4 over Rational Field
sage: a
Affine space p + W where:
p = (1, 0, 0, 0)
W = Vector space of dimension 4 over Rational Field
sage: b = AffineSubspace((1,0,0,0), matrix(QQ, [[1,2,3,4]]).right_kernel())
sage: c = AffineSubspace((0,2,0,0), matrix(QQ, [[0,0,1,2]]).right_kernel())
sage: b.intersection(c)
Affine space p + W where:
p = (-3, 2, 0, 0)
W = Vector space of degree 4 and dimension 2 over Rational Field
Basis matrix:
[ 1 0 -1 1/2]
[ 0 1 -2 1]
sage: b < a
True
sage: c < b
False
sage: A = AffineSubspace([8,38,21,250], VectorSpace(GF(19),4))
sage: A
Affine space p + W where:
p = (8, 0, 2, 3)
W = Vector space of dimension 4 over Finite Field of size 19
>>> from sage.all import *
>>> from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace
>>> a = AffineSubspace([Integer(1),Integer(0),Integer(0),Integer(0)], QQ**Integer(4))
>>> a.dimension()
4
>>> a.point()
(1, 0, 0, 0)
>>> a.linear_part()
Vector space of dimension 4 over Rational Field
>>> a
Affine space p + W where:
p = (1, 0, 0, 0)
W = Vector space of dimension 4 over Rational Field
>>> b = AffineSubspace((Integer(1),Integer(0),Integer(0),Integer(0)), matrix(QQ, [[Integer(1),Integer(2),Integer(3),Integer(4)]]).right_kernel())
>>> c = AffineSubspace((Integer(0),Integer(2),Integer(0),Integer(0)), matrix(QQ, [[Integer(0),Integer(0),Integer(1),Integer(2)]]).right_kernel())
>>> b.intersection(c)
Affine space p + W where:
p = (-3, 2, 0, 0)
W = Vector space of degree 4 and dimension 2 over Rational Field
Basis matrix:
[ 1 0 -1 1/2]
[ 0 1 -2 1]
>>> b < a
True
>>> c < b
False
>>> A = AffineSubspace([Integer(8),Integer(38),Integer(21),Integer(250)], VectorSpace(GF(Integer(19)),Integer(4)))
>>> A
Affine space p + W where:
p = (8, 0, 2, 3)
W = Vector space of dimension 4 over Finite Field of size 19
- class sage.geometry.hyperplane_arrangement.affine_subspace.AffineSubspace(p, V)[source]#
Bases:
SageObject
An affine subspace.
INPUT:
p
– list/tuple/iterable representing a point on the affine spaceV
– vector subspace
OUTPUT:
Affine subspace parallel to
V
and passing throughp
.EXAMPLES:
sage: from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace sage: a = AffineSubspace([1,0,0,0], VectorSpace(QQ,4)) sage: a Affine space p + W where: p = (1, 0, 0, 0) W = Vector space of dimension 4 over Rational Field
>>> from sage.all import * >>> from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace >>> a = AffineSubspace([Integer(1),Integer(0),Integer(0),Integer(0)], VectorSpace(QQ,Integer(4))) >>> a Affine space p + W where: p = (1, 0, 0, 0) W = Vector space of dimension 4 over Rational Field
- dimension()[source]#
Return the dimension of the affine space.
OUTPUT:
An integer.
EXAMPLES:
sage: from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace sage: a = AffineSubspace([1,0,0,0],VectorSpace(QQ,4)) sage: a.dimension() 4
>>> from sage.all import * >>> from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace >>> a = AffineSubspace([Integer(1),Integer(0),Integer(0),Integer(0)],VectorSpace(QQ,Integer(4))) >>> a.dimension() 4
- intersection(other)[source]#
Return the intersection of
self
withother
.INPUT:
other
– anAffineSubspace
OUTPUT:
A new affine subspace, (or
None
if the intersection is empty).EXAMPLES:
sage: from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace sage: V = VectorSpace(QQ,3) sage: U = V.subspace([(1,0,0), (0,1,0)]) sage: W = V.subspace([(0,1,0), (0,0,1)]) sage: A = AffineSubspace((0,0,0), U) sage: B = AffineSubspace((1,1,1), W) sage: A.intersection(B) Affine space p + W where: p = (1, 1, 0) W = Vector space of degree 3 and dimension 1 over Rational Field Basis matrix: [0 1 0] sage: C = AffineSubspace((0,0,1), U) sage: A.intersection(C) sage: C = AffineSubspace((7,8,9), U.complement()) sage: A.intersection(C) Affine space p + W where: p = (7, 8, 0) W = Vector space of degree 3 and dimension 0 over Rational Field Basis matrix: [] sage: A.intersection(C).intersection(B) sage: D = AffineSubspace([1,2,3], VectorSpace(GF(5),3)) sage: E = AffineSubspace([3,4,5], VectorSpace(GF(5),3)) sage: D.intersection(E) Affine space p + W where: p = (3, 4, 0) W = Vector space of dimension 3 over Finite Field of size 5
>>> from sage.all import * >>> from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace >>> V = VectorSpace(QQ,Integer(3)) >>> U = V.subspace([(Integer(1),Integer(0),Integer(0)), (Integer(0),Integer(1),Integer(0))]) >>> W = V.subspace([(Integer(0),Integer(1),Integer(0)), (Integer(0),Integer(0),Integer(1))]) >>> A = AffineSubspace((Integer(0),Integer(0),Integer(0)), U) >>> B = AffineSubspace((Integer(1),Integer(1),Integer(1)), W) >>> A.intersection(B) Affine space p + W where: p = (1, 1, 0) W = Vector space of degree 3 and dimension 1 over Rational Field Basis matrix: [0 1 0] >>> C = AffineSubspace((Integer(0),Integer(0),Integer(1)), U) >>> A.intersection(C) >>> C = AffineSubspace((Integer(7),Integer(8),Integer(9)), U.complement()) >>> A.intersection(C) Affine space p + W where: p = (7, 8, 0) W = Vector space of degree 3 and dimension 0 over Rational Field Basis matrix: [] >>> A.intersection(C).intersection(B) >>> D = AffineSubspace([Integer(1),Integer(2),Integer(3)], VectorSpace(GF(Integer(5)),Integer(3))) >>> E = AffineSubspace([Integer(3),Integer(4),Integer(5)], VectorSpace(GF(Integer(5)),Integer(3))) >>> D.intersection(E) Affine space p + W where: p = (3, 4, 0) W = Vector space of dimension 3 over Finite Field of size 5
- linear_part()[source]#
Return the linear part of the affine space.
OUTPUT:
A vector subspace of the ambient space.
EXAMPLES:
sage: from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace sage: A = AffineSubspace([2,3,1], matrix(QQ, [[1,2,3]]).right_kernel()) sage: A.linear_part() Vector space of degree 3 and dimension 2 over Rational Field Basis matrix: [ 1 0 -1/3] [ 0 1 -2/3] sage: A.linear_part().ambient_vector_space() Vector space of dimension 3 over Rational Field
>>> from sage.all import * >>> from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace >>> A = AffineSubspace([Integer(2),Integer(3),Integer(1)], matrix(QQ, [[Integer(1),Integer(2),Integer(3)]]).right_kernel()) >>> A.linear_part() Vector space of degree 3 and dimension 2 over Rational Field Basis matrix: [ 1 0 -1/3] [ 0 1 -2/3] >>> A.linear_part().ambient_vector_space() Vector space of dimension 3 over Rational Field
- point()[source]#
Return a point
p
in the affine space.OUTPUT:
A point of the affine space as a vector in the ambient space.
EXAMPLES:
sage: from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace sage: A = AffineSubspace([2,3,1], VectorSpace(QQ,3)) sage: A.point() (2, 3, 1)
>>> from sage.all import * >>> from sage.geometry.hyperplane_arrangement.affine_subspace import AffineSubspace >>> A = AffineSubspace([Integer(2),Integer(3),Integer(1)], VectorSpace(QQ,Integer(3))) >>> A.point() (2, 3, 1)