本文整理汇总了Python中sympy.Symbol.as_dummy方法的典型用法代码示例。如果您正苦于以下问题:Python Symbol.as_dummy方法的具体用法?Python Symbol.as_dummy怎么用?Python Symbol.as_dummy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sympy.Symbol
的用法示例。
在下文中一共展示了Symbol.as_dummy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_as_dummy
# 需要导入模块: from sympy import Symbol [as 别名]
# 或者: from sympy.Symbol import as_dummy [as 别名]
def test_as_dummy():
x = Symbol('x')
x1 = x.as_dummy()
assert x1 != x
assert x1 != x.as_dummy()
x = Symbol('x', commutative=False)
x1 = x.as_dummy()
assert x1 != x
assert x1.is_commutative is False
示例2: test_as_dummy_nondummy
# 需要导入模块: from sympy import Symbol [as 别名]
# 或者: from sympy.Symbol import as_dummy [as 别名]
def test_as_dummy_nondummy():
x = Symbol('x')
x1 = x.as_dummy()
assert x1 != x
assert x1 != x.as_dummy()
# assert x == x1.as_nondummy()
x = Symbol('x', commutative = False)
x1 = x.as_dummy()
assert x1 != x
assert x1.is_commutative == False
示例3: test_as_dummy
# 需要导入模块: from sympy import Symbol [as 别名]
# 或者: from sympy.Symbol import as_dummy [as 别名]
def test_as_dummy():
x = Symbol('x')
x1 = x.as_dummy()
assert x1 != x
assert x1 != x.as_dummy()
x = Symbol('x', commutative = False)
x1 = x.as_dummy()
assert x1 != x
assert x1.is_commutative == False
# issue 2446
x = Symbol('x', real=True, commutative=False)
assert x.as_dummy().assumptions0 == x.assumptions0
示例4: test_Dummy_from_Symbol
# 需要导入模块: from sympy import Symbol [as 别名]
# 或者: from sympy.Symbol import as_dummy [as 别名]
def test_Dummy_from_Symbol():
# should not get the full dictionary of assumptions
n = Symbol('n', integer=True)
d = n.as_dummy()
s1 = "Dummy('n', dummy_index=%s, integer=True)" % str(d.dummy_index)
s2 = "Dummy('n', integer=True, dummy_index=%s)" % str(d.dummy_index)
assert srepr(d) in (s1, s2)
示例5: test_Dummy_from_Symbol
# 需要导入模块: from sympy import Symbol [as 别名]
# 或者: from sympy.Symbol import as_dummy [as 别名]
def test_Dummy_from_Symbol():
# should not get the full dictionary of assumptions
n = Symbol('n', integer=True)
d = n.as_dummy()
assert srepr(d) == "Dummy('n', integer=True)"