本文整理汇总了Python中sympy.polys.domains.QQ.poly_ring方法的典型用法代码示例。如果您正苦于以下问题:Python QQ.poly_ring方法的具体用法?Python QQ.poly_ring怎么用?Python QQ.poly_ring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.polys.domains.QQ
的用法示例。
在下文中一共展示了QQ.poly_ring方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_conversion
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_conversion():
L = QQ.poly_ring(x, y, order="ilex")
G = QQ[x, y]
assert L.convert(x) == L.convert(G.convert(x), G)
assert G.convert(x) == G.convert(L.convert(x), L)
raises(CoercionFailed, lambda: G.convert(L.convert(1/(1+x)), L))
示例2: test_localring
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_localring():
Qxy = QQ.frac_field(x, y)
R = QQ.poly_ring(x, y, order="ilex")
X = R.convert(x)
Y = R.convert(y)
assert x in R
assert 1/x not in R
assert 1/(1 + x) in R
assert Y in R
assert X.ring == R
assert X*(Y**2+1)/(1 + X) == R.convert(x*(y**2 + 1)/(1 + x))
assert X*y == X*Y
raises(ExactQuotientFailed, lambda: X/Y)
raises(ExactQuotientFailed, lambda: x/Y)
raises(ExactQuotientFailed, lambda: X/y)
assert X + y == X + Y == R.convert(x + y) == x + Y
assert X - y == X - Y == R.convert(x - y) == x - Y
assert X + 1 == R.convert(x + 1)
assert X**2 / X == X
assert R.from_GlobalPolynomialRing(ZZ[x, y].convert(x), ZZ[x, y]) == X
assert R.from_FractionField(Qxy.convert(x), Qxy) == X
raises(CoercionFailed, lambda: R.from_FractionField(Qxy.convert(x)/y, Qxy))
raises(ExactQuotientFailed, lambda: X/Y)
raises(NotReversible, lambda: X.invert())
assert R._sdm_to_vector(R._vector_to_sdm([X/(X + 1), Y/(1 + X*Y)], R.order),
2) == \
[X*(1 + X*Y), Y*(1 + X)]
示例3: test_units
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_units():
R = QQ[x]
assert R.is_unit(R.convert(1))
assert R.is_unit(R.convert(2))
assert not R.is_unit(R.convert(x))
assert not R.is_unit(R.convert(1 + x))
R = QQ.poly_ring(x, order='ilex')
assert R.is_unit(R.convert(1))
assert R.is_unit(R.convert(2))
assert not R.is_unit(R.convert(x))
assert R.is_unit(R.convert(1 + x))
R = ZZ[x]
assert R.is_unit(R.convert(1))
assert not R.is_unit(R.convert(2))
assert not R.is_unit(R.convert(x))
assert not R.is_unit(R.convert(1 + x))
示例4: test_localring
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_localring():
Qxy = QQ.frac_field(x, y)
R = QQ.poly_ring(x, y, order="ilex")
X = R.convert(x)
Y = R.convert(y)
assert x in R
assert 1/x not in R
assert 1/(1 + x) in R
assert Y in R
assert X.ring == R
assert X*(Y**2+1)/(1 + X) == R.convert(x*(y**2 + 1)/(1 + x))
assert X*y == X*Y
raises(ExactQuotientFailed, lambda: X/Y)
raises(ExactQuotientFailed, lambda: x/Y)
raises(ExactQuotientFailed, lambda: X/y)
assert X + y == X + Y == R.convert(x + y) == x + Y
assert X + 1 == R.convert(x + 1)
assert X**2 / X == X
assert R.from_GlobalPolynomialRing(ZZ[x, y].convert(x), ZZ[x, y]) == X
assert R.from_FractionField(Qxy.convert(x), Qxy) == X
raises(CoercionFailed, lambda: R.from_FractionField(Qxy.convert(x)/y, Qxy))
示例5: test_PolynomialRing
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_PolynomialRing():
from sympy.polys.domains import QQ
assert latex(QQ[x, y]) == r"\mathbb{Q}\left[x, y\right]"
assert latex(QQ.poly_ring(x, y, order="ilex")) == r"S_<^{-1}\mathbb{Q}\left[x, y\right]"
示例6: test_Domain__unify
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_Domain__unify():
assert ZZ.unify(ZZ) == ZZ
assert QQ.unify(QQ) == QQ
assert ZZ.unify(QQ) == QQ
assert QQ.unify(ZZ) == QQ
assert EX.unify(EX) == EX
assert ZZ.unify(EX) == EX
assert QQ.unify(EX) == EX
assert EX.unify(ZZ) == EX
assert EX.unify(QQ) == EX
assert ZZ.poly_ring('x').unify(EX) == EX
assert ZZ.frac_field('x').unify(EX) == EX
assert EX.unify(ZZ.poly_ring('x')) == EX
assert EX.unify(ZZ.frac_field('x')) == EX
assert ZZ.poly_ring('x','y').unify(EX) == EX
assert ZZ.frac_field('x','y').unify(EX) == EX
assert EX.unify(ZZ.poly_ring('x','y')) == EX
assert EX.unify(ZZ.frac_field('x','y')) == EX
assert QQ.poly_ring('x').unify(EX) == EX
assert QQ.frac_field('x').unify(EX) == EX
assert EX.unify(QQ.poly_ring('x')) == EX
assert EX.unify(QQ.frac_field('x')) == EX
assert QQ.poly_ring('x','y').unify(EX) == EX
assert QQ.frac_field('x','y').unify(EX) == EX
assert EX.unify(QQ.poly_ring('x','y')) == EX
assert EX.unify(QQ.frac_field('x','y')) == EX
assert ZZ.poly_ring('x').unify(ZZ) == ZZ.poly_ring('x')
assert ZZ.poly_ring('x').unify(QQ) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(ZZ) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(QQ) == QQ.poly_ring('x')
assert ZZ.unify(ZZ.poly_ring('x')) == ZZ.poly_ring('x')
assert QQ.unify(ZZ.poly_ring('x')) == QQ.poly_ring('x')
assert ZZ.unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert QQ.unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert ZZ.poly_ring('x','y').unify(ZZ) == ZZ.poly_ring('x','y')
assert ZZ.poly_ring('x','y').unify(QQ) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(ZZ) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(QQ) == QQ.poly_ring('x','y')
assert ZZ.unify(ZZ.poly_ring('x','y')) == ZZ.poly_ring('x','y')
assert QQ.unify(ZZ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert ZZ.unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert QQ.unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert ZZ.frac_field('x').unify(ZZ) == ZZ.frac_field('x')
assert ZZ.frac_field('x').unify(QQ) == EX # QQ.frac_field('x')
assert QQ.frac_field('x').unify(ZZ) == EX # QQ.frac_field('x')
assert QQ.frac_field('x').unify(QQ) == QQ.frac_field('x')
assert ZZ.unify(ZZ.frac_field('x')) == ZZ.frac_field('x')
assert QQ.unify(ZZ.frac_field('x')) == EX # QQ.frac_field('x')
assert ZZ.unify(QQ.frac_field('x')) == EX # QQ.frac_field('x')
assert QQ.unify(QQ.frac_field('x')) == QQ.frac_field('x')
assert ZZ.frac_field('x','y').unify(ZZ) == ZZ.frac_field('x','y')
assert ZZ.frac_field('x','y').unify(QQ) == EX # QQ.frac_field('x','y')
assert QQ.frac_field('x','y').unify(ZZ) == EX # QQ.frac_field('x','y')
assert QQ.frac_field('x','y').unify(QQ) == QQ.frac_field('x','y')
assert ZZ.unify(ZZ.frac_field('x','y')) == ZZ.frac_field('x','y')
assert QQ.unify(ZZ.frac_field('x','y')) == EX # QQ.frac_field('x','y')
assert ZZ.unify(QQ.frac_field('x','y')) == EX # QQ.frac_field('x','y')
assert QQ.unify(QQ.frac_field('x','y')) == QQ.frac_field('x','y')
assert ZZ.poly_ring('x').unify(ZZ.poly_ring('x')) == ZZ.poly_ring('x')
assert ZZ.poly_ring('x').unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(ZZ.poly_ring('x')) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert ZZ.poly_ring('x','y').unify(ZZ.poly_ring('x')) == ZZ.poly_ring('x','y')
assert ZZ.poly_ring('x','y').unify(QQ.poly_ring('x')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(ZZ.poly_ring('x')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(QQ.poly_ring('x')) == QQ.poly_ring('x','y')
assert ZZ.poly_ring('x').unify(ZZ.poly_ring('x','y')) == ZZ.poly_ring('x','y')
assert ZZ.poly_ring('x').unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x').unify(ZZ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x').unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert ZZ.poly_ring('x','y').unify(ZZ.poly_ring('x','z')) == ZZ.poly_ring('x','y','z')
assert ZZ.poly_ring('x','y').unify(QQ.poly_ring('x','z')) == QQ.poly_ring('x','y','z')
assert QQ.poly_ring('x','y').unify(ZZ.poly_ring('x','z')) == QQ.poly_ring('x','y','z')
assert QQ.poly_ring('x','y').unify(QQ.poly_ring('x','z')) == QQ.poly_ring('x','y','z')
assert ZZ.frac_field('x').unify(ZZ.frac_field('x')) == ZZ.frac_field('x')
assert ZZ.frac_field('x').unify(QQ.frac_field('x')) == QQ.frac_field('x')
assert QQ.frac_field('x').unify(ZZ.frac_field('x')) == QQ.frac_field('x')
assert QQ.frac_field('x').unify(QQ.frac_field('x')) == QQ.frac_field('x')
assert ZZ.frac_field('x','y').unify(ZZ.frac_field('x')) == ZZ.frac_field('x','y')
#.........这里部分代码省略.........
示例7: test_Domain_unify_composite
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_Domain_unify_composite():
assert unify(ZZ.poly_ring(x), ZZ) == ZZ.poly_ring(x)
assert unify(ZZ.poly_ring(x), QQ) == QQ.poly_ring(x)
assert unify(QQ.poly_ring(x), ZZ) == QQ.poly_ring(x)
assert unify(QQ.poly_ring(x), QQ) == QQ.poly_ring(x)
assert unify(ZZ, ZZ.poly_ring(x)) == ZZ.poly_ring(x)
assert unify(QQ, ZZ.poly_ring(x)) == QQ.poly_ring(x)
assert unify(ZZ, QQ.poly_ring(x)) == QQ.poly_ring(x)
assert unify(QQ, QQ.poly_ring(x)) == QQ.poly_ring(x)
assert unify(ZZ.poly_ring(x, y), ZZ) == ZZ.poly_ring(x, y)
assert unify(ZZ.poly_ring(x, y), QQ) == QQ.poly_ring(x, y)
assert unify(QQ.poly_ring(x, y), ZZ) == QQ.poly_ring(x, y)
assert unify(QQ.poly_ring(x, y), QQ) == QQ.poly_ring(x, y)
assert unify(ZZ, ZZ.poly_ring(x, y)) == ZZ.poly_ring(x, y)
assert unify(QQ, ZZ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert unify(ZZ, QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert unify(QQ, QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert unify(ZZ.frac_field(x), ZZ) == ZZ.frac_field(x)
assert unify(ZZ.frac_field(x), QQ) == QQ.frac_field(x)
assert unify(QQ.frac_field(x), ZZ) == QQ.frac_field(x)
assert unify(QQ.frac_field(x), QQ) == QQ.frac_field(x)
assert unify(ZZ, ZZ.frac_field(x)) == ZZ.frac_field(x)
assert unify(QQ, ZZ.frac_field(x)) == QQ.frac_field(x)
assert unify(ZZ, QQ.frac_field(x)) == QQ.frac_field(x)
assert unify(QQ, QQ.frac_field(x)) == QQ.frac_field(x)
assert unify(ZZ.frac_field(x, y), ZZ) == ZZ.frac_field(x, y)
assert unify(ZZ.frac_field(x, y), QQ) == QQ.frac_field(x, y)
assert unify(QQ.frac_field(x, y), ZZ) == QQ.frac_field(x, y)
assert unify(QQ.frac_field(x, y), QQ) == QQ.frac_field(x, y)
assert unify(ZZ, ZZ.frac_field(x, y)) == ZZ.frac_field(x, y)
assert unify(QQ, ZZ.frac_field(x, y)) == QQ.frac_field(x, y)
assert unify(ZZ, QQ.frac_field(x, y)) == QQ.frac_field(x, y)
assert unify(QQ, QQ.frac_field(x, y)) == QQ.frac_field(x, y)
assert unify(ZZ.poly_ring(x), ZZ.poly_ring(x)) == ZZ.poly_ring(x)
assert unify(ZZ.poly_ring(x), QQ.poly_ring(x)) == QQ.poly_ring(x)
assert unify(QQ.poly_ring(x), ZZ.poly_ring(x)) == QQ.poly_ring(x)
assert unify(QQ.poly_ring(x), QQ.poly_ring(x)) == QQ.poly_ring(x)
assert unify(ZZ.poly_ring(x, y), ZZ.poly_ring(x)) == ZZ.poly_ring(x, y)
assert unify(ZZ.poly_ring(x, y), QQ.poly_ring(x)) == QQ.poly_ring(x, y)
assert unify(QQ.poly_ring(x, y), ZZ.poly_ring(x)) == QQ.poly_ring(x, y)
assert unify(QQ.poly_ring(x, y), QQ.poly_ring(x)) == QQ.poly_ring(x, y)
assert unify(ZZ.poly_ring(x), ZZ.poly_ring(x, y)) == ZZ.poly_ring(x, y)
assert unify(ZZ.poly_ring(x), QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert unify(QQ.poly_ring(x), ZZ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert unify(QQ.poly_ring(x), QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert unify(ZZ.poly_ring(x, y), ZZ.poly_ring(x, z)) == ZZ.poly_ring(x, y, z)
assert unify(ZZ.poly_ring(x, y), QQ.poly_ring(x, z)) == QQ.poly_ring(x, y, z)
assert unify(QQ.poly_ring(x, y), ZZ.poly_ring(x, z)) == QQ.poly_ring(x, y, z)
assert unify(QQ.poly_ring(x, y), QQ.poly_ring(x, z)) == QQ.poly_ring(x, y, z)
assert unify(ZZ.frac_field(x), ZZ.frac_field(x)) == ZZ.frac_field(x)
assert unify(ZZ.frac_field(x), QQ.frac_field(x)) == QQ.frac_field(x)
assert unify(QQ.frac_field(x), ZZ.frac_field(x)) == QQ.frac_field(x)
assert unify(QQ.frac_field(x), QQ.frac_field(x)) == QQ.frac_field(x)
assert unify(ZZ.frac_field(x, y), ZZ.frac_field(x)) == ZZ.frac_field(x, y)
assert unify(ZZ.frac_field(x, y), QQ.frac_field(x)) == QQ.frac_field(x, y)
assert unify(QQ.frac_field(x, y), ZZ.frac_field(x)) == QQ.frac_field(x, y)
assert unify(QQ.frac_field(x, y), QQ.frac_field(x)) == QQ.frac_field(x, y)
assert unify(ZZ.frac_field(x), ZZ.frac_field(x, y)) == ZZ.frac_field(x, y)
assert unify(ZZ.frac_field(x), QQ.frac_field(x, y)) == QQ.frac_field(x, y)
assert unify(QQ.frac_field(x), ZZ.frac_field(x, y)) == QQ.frac_field(x, y)
assert unify(QQ.frac_field(x), QQ.frac_field(x, y)) == QQ.frac_field(x, y)
assert unify(ZZ.frac_field(x, y), ZZ.frac_field(x, z)) == ZZ.frac_field(x, y, z)
assert unify(ZZ.frac_field(x, y), QQ.frac_field(x, z)) == QQ.frac_field(x, y, z)
assert unify(QQ.frac_field(x, y), ZZ.frac_field(x, z)) == QQ.frac_field(x, y, z)
assert unify(QQ.frac_field(x, y), QQ.frac_field(x, z)) == QQ.frac_field(x, y, z)
assert unify(ZZ.poly_ring(x), ZZ.frac_field(x)) == ZZ.frac_field(x)
assert unify(ZZ.poly_ring(x), QQ.frac_field(x)) == ZZ.frac_field(x)
assert unify(QQ.poly_ring(x), ZZ.frac_field(x)) == ZZ.frac_field(x)
assert unify(QQ.poly_ring(x), QQ.frac_field(x)) == QQ.frac_field(x)
assert unify(ZZ.poly_ring(x, y), ZZ.frac_field(x)) == ZZ.frac_field(x, y)
assert unify(ZZ.poly_ring(x, y), QQ.frac_field(x)) == ZZ.frac_field(x, y)
assert unify(QQ.poly_ring(x, y), ZZ.frac_field(x)) == ZZ.frac_field(x, y)
assert unify(QQ.poly_ring(x, y), QQ.frac_field(x)) == QQ.frac_field(x, y)
assert unify(ZZ.poly_ring(x), ZZ.frac_field(x, y)) == ZZ.frac_field(x, y)
assert unify(ZZ.poly_ring(x), QQ.frac_field(x, y)) == ZZ.frac_field(x, y)
assert unify(QQ.poly_ring(x), ZZ.frac_field(x, y)) == ZZ.frac_field(x, y)
assert unify(QQ.poly_ring(x), QQ.frac_field(x, y)) == QQ.frac_field(x, y)
assert unify(ZZ.poly_ring(x, y), ZZ.frac_field(x, z)) == ZZ.frac_field(x, y, z)
assert unify(ZZ.poly_ring(x, y), QQ.frac_field(x, z)) == ZZ.frac_field(x, y, z)
assert unify(QQ.poly_ring(x, y), ZZ.frac_field(x, z)) == ZZ.frac_field(x, y, z)
assert unify(QQ.poly_ring(x, y), QQ.frac_field(x, z)) == QQ.frac_field(x, y, z)
#.........这里部分代码省略.........
示例8: test_build_order
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_build_order():
R = QQ.poly_ring(x, y, order=(("lex", x), ("ilex", y)))
assert R.order((1, 5)) == ((1,), (-5,))
示例9: test_Domain__unify
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_Domain__unify():
assert ZZ.unify(ZZ) == ZZ
assert QQ.unify(QQ) == QQ
assert ZZ.unify(QQ) == QQ
assert QQ.unify(ZZ) == QQ
assert EX.unify(EX) == EX
assert ZZ.unify(EX) == EX
assert QQ.unify(EX) == EX
assert EX.unify(ZZ) == EX
assert EX.unify(QQ) == EX
assert ZZ.poly_ring(x).unify(EX) == EX
assert ZZ.frac_field(x).unify(EX) == EX
assert EX.unify(ZZ.poly_ring(x)) == EX
assert EX.unify(ZZ.frac_field(x)) == EX
assert ZZ.poly_ring(x, y).unify(EX) == EX
assert ZZ.frac_field(x, y).unify(EX) == EX
assert EX.unify(ZZ.poly_ring(x, y)) == EX
assert EX.unify(ZZ.frac_field(x, y)) == EX
assert QQ.poly_ring(x).unify(EX) == EX
assert QQ.frac_field(x).unify(EX) == EX
assert EX.unify(QQ.poly_ring(x)) == EX
assert EX.unify(QQ.frac_field(x)) == EX
assert QQ.poly_ring(x, y).unify(EX) == EX
assert QQ.frac_field(x, y).unify(EX) == EX
assert EX.unify(QQ.poly_ring(x, y)) == EX
assert EX.unify(QQ.frac_field(x, y)) == EX
assert ZZ.poly_ring(x).unify(ZZ) == ZZ.poly_ring(x)
assert ZZ.poly_ring(x).unify(QQ) == QQ.poly_ring(x)
assert QQ.poly_ring(x).unify(ZZ) == QQ.poly_ring(x)
assert QQ.poly_ring(x).unify(QQ) == QQ.poly_ring(x)
assert ZZ.unify(ZZ.poly_ring(x)) == ZZ.poly_ring(x)
assert QQ.unify(ZZ.poly_ring(x)) == QQ.poly_ring(x)
assert ZZ.unify(QQ.poly_ring(x)) == QQ.poly_ring(x)
assert QQ.unify(QQ.poly_ring(x)) == QQ.poly_ring(x)
assert ZZ.poly_ring(x, y).unify(ZZ) == ZZ.poly_ring(x, y)
assert ZZ.poly_ring(x, y).unify(QQ) == QQ.poly_ring(x, y)
assert QQ.poly_ring(x, y).unify(ZZ) == QQ.poly_ring(x, y)
assert QQ.poly_ring(x, y).unify(QQ) == QQ.poly_ring(x, y)
assert ZZ.unify(ZZ.poly_ring(x, y)) == ZZ.poly_ring(x, y)
assert QQ.unify(ZZ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert ZZ.unify(QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert QQ.unify(QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert ZZ.frac_field(x).unify(ZZ) == ZZ.frac_field(x)
assert ZZ.frac_field(x).unify(QQ) == EX # QQ.frac_field(x)
assert QQ.frac_field(x).unify(ZZ) == EX # QQ.frac_field(x)
assert QQ.frac_field(x).unify(QQ) == QQ.frac_field(x)
assert ZZ.unify(ZZ.frac_field(x)) == ZZ.frac_field(x)
assert QQ.unify(ZZ.frac_field(x)) == EX # QQ.frac_field(x)
assert ZZ.unify(QQ.frac_field(x)) == EX # QQ.frac_field(x)
assert QQ.unify(QQ.frac_field(x)) == QQ.frac_field(x)
assert ZZ.frac_field(x, y).unify(ZZ) == ZZ.frac_field(x, y)
assert ZZ.frac_field(x, y).unify(QQ) == EX # QQ.frac_field(x,y)
assert QQ.frac_field(x, y).unify(ZZ) == EX # QQ.frac_field(x,y)
assert QQ.frac_field(x, y).unify(QQ) == QQ.frac_field(x, y)
assert ZZ.unify(ZZ.frac_field(x, y)) == ZZ.frac_field(x, y)
assert QQ.unify(ZZ.frac_field(x, y)) == EX # QQ.frac_field(x,y)
assert ZZ.unify(QQ.frac_field(x, y)) == EX # QQ.frac_field(x,y)
assert QQ.unify(QQ.frac_field(x, y)) == QQ.frac_field(x, y)
assert ZZ.poly_ring(x).unify(ZZ.poly_ring(x)) == ZZ.poly_ring(x)
assert ZZ.poly_ring(x).unify(QQ.poly_ring(x)) == QQ.poly_ring(x)
assert QQ.poly_ring(x).unify(ZZ.poly_ring(x)) == QQ.poly_ring(x)
assert QQ.poly_ring(x).unify(QQ.poly_ring(x)) == QQ.poly_ring(x)
assert ZZ.poly_ring(x, y).unify(ZZ.poly_ring(x)) == ZZ.poly_ring(x, y)
assert ZZ.poly_ring(x, y).unify(QQ.poly_ring(x)) == QQ.poly_ring(x, y)
assert QQ.poly_ring(x, y).unify(ZZ.poly_ring(x)) == QQ.poly_ring(x, y)
assert QQ.poly_ring(x, y).unify(QQ.poly_ring(x)) == QQ.poly_ring(x, y)
assert ZZ.poly_ring(x).unify(ZZ.poly_ring(x, y)) == ZZ.poly_ring(x, y)
assert ZZ.poly_ring(x).unify(QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert QQ.poly_ring(x).unify(ZZ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert QQ.poly_ring(x).unify(QQ.poly_ring(x, y)) == QQ.poly_ring(x, y)
assert ZZ.poly_ring(x, y).unify(ZZ.poly_ring(x, z)) == ZZ.poly_ring(x, y, z)
assert ZZ.poly_ring(x, y).unify(QQ.poly_ring(x, z)) == QQ.poly_ring(x, y, z)
assert QQ.poly_ring(x, y).unify(ZZ.poly_ring(x, z)) == QQ.poly_ring(x, y, z)
assert QQ.poly_ring(x, y).unify(QQ.poly_ring(x, z)) == QQ.poly_ring(x, y, z)
assert ZZ.frac_field(x).unify(ZZ.frac_field(x)) == ZZ.frac_field(x)
assert ZZ.frac_field(x).unify(QQ.frac_field(x)) == QQ.frac_field(x)
assert QQ.frac_field(x).unify(ZZ.frac_field(x)) == QQ.frac_field(x)
assert QQ.frac_field(x).unify(QQ.frac_field(x)) == QQ.frac_field(x)
assert ZZ.frac_field(x, y).unify(ZZ.frac_field(x)) == ZZ.frac_field(x, y)
#.........这里部分代码省略.........
示例10: test_Domain__unify
# 需要导入模块: from sympy.polys.domains import QQ [as 别名]
# 或者: from sympy.polys.domains.QQ import poly_ring [as 别名]
def test_Domain__unify():
assert ZZ.unify(ZZ) == ZZ
assert QQ.unify(QQ) == QQ
assert ZZ.unify(QQ) == QQ
assert QQ.unify(ZZ) == QQ
assert EX.unify(EX) == EX
assert ZZ.unify(EX) == EX
assert QQ.unify(EX) == EX
assert EX.unify(ZZ) == EX
assert EX.unify(QQ) == EX
assert ZZ.poly_ring('x').unify(EX) == EX
assert ZZ.frac_field('x').unify(EX) == EX
assert EX.unify(ZZ.poly_ring('x')) == EX
assert EX.unify(ZZ.frac_field('x')) == EX
assert ZZ.poly_ring('x','y').unify(EX) == EX
assert ZZ.frac_field('x','y').unify(EX) == EX
assert EX.unify(ZZ.poly_ring('x','y')) == EX
assert EX.unify(ZZ.frac_field('x','y')) == EX
assert QQ.poly_ring('x').unify(EX) == EX
assert QQ.frac_field('x').unify(EX) == EX
assert EX.unify(QQ.poly_ring('x')) == EX
assert EX.unify(QQ.frac_field('x')) == EX
assert QQ.poly_ring('x','y').unify(EX) == EX
assert QQ.frac_field('x','y').unify(EX) == EX
assert EX.unify(QQ.poly_ring('x','y')) == EX
assert EX.unify(QQ.frac_field('x','y')) == EX
assert ZZ.poly_ring('x').unify(ZZ) == ZZ.poly_ring('x')
assert ZZ.poly_ring('x').unify(QQ) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(ZZ) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(QQ) == QQ.poly_ring('x')
assert ZZ.unify(ZZ.poly_ring('x')) == ZZ.poly_ring('x')
assert QQ.unify(ZZ.poly_ring('x')) == QQ.poly_ring('x')
assert ZZ.unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert QQ.unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert ZZ.poly_ring('x','y').unify(ZZ) == ZZ.poly_ring('x','y')
assert ZZ.poly_ring('x','y').unify(QQ) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(ZZ) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(QQ) == QQ.poly_ring('x','y')
assert ZZ.unify(ZZ.poly_ring('x','y')) == ZZ.poly_ring('x','y')
assert QQ.unify(ZZ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert ZZ.unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert QQ.unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert ZZ.frac_field('x').unify(ZZ) == ZZ.frac_field('x')
assert ZZ.frac_field('x').unify(QQ) == EX # QQ.frac_field('x')
assert QQ.frac_field('x').unify(ZZ) == EX # QQ.frac_field('x')
assert QQ.frac_field('x').unify(QQ) == QQ.frac_field('x')
assert ZZ.unify(ZZ.frac_field('x')) == ZZ.frac_field('x')
assert QQ.unify(ZZ.frac_field('x')) == EX # QQ.frac_field('x')
assert ZZ.unify(QQ.frac_field('x')) == EX # QQ.frac_field('x')
assert QQ.unify(QQ.frac_field('x')) == QQ.frac_field('x')
assert ZZ.frac_field('x','y').unify(ZZ) == ZZ.frac_field('x','y')
assert ZZ.frac_field('x','y').unify(QQ) == EX # QQ.frac_field('x','y')
assert QQ.frac_field('x','y').unify(ZZ) == EX # QQ.frac_field('x','y')
assert QQ.frac_field('x','y').unify(QQ) == QQ.frac_field('x','y')
assert ZZ.unify(ZZ.frac_field('x','y')) == ZZ.frac_field('x','y')
assert QQ.unify(ZZ.frac_field('x','y')) == EX # QQ.frac_field('x','y')
assert ZZ.unify(QQ.frac_field('x','y')) == EX # QQ.frac_field('x','y')
assert QQ.unify(QQ.frac_field('x','y')) == QQ.frac_field('x','y')
assert ZZ.poly_ring('x').unify(ZZ.poly_ring('x')) == ZZ.poly_ring('x')
assert ZZ.poly_ring('x').unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(ZZ.poly_ring('x')) == QQ.poly_ring('x')
assert QQ.poly_ring('x').unify(QQ.poly_ring('x')) == QQ.poly_ring('x')
assert ZZ.poly_ring('x','y').unify(ZZ.poly_ring('x')) == ZZ.poly_ring('x','y')
assert ZZ.poly_ring('x','y').unify(QQ.poly_ring('x')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(ZZ.poly_ring('x')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x','y').unify(QQ.poly_ring('x')) == QQ.poly_ring('x','y')
assert ZZ.poly_ring('x').unify(ZZ.poly_ring('x','y')) == ZZ.poly_ring('x','y')
assert ZZ.poly_ring('x').unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x').unify(ZZ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert QQ.poly_ring('x').unify(QQ.poly_ring('x','y')) == QQ.poly_ring('x','y')
assert ZZ.poly_ring('x','y').unify(ZZ.poly_ring('x','z')) == ZZ.poly_ring('x','y','z')
assert ZZ.poly_ring('x','y').unify(QQ.poly_ring('x','z')) == QQ.poly_ring('x','y','z')
assert QQ.poly_ring('x','y').unify(ZZ.poly_ring('x','z')) == QQ.poly_ring('x','y','z')
assert QQ.poly_ring('x','y').unify(QQ.poly_ring('x','z')) == QQ.poly_ring('x','y','z')
assert ZZ.frac_field('x').unify(ZZ.frac_field('x')) == ZZ.frac_field('x')
assert ZZ.frac_field('x').unify(QQ.frac_field('x')) == QQ.frac_field('x')
assert QQ.frac_field('x').unify(ZZ.frac_field('x')) == QQ.frac_field('x')
assert QQ.frac_field('x').unify(QQ.frac_field('x')) == QQ.frac_field('x')
assert ZZ.frac_field('x','y').unify(ZZ.frac_field('x')) == ZZ.frac_field('x','y')
#.........这里部分代码省略.........