Unique factorization domains¶
- class sage.categories.unique_factorization_domains.UniqueFactorizationDomains[source]¶
- Bases: - Category_singleton- The category of (constructive) unique factorization domains. - In a constructive unique factorization domain we can constructively factor members into a product of a finite number of irreducible elements. - EXAMPLES: - sage: UniqueFactorizationDomains() Category of unique factorization domains sage: UniqueFactorizationDomains().super_categories() [Category of gcd domains] - >>> from sage.all import * >>> UniqueFactorizationDomains() Category of unique factorization domains >>> UniqueFactorizationDomains().super_categories() [Category of gcd domains] - class ElementMethods[source]¶
- Bases: - object- radical(*args, **kwds)[source]¶
- Return the radical of this element, i.e. the product of its irreducible factors. - This default implementation calls - squarefree_decompositionif available, and- factorotherwise.- See also - EXAMPLES: - sage: Pol.<x> = QQ[] sage: (x^2*(x-1)^3).radical() x^2 - x sage: pol = 37 * (x-1)^3 * (x-2)^2 * (x-1/3)^7 * (x-3/7) sage: pol.radical() 37*x^4 - 2923/21*x^3 + 1147/7*x^2 - 1517/21*x + 74/7 sage: Integer(10).radical() 10 sage: Integer(-100).radical() 10 sage: Integer(0).radical() Traceback (most recent call last): ... ArithmeticError: radical of 0 is not defined - >>> from sage.all import * >>> Pol = QQ['x']; (x,) = Pol._first_ngens(1) >>> (x**Integer(2)*(x-Integer(1))**Integer(3)).radical() x^2 - x >>> pol = Integer(37) * (x-Integer(1))**Integer(3) * (x-Integer(2))**Integer(2) * (x-Integer(1)/Integer(3))**Integer(7) * (x-Integer(3)/Integer(7)) >>> pol.radical() 37*x^4 - 2923/21*x^3 + 1147/7*x^2 - 1517/21*x + 74/7 >>> Integer(Integer(10)).radical() 10 >>> Integer(-Integer(100)).radical() 10 >>> Integer(Integer(0)).radical() Traceback (most recent call last): ... ArithmeticError: radical of 0 is not defined - The next example shows how to compute the radical of a number, assuming no prime > 100000 has exponent > 1 in the factorization: - sage: n = 2^1000-1; n / radical(n, limit=100000) 125 - >>> from sage.all import * >>> n = Integer(2)**Integer(1000)-Integer(1); n / radical(n, limit=Integer(100000)) 125 
 - squarefree_part()[source]¶
- Return the square-free part of this element, i.e. the product of its irreducible factors appearing with odd multiplicity. - This default implementation calls - squarefree_decomposition.- See also - EXAMPLES: - sage: Pol.<x> = QQ[] sage: (x^2*(x-1)^3).squarefree_part() x - 1 sage: pol = 37 * (x-1)^3 * (x-2)^2 * (x-1/3)^7 * (x-3/7) sage: pol.squarefree_part() 37*x^3 - 1369/21*x^2 + 703/21*x - 37/7 - >>> from sage.all import * >>> Pol = QQ['x']; (x,) = Pol._first_ngens(1) >>> (x**Integer(2)*(x-Integer(1))**Integer(3)).squarefree_part() x - 1 >>> pol = Integer(37) * (x-Integer(1))**Integer(3) * (x-Integer(2))**Integer(2) * (x-Integer(1)/Integer(3))**Integer(7) * (x-Integer(3)/Integer(7)) >>> pol.squarefree_part() 37*x^3 - 1369/21*x^2 + 703/21*x - 37/7 
 
 - class ParentMethods[source]¶
- Bases: - object- is_unique_factorization_domain(proof=True)[source]¶
- Return - True, since this in an object of the category of unique factorization domains.- EXAMPLES: - sage: UFD = UniqueFactorizationDomains() sage: Parent(QQ, category=UFD).is_unique_factorization_domain() True - >>> from sage.all import * >>> UFD = UniqueFactorizationDomains() >>> Parent(QQ, category=UFD).is_unique_factorization_domain() True 
 
 - additional_structure()[source]¶
- Return whether - selfis a structure category.- See also - The category of unique factorization domains does not define additional structure: a ring morphism between unique factorization domains is a unique factorization domain morphism. - EXAMPLES: - sage: UniqueFactorizationDomains().additional_structure() - >>> from sage.all import * >>> UniqueFactorizationDomains().additional_structure()