本文整理汇总了Python中sage.combinat.root_system.cartan_type.CartanType.is_crystallographic方法的典型用法代码示例。如果您正苦于以下问题:Python CartanType.is_crystallographic方法的具体用法?Python CartanType.is_crystallographic怎么用?Python CartanType.is_crystallographic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.combinat.root_system.cartan_type.CartanType
的用法示例。
在下文中一共展示了CartanType.is_crystallographic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: CoxeterGroup
# 需要导入模块: from sage.combinat.root_system.cartan_type import CartanType [as 别名]
# 或者: from sage.combinat.root_system.cartan_type.CartanType import is_crystallographic [as 别名]
def CoxeterGroup(cartan_type, implementation = None):
"""
INPUT:
- ``cartan_type`` -- a cartan type (or coercible into; see :class:`CartanType`)
- ``implementation`` -- "permutation", "matrix", "coxeter3", or None (default: None)
Returns an implementation of the Coxeter group of type
``cartan_type``.
EXAMPLES:
If ``implementation`` is not specified, a permutation
representation is returned whenever possible (finite irreducible
Cartan type, with the GAP3 Chevie package available)::
sage: W = CoxeterGroup(["A",2])
sage: W # optional - chevie
Permutation Group with generators [(1,3)(2,5)(4,6), (1,4)(2,3)(5,6)]
Otherwise, a Weyl group is returned::
sage: W = CoxeterGroup(["A",3,1])
sage: W
Weyl Group of type ['A', 3, 1] (as a matrix group acting on the root space)
We now use the ``implementation`` option::
sage: W = CoxeterGroup(["A",2], implementation = "permutation") # optional - chevie
sage: W # optional - chevie
Permutation Group with generators [(1,3)(2,5)(4,6), (1,4)(2,3)(5,6)]
sage: W.category() # optional - chevie
Join of Category of finite permutation groups and Category of finite coxeter groups
sage: W = CoxeterGroup(["A",2], implementation = "matrix")
sage: W
Weyl Group of type ['A', 2] (as a matrix group acting on the ambient space)
sage: W = CoxeterGroup(["H",3], implementation = "matrix")
Traceback (most recent call last):
...
NotImplementedError: Coxeter group of type ['H', 3] as matrix group not implemented
sage: W = CoxeterGroup(["A",4,1], implementation = "permutation")
Traceback (most recent call last):
...
NotImplementedError: Coxeter group of type ['A', 4, 1] as permutation group not implemented
"""
assert implementation in ["permutation", "matrix", "coxeter3", None]
cartan_type = CartanType(cartan_type)
if implementation is None:
if cartan_type.is_finite() and cartan_type.is_irreducible() and is_chevie_available():
implementation = "permutation"
else:
implementation = "matrix"
if implementation == "coxeter3":
try:
from sage.libs.coxeter3.coxeter_group import CoxeterGroup
except ImportError:
raise RuntimeError, "coxeter3 must be installed"
else:
return CoxeterGroup(cartan_type)
if implementation == "permutation" and is_chevie_available() and \
cartan_type.is_finite() and cartan_type.is_irreducible():
return CoxeterGroupAsPermutationGroup(cartan_type)
elif implementation == "matrix" and cartan_type.is_crystallographic():
return WeylGroup(cartan_type)
else:
raise NotImplementedError, "Coxeter group of type %s as %s group not implemented "%(cartan_type, implementation)
示例2: CoxeterGroup
# 需要导入模块: from sage.combinat.root_system.cartan_type import CartanType [as 别名]
# 或者: from sage.combinat.root_system.cartan_type.CartanType import is_crystallographic [as 别名]
#.........这里部分代码省略.........
``implementation`` is not specified, the reflection representation
is returned::
sage: W = CoxeterGroup(["A",2])
sage: W
Finite Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3]
[3 1]
sage: W = CoxeterGroup(["A",3,1]); W
Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2 3]
[3 1 3 2]
[2 3 1 3]
[3 2 3 1]
sage: W = CoxeterGroup(['H',3]); W
Finite Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]
We now use the ``implementation`` option::
sage: W = CoxeterGroup(["A",2], implementation = "permutation") # optional - chevie
sage: W # optional - chevie
Permutation Group with generators [(1,3)(2,5)(4,6), (1,4)(2,3)(5,6)]
sage: W.category() # optional - chevie
Join of Category of finite permutation groups and Category of finite coxeter groups
sage: W = CoxeterGroup(["A",2], implementation="matrix")
sage: W
Weyl Group of type ['A', 2] (as a matrix group acting on the ambient space)
sage: W = CoxeterGroup(["H",3], implementation="matrix")
sage: W
Finite Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]
sage: W = CoxeterGroup(["H",3], implementation="reflection")
sage: W
Finite Coxeter group over Universal Cyclotomic Field with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]
sage: W = CoxeterGroup(["A",4,1], implementation="permutation")
Traceback (most recent call last):
...
NotImplementedError: Coxeter group of type ['A', 4, 1] as permutation group not implemented
We use the different options for the "reflection" implementation::
sage: W = CoxeterGroup(["H",3], implementation="reflection", base_ring=RR)
sage: W
Finite Coxeter group over Real Field with 53 bits of precision with Coxeter matrix:
[1 3 2]
[3 1 5]
[2 5 1]
sage: W = CoxeterGroup([[1,10],[10,1]], implementation="reflection", index_set=['a','b'], base_ring=SR)
sage: W
Finite Coxeter group over Symbolic Ring with Coxeter matrix:
[ 1 10]
[10 1]
TESTS::
sage: W = groups.misc.CoxeterGroup(["H",3])
"""
if implementation not in ["permutation", "matrix", "coxeter3", "reflection", None]:
raise ValueError("invalid type implementation")
try:
cartan_type = CartanType(data)
except (TypeError, ValueError): # If it is not a Cartan type, try to see if we can represent it as a matrix group
return CoxeterMatrixGroup(data, base_ring, index_set)
if implementation is None:
implementation = "matrix"
if implementation == "reflection":
return CoxeterMatrixGroup(cartan_type, base_ring, index_set)
if implementation == "coxeter3":
try:
from sage.libs.coxeter3.coxeter_group import CoxeterGroup
except ImportError:
raise RuntimeError("coxeter3 must be installed")
else:
return CoxeterGroup(cartan_type)
if implementation == "permutation" and is_chevie_available() and \
cartan_type.is_finite() and cartan_type.is_irreducible():
return CoxeterGroupAsPermutationGroup(cartan_type)
elif implementation == "matrix":
if cartan_type.is_crystallographic():
return WeylGroup(cartan_type)
return CoxeterMatrixGroup(cartan_type, base_ring, index_set)
raise NotImplementedError("Coxeter group of type {} as {} group not implemented".format(cartan_type, implementation))