本文整理汇总了Python中sage.tensor.modules.free_module_tensor.FreeModuleTensor._new_comp方法的典型用法代码示例。如果您正苦于以下问题:Python FreeModuleTensor._new_comp方法的具体用法?Python FreeModuleTensor._new_comp怎么用?Python FreeModuleTensor._new_comp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.tensor.modules.free_module_tensor.FreeModuleTensor
的用法示例。
在下文中一共展示了FreeModuleTensor._new_comp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _new_comp
# 需要导入模块: from sage.tensor.modules.free_module_tensor import FreeModuleTensor [as 别名]
# 或者: from sage.tensor.modules.free_module_tensor.FreeModuleTensor import _new_comp [as 别名]
def _new_comp(self, basis):
r"""
Create some (uninitialized) components of ``self`` in a given basis.
INPUT:
- ``basis`` -- basis of the free module on which ``self`` is defined
OUTPUT:
- an instance of :class:`~sage.tensor.modules.comp.Components` or,
if ``self`` is the identity, of the subclass
:class:`~sage.tensor.modules.comp.KroneckerDelta`
EXAMPLES::
sage: M = FiniteRankFreeModule(ZZ, 3, name='M')
sage: e = M.basis('e')
sage: a = M.automorphism()
sage: a._new_comp(e)
2-indices components w.r.t. Basis (e_0,e_1,e_2) on the Rank-3 free
module M over the Integer Ring
sage: id = M.identity_map()
sage: id._new_comp(e)
Kronecker delta of size 3x3
sage: type(id._new_comp(e))
<class 'sage.tensor.modules.comp.KroneckerDelta'>
"""
from .comp import KroneckerDelta
if self._is_identity:
fmodule = self._fmodule
return KroneckerDelta(
fmodule._ring, basis, start_index=fmodule._sindex, output_formatter=fmodule._output_formatter
)
return FreeModuleTensor._new_comp(self, basis)