def __init__(self, A): """ EXAMPLES:: sage: CommutativeAlgebraIdeals(ZZ['x']) Category of commutative algebra ideals in Univariate Polynomial Ring in x over Integer Ring sage: CommutativeAlgebraIdeals(ZZ) Traceback (most recent call last): ... TypeError: A (=Integer Ring) must be a commutative algebra sage: CommutativeAlgebraIdeals(IntegerModRing(4)) Traceback (most recent call last): ... TypeError: A (=Ring of integers modulo 4) must be a commutative algebra sage: CommutativeAlgebraIdeals(Partitions(4)) Traceback (most recent call last): ... TypeError: A (=Partitions of the integer 4) must be a commutative algebra TESTS:: sage: TestSuite(CommutativeAlgebraIdeals(QQ['x'])).run() """ # TODO: replace by ``A in CommutativeAlgebras(*)`` once a # suitable mantra has been implemented for this. from sage.algebras.algebra import is_Algebra from sage.rings.ring import CommutativeRing if not (is_Algebra(A) and isinstance(A, CommutativeRing)): raise TypeError("A (=%s) must be a commutative algebra" % A) Category_in_ambient.__init__(self, A)
def __init__(self, A): """ EXAMPLES:: sage: CommutativeAlgebraIdeals(ZZ['x']) Category of commutative algebra ideals in Univariate Polynomial Ring in x over Integer Ring sage: CommutativeAlgebraIdeals(ZZ) Traceback (most recent call last): ... TypeError: A (=Integer Ring) must be a commutative algebra sage: CommutativeAlgebraIdeals(IntegerModRing(4)) Traceback (most recent call last): ... TypeError: A (=Ring of integers modulo 4) must be a commutative algebra sage: CommutativeAlgebraIdeals(Partitions(4)) Traceback (most recent call last): ... TypeError: A (=Partitions of the integer 4) must be a commutative algebra TESTS:: sage: TestSuite(CommutativeAlgebraIdeals(QQ[x])).run() """ # TODO: replace by ``A in CommutativeAlgebras(*)`` once a # suitable mantra has been implemented for this. from sage.algebras.algebra import is_Algebra from sage.rings.commutative_ring import is_CommutativeRing if not (is_Algebra(A) and is_CommutativeRing(A)): raise TypeError("A (=%s) must be a commutative algebra"%A) Category_in_ambient.__init__(self, A)
def __init__(self, A): """ EXAMPLES:: sage: AlgebraIdeals(QQ['a']) Category of algebra ideals in Univariate Polynomial Ring in a over Rational Field sage: AlgebraIdeals(QQ) Traceback (most recent call last): ... TypeError: A (=Rational Field) must be an algebra TESTS:: sage: TestSuite(AlgebraIdeals(QQ['a'])).run() """ from sage.algebras.algebra import is_Algebra if not is_Algebra(A): # A not in Algebras() ? raise TypeError("A (=%s) must be an algebra" % A) Category_ideal.__init__(self, A)
def __init__(self, A): """ EXAMPLES:: sage: AlgebraIdeals(QQ['a']) Category of algebra ideals in Univariate Polynomial Ring in a over Rational Field sage: AlgebraIdeals(QQ) Traceback (most recent call last): ... TypeError: A (=Rational Field) must be an algebra TESTS:: sage: TestSuite(AlgebraIdeals(QQ['a'])).run() """ from sage.algebras.algebra import is_Algebra if not is_Algebra(A): # A not in Algebras() ? raise TypeError("A (=%s) must be an algebra"%A) Category_ideal.__init__(self, A)
def __init__(self, A): """ EXAMPLES:: sage: AlgebraIdeals(FreeAlgebra(QQ,2,'a,b')) Category of algebra ideals in Free Algebra on 2 generators (a, b) over Rational Field sage: AlgebraIdeals(QQ) Traceback (most recent call last): ... TypeError: A (=Rational Field) must be an algebra TESTS:: sage: TestSuite(AlgebraIdeals(FreeAlgebra(QQ,2,'a,b'))).run() """ from sage.algebras.algebra import is_Algebra if not is_Algebra(A): # A not in Algebras() ? raise TypeError, "A (=%s) must be an algebra" % A Category_ideal.__init__(self, A)
def __init__(self, A): """ EXAMPLES:: sage: AlgebraIdeals(FreeAlgebra(QQ,2,'a,b')) Category of algebra ideals in Free Algebra on 2 generators (a, b) over Rational Field sage: AlgebraIdeals(QQ) Traceback (most recent call last): ... TypeError: A (=Rational Field) must be an algebra TESTS:: sage: TestSuite(AlgebraIdeals(FreeAlgebra(QQ,2,'a,b'))).run() """ from sage.algebras.algebra import is_Algebra if not is_Algebra(A): # A not in Algebras() ? raise TypeError("A (=%s) must be an algebra"%A) Category_ideal.__init__(self, A)