ProperPair Class¶
- class stdpairs.ProperPair(monomial, face, ambient_ideal, properness=False)¶
Bases:
object
A class representing a proper pair with respect to given monomial ideal \(I\), which is a pair \((a,F)\) where \(a\) is a monomial in the ambient affine monoid, and \(F\) denotes a face such that \(a+\mathbb{N}F \cap I = \emptyset\). Or, abusively, this class also generated without checking the condition \(a+\mathbb{N}F \cap I = \emptyset\) using
properness
argument.INPUT:
monomial
– ANumPy.ndarray
object with 2-dimensional shape and integer elements orsage.matrix.matrix_integer_dense
type variable. In any cases, this argument should have only one column.face
– Atuple
object representing a face inambient_ideal.ambient_monoid()
.ambient_ideal
– AMonomialIdeal
object.properness=False
– Abool
object. If this argument isTrue
, then this class does not give an error even if \(a+\mathbb{N}F \cap I\) is nonempty.
OUTPUT:
ProperPair
object \((a,F)\) whose \(a\) ismonomial
argument and \(F\) isface
argument.
EXAMPLE:
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: import numpy sage: A = matrix(ZZ,[[1,2],[0,2]]) sage: Q = AffineMonoid(A) sage: M = matrix(ZZ,[[4,6],[4,6]]) sage: I = MonomialIdeal(M,Q) sage: #Using ``NumPy`` sage: # Below ``P`` is a proper pair. sage: P = ProperPair(numpy.array([[2],[2]]), (0,), I) sage: # But below ``Not_P`` raise error that this is not a proper pair. sage: # Not_P =ProperPair(matrix(ZZ,[[2],[2]]), (1,), I) sage: # However, using ``properness`` as ``True`` the same construction does not give you error; sage: # Basically the module does not check whether the given pair is proper or not. sage: Not_P =ProperPair(matrix(ZZ,[[2],[2]]), (1,), I,True)
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: A = matrix(ZZ,[[1,2],[0,2]]) sage: Q = AffineMonoid(A) sage: M = matrix(ZZ,[[4,6],[4,6]]) sage: I = MonomialIdeal(M,Q) sage: #Using ``NumPy`` sage: # Below ``P`` is a proper pair. sage: P = ProperPair(matrix(ZZ,[[2],[2]]), (0,), I)
TESTS:
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: A = matrix(ZZ,[[0,1,1,0],[0,0,1,1],[1,1,1,1]]) sage: Q = AffineMonoid(A) sage: I = MonomialIdeal(matrix(ZZ,[[2,2,2],[0,1,2],[2,2,2]]),Q) sage: P = ProperPair(matrix(ZZ,[[1], [1], [1]]), (0,), I) sage: if (P.is_maximal() != False): ....: raise SyntaxError("Method is_maximal() is problematic; please report it to the developer.") sage: P = ProperPair(matrix(ZZ,[[1], [1], [1]]), (3,), I) sage: if (P.is_maximal() != False): ....: raise SyntaxError("Method is_maximal() is problematic; please report it to the developer.") sage: P = ProperPair(matrix(ZZ,[[1], [1], [1]]), (0,3), I) sage: if (P.is_maximal() != True): ....: raise SyntaxError("Method is_maximal() is problematic; please report it to the developer.")
- ambient_ideal()¶
returns an ideal which decides whether
self
is proper (i.e., a translation of submonoid does not intersect with the ideal) or not. This was given whenself
was created.OUTPUT:
ambient_ideal
– AMonomialIdeal
object.
EXAMPLE:
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: Q=AffineMonoid(matrix(ZZ,[[1,2],[0,2]])) sage: I=MonomialIdeal(matrix(ZZ,[[4,6],[4,6]]),Q) sage: P=ProperPair(matrix(ZZ,[[2],[2]]),(0,),I) sage: P.ambient_ideal() An ideal whose generating set is [[4] [4]]
- face()¶
returns the face of
self
as atuple
object.OUTPUT:
gens
– Atuple
object.
EXAMPLE:
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: Q=AffineMonoid(matrix(ZZ,[[1,2],[0,2]])) sage: I=MonomialIdeal(matrix(ZZ,[[4,6],[4,6]]),Q) sage: P=ProperPair(matrix(ZZ,[[2],[2]]),(0,),I) sage: P.face() (0,) sage: Q.face((0,)) array([[1], [0]])
- is_element(a_monomial)¶
Given
a_monomial
monomial, say \(b\), in the ambient monoid, find a matrix whose row \(u\) is a solution of \(F*u =b-a\) where \((a,F)\) is the give proper pairself
. In other words, ifa_monomial
in \(a+\mathbb{N}F\), return a matrix whose row \(u\) satisfies \(a+F*u=b\). Otherwise, return an empty matrix.INPUT:
a_monomial
– ANumPy.ndarray
object with 2-dimensional shape, integer elements, and only one vector, orsage.matrix.matrix_integer_dense
object with one column.
OUTPUT:
A
sage.matrix.matrix_integer_dense
object.
EXAMPLE:
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: Q=AffineMonoid(matrix(ZZ,[[1,2],[0,2]])) sage: I=MonomialIdeal(matrix(ZZ,[[3,7],[2,0]]),Q) sage: P= ProperPair(matrix(ZZ,[[2],[2]]),(1,),I) sage: P.is_element(matrix(ZZ,[[8],[8]])) [3] sage: # This means that [[8],[8]]- [[2],[2]] = 3*[[2],[2]] sage: P.is_element(matrix(ZZ,[[7],[7]])) [] sage: # This does not have solution since [[7],[7]] cannot be obtained by integer.
- is_maximal()¶
returns
True
if and only if a pair is maximal with respect to divisibility. A proper pair \((a,F)\) is maximal with respect to divisibility if for any proper pair \((b,G)\) there is no such element \(c\) in the ambient affine monoid such that \(a+c+\mathbb{N}F \subseteq b+\mathbb{N}G\). Notes that this function is not properly working if you generated the given pair with properness=`False` argument.OUTPUT:
A
bool
object.
EXAMPLE:
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: A = matrix(ZZ,[[0,1,1,0],[0,0,1,1],[1,1,1,1]]) sage: Q = AffineMonoid(A) sage: I = MonomialIdeal(matrix(ZZ,[[2,2,2],[0,1,2],[2,2,2]]),Q) sage: P = ProperPair(matrix(ZZ,[[1], [1], [1]]), (0,), I) sage: P.is_maximal() False sage: P = ProperPair(matrix(ZZ,[[1], [1], [1]]), (0,3), I) sage: P.is_maximal() True
- monomial()¶
returns the monomial of
self
.OUTPUT:
monomial
– ANumPy.ndarray
object with 2-dimensional shape, integer elements, and only one column.
EXAMPLE:
sage: from stdpairs import AffineMonoid, MonomialIdeal, ProperPair sage: Q=AffineMonoid(matrix(ZZ,[[1,2],[0,2]])) sage: I=MonomialIdeal(matrix(ZZ,[[4,6],[4,6]]),Q) sage: P=ProperPair(matrix(ZZ,[[2],[2]]),(0,),I) sage: P.monomial() array([[2], [2]])