本文整理汇总了Python中sage.combinat.root_system.cartan_type.CartanType类的典型用法代码示例。如果您正苦于以下问题:Python CartanType类的具体用法?Python CartanType怎么用?Python CartanType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CartanType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _element_constructor_
def _element_constructor_(self, cartan_type, **kwds):
"""
The element constructor.
This method is called internally when we try to convert
something into an element. In this case, the only thing that
can be converted into an associahedron is the Cartan type.
EXAMPLES::
sage: from sage.combinat.root_system.associahedron import Associahedra
sage: parent = Associahedra(QQ,2)
sage: parent(['A',2])
Generalized associahedron of type ['A', 2] with 5 vertices
sage: parent._element_constructor_(['A',2])
Generalized associahedron of type ['A', 2] with 5 vertices
"""
cartan_type = CartanType(cartan_type)
if not cartan_type.is_finite():
raise ValueError("the Cartan type must be finite")
root_space = cartan_type.root_system().root_space()
# TODO: generalize this as a method of root lattice realization
rhocheck = sum(beta.associated_coroot()
for beta in root_space.positive_roots()) / 2
I = root_space.index_set()
inequalities = []
for orbit in root_space.almost_positive_roots_decomposition():
c = rhocheck.coefficient(orbit[0].leading_support())
for beta in orbit:
inequalities.append([c] + [beta.coefficient(i) for i in I])
associahedron = super(Associahedra, self)._element_constructor_(None, [inequalities, []])
associahedron._cartan_type = cartan_type
return associahedron
开发者ID:Babyll,项目名称:sage,代码行数:33,代码来源:associahedron.py
示例2: __classcall_private__
def __classcall_private__(cls, cartan_type, wt=None):
r"""
Normalize the input arguments to ensure unique representation.
EXAMPLES::
sage: La = RootSystem(['A', 2]).weight_lattice().fundamental_weights()
sage: RC = crystals.RiggedConfigurations(La[1])
sage: RC2 = crystals.RiggedConfigurations(['A', 2], La[1])
sage: RC is RC2
True
"""
if wt is None:
wt = cartan_type
cartan_type = wt.parent().cartan_type()
else:
cartan_type = CartanType(cartan_type)
wt_lattice = cartan_type.root_system().weight_lattice()
wt = wt_lattice(wt)
if not cartan_type.is_simply_laced():
vct = cartan_type.as_folding()
return CrystalOfNonSimplyLacedRC(vct, wt)
return super(CrystalOfRiggedConfigurations, cls).__classcall__(cls, wt)
开发者ID:BlairArchibald,项目名称:sage,代码行数:25,代码来源:rc_crystal.py
示例3: __classcall_private__
def __classcall_private__(cls, cartan_type, virtual, orbit):
"""
Normalize input to ensure a unique representation.
EXAMPLES::
sage: from sage.combinat.root_system.type_folded import CartanTypeFolded
sage: sigma_list = [[0], [1,5], [2,4], [3]]
sage: fct1 = CartanTypeFolded(['C',3,1], ['A',5,1], sigma_list)
sage: sigma_tuple = tuple(map(tuple, sigma_list))
sage: fct2 = CartanTypeFolded(CartanType(['C',3,1]), CartanType(['A',5,1]), sigma_tuple)
sage: fct3 = CartanTypeFolded('C3~', 'A5~', {0:[0], 2:[2,4], 1:[1,5], 3:[3]})
sage: fct1 is fct2 and fct2 is fct3
True
"""
if isinstance(cartan_type, CartanTypeFolded):
return cartan_type
cartan_type = CartanType(cartan_type)
virtual = CartanType(virtual)
if isinstance(orbit, dict):
i_set = cartan_type.index_set()
orb = [None]*len(i_set)
for k,v in six.iteritems(orbit):
orb[i_set.index(k)] = tuple(v)
orbit = tuple(orb)
else:
orbit = tuple(map(tuple, orbit))
return super(CartanTypeFolded, cls).__classcall__(cls, cartan_type, virtual, orbit)
开发者ID:sagemath,项目名称:sage,代码行数:28,代码来源:type_folded.py
示例4: __classcall_private__
def __classcall_private__(cls, cartan_type, r, s):
"""
Normalize the input arguments to ensure unique representation.
EXAMPLES::
sage: KRT1 = KirillovReshetikhinTableaux(CartanType(['A',3,1]), 2, 3)
sage: KRT2 = KirillovReshetikhinTableaux(['A',3,1], 2, 3)
sage: KRT1 is KRT2
True
"""
ct = CartanType(cartan_type)
assert ct.is_affine()
if ct.is_untwisted_affine():
if ct.letter == 'D':
if r == ct.n or r == ct.n - 1:
return KRTableauxSpin(ct, r, s)
return KRTableauxTypeVertical(ct, r, s)
if ct.letter == 'B':
if r == ct.n:
return KRTableauxBn(ct, r, s)
return KRTypeVertical(ct, r, s)
if ct.letter == 'A' or (ct.letter == 'C' and r == ct.n):
return KRTableauxRectangle(ct, r, s)
else:
if ct.dual().letter == 'B':
return KRTableauxTypeVertical(ct, r, s)
raise NotImplementedError
开发者ID:pombredanne,项目名称:sage-1,代码行数:32,代码来源:kr_tableaux.py
示例5: __classcall_private__
def __classcall_private__(cls, ct, c=None, use_Y=None):
r"""
Normalize input to ensure a unique representation.
INPUT:
- ``ct`` -- a Cartan type
EXAMPLES::
sage: M = crystals.infinity.NakajimaMonomials("E8")
sage: M1 = crystals.infinity.NakajimaMonomials(['E',8])
sage: M2 = crystals.infinity.NakajimaMonomials(CartanType(['E',8]))
sage: M is M1 is M2
True
"""
if use_Y is not None:
from sage.misc.superseded import deprecation
deprecation(18895, 'use_Y is deprecated; use the set_variables() method instead.')
else:
use_Y = True
cartan_type = CartanType(ct)
n = len(cartan_type.index_set())
c = InfinityCrystalOfNakajimaMonomials._normalize_c(c, n)
M = super(InfinityCrystalOfNakajimaMonomials, cls).__classcall__(cls, cartan_type, c)
if not use_Y:
M.set_variables('A')
else:
M.set_variables('Y')
return M
开发者ID:robertwb,项目名称:sage,代码行数:31,代码来源:monomial_crystals.py
示例6: __classcall_private__
def __classcall_private__(cls, ambient, virtualization, scaling_factors,
contained=None, generators=None,
cartan_type=None, index_set=None, category=None):
"""
Normalize arguments to ensure a unique representation.
EXAMPLES::
sage: B = crystals.Tableaux(['B',3], shape=[1])
sage: C = crystals.Tableaux(['D',4], shape=[2])
sage: psi1 = B.crystal_morphism(C.module_generators)
sage: V1 = psi1.image()
sage: psi2 = B.crystal_morphism(C.module_generators, index_set=[1,2,3])
sage: V2 = psi2.image()
sage: V1 is V2
True
"""
if cartan_type is None:
cartan_type = ambient.cartan_type()
else:
cartan_type = CartanType(cartan_type)
if index_set is None:
index_set = cartan_type.index_set()
if generators is None:
generators = ambient.module_generators
virtualization = Family(virtualization)
scaling_factors = Family(scaling_factors)
category = Crystals().or_subcategory(category)
return super(Subcrystal, cls).__classcall__(cls, ambient, virtualization, scaling_factors,
contained, tuple(generators), cartan_type,
tuple(index_set), category)
开发者ID:Findstat,项目名称:sage,代码行数:33,代码来源:virtual_crystal.py
示例7: __classcall_private__
def __classcall_private__(cls, arg0, cartan_type=None, kac_moody=True):
"""
Parse input to ensure a unique representation.
INPUT:
- ``arg0`` -- a simple Lie algebra or a base ring
- ``cartan_type`` -- a Cartan type
EXAMPLES::
sage: L1 = lie_algebras.Affine(QQ, ['A',4,1])
sage: cl = lie_algebras.sl(QQ, 5)
sage: L2 = lie_algebras.Affine(cl)
sage: L1 is L2
True
sage: cl.affine() is L1
True
"""
if isinstance(arg0, LieAlgebra):
ct = arg0.cartan_type()
if not ct.is_finite():
raise ValueError("the base Lie algebra is not simple")
cartan_type = ct.affine()
g = arg0
else:
# arg0 is the base ring
cartan_type = CartanType(cartan_type)
if not cartan_type.is_affine():
raise ValueError("the Cartan type must be affine")
g = LieAlgebra(arg0, cartan_type=cartan_type.classical())
if not cartan_type.is_untwisted_affine():
raise NotImplementedError("only currently implemented for untwisted affine types")
return super(AffineLieAlgebra, cls).__classcall__(cls, g, kac_moody)
开发者ID:sagemath,项目名称:sage,代码行数:35,代码来源:affine_lie_algebra.py
示例8: __init__
def __init__(self, W_types, index_set=None, hyperplane_index_set=None, reflection_index_set=None):
r"""
Initialize ``self``.
TESTS::
sage: W = ReflectionGroup(['A',3]) # optional - gap3
sage: TestSuite(W).run() # optional - gap3
"""
W_types = tuple([tuple(W_type) if isinstance(W_type, (list, tuple)) else W_type for W_type in W_types])
cartan_types = []
for W_type in W_types:
W_type = CartanType(W_type)
if not W_type.is_finite() or not W_type.is_irreducible():
raise ValueError("the given Cartan type of a component is not irreducible and finite")
cartan_types.append(W_type)
if len(W_types) == 1:
cls = IrreducibleComplexReflectionGroup
else:
cls = ComplexReflectionGroup
cls.__init__(
self,
W_types,
index_set=index_set,
hyperplane_index_set=hyperplane_index_set,
reflection_index_set=reflection_index_set,
)
开发者ID:novoselt,项目名称:sage,代码行数:27,代码来源:reflection_group_real.py
示例9: __classcall_private__
def __classcall_private__(cls, cartan_type, shapes = None, shape = None):
"""
Normalizes the input arguments to ensure unique representation,
and to delegate the construction of spin tableaux.
EXAMPLES::
sage: T1 = CrystalOfTableaux(CartanType(['A',3]), shape = [2,2])
sage: T2 = CrystalOfTableaux(['A',3], shape = (2,2))
sage: T3 = CrystalOfTableaux(['A',3], shapes = ([2,2],))
sage: T2 is T1, T3 is T1
(True, True)
"""
cartan_type = CartanType(cartan_type)
n = cartan_type.rank()
# standardize shape/shapes input into a tuple of tuples
assert operator.xor(shape is not None, shapes is not None)
if shape is not None:
shapes = (shape,)
spin_shapes = tuple( tuple(shape) for shape in shapes )
try:
shapes = tuple( tuple(trunc(i) for i in shape) for shape in spin_shapes )
except StandardError:
raise ValueError("shapes should all be partitions or half-integer partitions")
if spin_shapes == shapes:
return super(CrystalOfTableaux, cls).__classcall__(cls, cartan_type, shapes)
# Handle the construction of a crystals of spin tableaux
# Caveat: this currently only supports all shapes being half
# integer partitions of length the rank for type B and D. In
# particular, for type D, the spins all have to be plus or all
# minus spins
assert all(len(sh) == n for sh in shapes), \
"the length of all half-integer partition shapes should be the rank"
assert all(2*i % 2 == 1 for shape in spin_shapes for i in shape), \
"shapes should be either all partitions or all half-integer partitions"
if cartan_type.type() == 'D':
if all( i >= 0 for shape in spin_shapes for i in shape):
S = CrystalOfSpinsPlus(cartan_type)
elif all(shape[-1]<0 for shape in spin_shapes):
S = CrystalOfSpinsMinus(cartan_type)
else:
raise ValueError, "In type D spins should all be positive or negative"
else:
assert all( i >= 0 for shape in spin_shapes for i in shape), \
"shapes should all be partitions"
S = CrystalOfSpins(cartan_type)
B = CrystalOfTableaux(cartan_type, shapes = shapes)
T = TensorProductOfCrystals(S,B, generators=[[S.module_generators[0],x] for x in B.module_generators])
T.rename("The crystal of tableaux of type %s and shape(s) %s"%(cartan_type, list(list(shape) for shape in spin_shapes)))
T.shapes = spin_shapes
return T
开发者ID:odellus,项目名称:sage,代码行数:52,代码来源:tensor_product.py
示例10: cartan_type
def cartan_type(self):
"""
Return the Cartan type of ``self``.
EXAMPLES::
sage: FiniteWeylGroups().example().cartan_type()
['A', 3] relabelled by {1: 0, 2: 1, 3: 2}
"""
from sage.combinat.root_system.cartan_type import CartanType
C = CartanType(['A',self.n-1])
C = C.relabel(lambda i:i-1)
return C
开发者ID:sagemath,项目名称:sage,代码行数:13,代码来源:finite_weyl_groups.py
示例11: __classcall_private__
def __classcall_private__(cls, cartan_type):
"""
Normalize input to ensure a unique representation.
EXAMPLES::
sage: B = crystals.infinity.Tableaux(['A',4])
sage: B2 = crystals.infinity.Tableaux(CartanType(['A',4]))
sage: B is B2
True
"""
cartan_type = CartanType(cartan_type)
if cartan_type.type() == 'D':
return InfinityCrystalOfTableauxTypeD(cartan_type)
return super(InfinityCrystalOfTableaux, cls).__classcall__(cls, cartan_type)
开发者ID:BlairArchibald,项目名称:sage,代码行数:15,代码来源:infinity_crystals.py
示例12: __classcall_private__
def __classcall_private__(cls, cartan_type, i):
r"""
Normalize input to ensure a unique representation.
EXAMPLES::
sage: B = crystals.elementary.Elementary(['A',4], 3)
sage: C = crystals.elementary.Elementary(CartanType("A4"), int(3))
sage: B is C
True
"""
cartan_type = CartanType(cartan_type)
if i not in cartan_type.index_set():
raise ValueError('i must an element of the index set.')
return super(ElementaryCrystal, cls).__classcall__(cls, cartan_type, i)
开发者ID:sagemath,项目名称:sage,代码行数:15,代码来源:elementary_crystals.py
示例13: __classcall__
def __classcall__(cls, cartan_type):
"""
Normalize input to ensure a unique representation.
EXAMPLES::
sage: B1 = crystals.infinity.PBW(['A', 2])
sage: B2 = crystals.infinity.PBW("A2")
sage: B3 = crystals.infinity.PBW(CartanType("A2"))
sage: B1 is B2 and B2 is B3
True
"""
cartan_type = CartanType(cartan_type)
if not cartan_type.is_finite():
raise NotImplementedError("only implemented for finite types")
return super(PBWCrystal, cls).__classcall__(cls, cartan_type)
开发者ID:sagemath,项目名称:sage,代码行数:16,代码来源:pbw_crystal.py
示例14: CartanTypeFindStat
class CartanTypeFindStat(object):
"""
A Cartan type class for FindStat
"""
def __init__(self, ct):
self._cartan_type = CartanType(ct)
def __hash__(self):
return hash(self._cartan_type)
def _latex_(self):
return self._cartan_type.dynkin_diagram()._latex_()
def __repr__(self):
return self._cartan_type._repr_()
_repr_ = __repr__
开发者ID:Findstat,项目名称:sage,代码行数:17,代码来源:findstat_cartan_type.py
示例15: __classcall_private__
def __classcall_private__(cls, cartan_type):
r"""
Normalize the input arguments to ensure unique representation.
EXAMPLES::
sage: RC1 = crystals.infinity.RiggedConfigurations(CartanType(['A',3]))
sage: RC2 = crystals.infinity.RiggedConfigurations(['A',3])
sage: RC2 is RC1
True
"""
cartan_type = CartanType(cartan_type)
if not cartan_type.is_simply_laced():
vct = cartan_type.as_folding()
return InfinityCrystalOfNonSimplyLacedRC(vct)
return super(InfinityCrystalOfRiggedConfigurations, cls).__classcall__(cls, cartan_type)
开发者ID:JoseGuzman,项目名称:sage,代码行数:17,代码来源:rc_infinity.py
示例16: __classcall_private__
def __classcall_private__(cls, starting_weight, cartan_type = None, starting_weight_parent = None):
"""
Classcall to mend the input.
Internally, the
:class:`~sage.combinat.crystals.littlemann_path.CrystalOfLSPaths` code
works with a ``starting_weight`` that is in the weight space associated
to the crystal. The user can, however, also input a ``cartan_type``
and the coefficients of the fundamental weights as
``starting_weight``. This code transforms the input into the right
format (also necessary for UniqueRepresentation).
TESTS::
sage: crystals.LSPaths(['A',2,1],[-1,0,1])
The crystal of LS paths of type ['A', 2, 1] and weight -Lambda[0] + Lambda[2]
sage: R = RootSystem(['B',2,1])
sage: La = R.weight_space(extended=True).basis()
sage: C = crystals.LSPaths(['B',2,1],[0,0,1])
sage: B = crystals.LSPaths(La[2])
sage: B is C
True
"""
if cartan_type is not None:
cartan_type, starting_weight = CartanType(starting_weight), cartan_type
if cartan_type.is_affine():
extended = True
else:
extended = False
R = RootSystem(cartan_type)
P = R.weight_space(extended = extended)
Lambda = P.basis()
offset = R.index_set()[Integer(0)]
starting_weight = P.sum(starting_weight[j-offset]*Lambda[j] for j in R.index_set())
if starting_weight_parent is None:
starting_weight_parent = starting_weight.parent()
else:
# Both the weight and the parent of the weight are passed as arguments of init to be able
# to distinguish between crystals with the extended and non-extended weight lattice!
if starting_weight.parent() != starting_weight_parent:
raise ValueError("The passed parent is not equal to parent of the inputted weight!")
return super(CrystalOfLSPaths, cls).__classcall__(cls, starting_weight, starting_weight_parent = starting_weight_parent)
开发者ID:Findstat,项目名称:sage,代码行数:45,代码来源:littelmann_path.py
示例17: __classcall_private__
def __classcall_private__(cls, ambient, virtualization, scaling_factors,
contained=None, generators=None,
cartan_type=None, index_set=None, category=None):
"""
Normalize arguments to ensure a unique representation.
EXAMPLES::
sage: B = crystals.Tableaux(['B',3], shape=[1])
sage: C = crystals.Tableaux(['D',4], shape=[2])
sage: psi1 = B.crystal_morphism(C.module_generators)
sage: V1 = psi1.image()
sage: psi2 = B.crystal_morphism(C.module_generators, index_set=[1,2,3])
sage: V2 = psi2.image()
sage: V1 is V2
True
TESTS:
Check that :trac:`19481` is fixed::
sage: from sage.combinat.crystals.virtual_crystal import VirtualCrystal
sage: A = crystals.Tableaux(['A',3], shape=[2,1,1])
sage: V = VirtualCrystal(A, {1:(1,3), 2:(2,)}, {1:1, 2:2}, cartan_type=['C',2])
sage: V.category()
Category of finite crystals
"""
if cartan_type is None:
cartan_type = ambient.cartan_type()
else:
cartan_type = CartanType(cartan_type)
if index_set is None:
index_set = cartan_type.index_set()
if generators is None:
generators = ambient.module_generators
virtualization = Family(virtualization)
scaling_factors = Family(scaling_factors)
category = Crystals().or_subcategory(category)
if ambient in FiniteCrystals() or isinstance(contained, frozenset):
category = category.Finite()
return super(Subcrystal, cls).__classcall__(cls, ambient, virtualization, scaling_factors,
contained, tuple(generators), cartan_type,
tuple(index_set), category)
开发者ID:Babyll,项目名称:sage,代码行数:45,代码来源:virtual_crystal.py
示例18: __classcall_private__
def __classcall_private__(cls, cartan_type, La):
r"""
Normalize input to ensure a unique representation.
EXAMPLES::
sage: La = RootSystem(['E',8,1]).weight_lattice(extended=True).fundamental_weights()
sage: M = crystals.NakajimaMonomials(['E',8,1],La[0]+La[8])
sage: M1 = crystals.NakajimaMonomials(CartanType(['E',8,1]),La[0]+La[8])
sage: M2 = crystals.NakajimaMonomials(['E',8,1],M.Lambda()[0] + M.Lambda()[8])
sage: M is M1 is M2
True
"""
cartan_type = CartanType(cartan_type)
if cartan_type.is_affine():
La = RootSystem(cartan_type).weight_lattice(extended=True)(La)
else:
La = RootSystem(cartan_type).weight_lattice()(La)
return super(CrystalOfNakajimaMonomials, cls).__classcall__(cls, cartan_type, La)
开发者ID:sensen1,项目名称:sage,代码行数:19,代码来源:monomial_crystals.py
示例19: __classcall_private__
def __classcall_private__(cls, cartan_type, B):
"""
Normalize the input arguments to ensure unique representation.
EXAMPLES::
sage: T1 = crystals.TensorProductOfKirillovReshetikhinTableaux(CartanType(['A',3,1]), [[2,2]])
sage: T2 = crystals.TensorProductOfKirillovReshetikhinTableaux(['A',3,1], [(2,2)])
sage: T3 = crystals.TensorProductOfKirillovReshetikhinTableaux(['A',3,1], ((2,2),))
sage: T2 is T1, T3 is T1
(True, True)
"""
cartan_type = CartanType(cartan_type)
if not cartan_type.is_affine():
raise ValueError("The Cartan type must be affine")
# Standardize B input into a tuple of tuples
B = tuple(tuple(dim) for dim in B)
return super(TensorProductOfKirillovReshetikhinTableaux, cls).__classcall__(cls, cartan_type, B)
开发者ID:sagemath,项目名称:sage,代码行数:19,代码来源:tensor_product_kr_tableaux.py
示例20: __classcall_private__
def __classcall_private__(cls, cartan_type, seq=None):
"""
Normalize input to ensure a unique representation.
EXAMPLES::
sage: B1 = crystals.infinity.PolyhedralRealization(['A',2])
sage: B2 = crystals.infinity.PolyhedralRealization(['A',2], [1,2])
sage: B1 is B2
True
"""
cartan_type = CartanType(cartan_type)
if seq is None:
seq = cartan_type.index_set()
else:
seq = tuple(seq)
if set(seq) != set(cartan_type.index_set()):
raise ValueError("the support of seq is not the index set")
return super(InfinityCrystalAsPolyhedralRealization, cls).__classcall__(cls, cartan_type, seq)
开发者ID:Findstat,项目名称:sage,代码行数:19,代码来源:polyhedral_realization.py
注:本文中的sage.combinat.root_system.cartan_type.CartanType类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论