# Differences

This shows you the differences between two versions of the page.

 — documentation:ref:indextype [2015/11/21 12:33] (current) Line 1: Line 1: + ====== IndexType ====== + ---- + + ====Description==== + ''​IndexType''​ represents a type of a single index. It encodes mathematical nature of indices with different types (e.g. Lorentz, SU(N) etc.). ​ One can print all available index types as follows: + + println IndexType.values() + ​ + + > [LatinLower,​ LatinUpper, GreekLower, GreekUpper, Matrix1, Matrix2, ​ + Matrix3, Matrix4] + ​ + + If two indices have different types, then they have different mathematical nature. Thus, for example, two tensors ''​f_ab''​ and ''​f_AB''​ have different mathematical nature and one can not rename indices of tensor ''​f_ab''​ to ''​_AB''​. This, in turn, enables us to associate different space dimensions with different index types: + + //dimension for Latin lower case indices + def dimLower = 'd^a_a = X'.t + //dimension for Latin upper case indices + def dimUpper = 'd^A_A = Y'.t + //​expression contains both lower and upper case indices + def t = '​g_ab*g^ab + g_AB*g^AB'​.t + t = (EliminateMetrics & dimLower & dimUpper) >> t + println t + ​ + + > X + Y + ​ + By default, all types except ''​Matrix''​ are  metric, and a corresponding [[documentation:​ref:​metric_tensor|metric tensor]] is set up (''​g_ab''​ for ''​LatinLower'',​ ''​g_\\alpha\\beta''​ for Greek lower etc.). + + + In order to obtain ''​IndexType''​ of a particular index one can use ''​.type''​ property; in order to check whether ''​IndexType''​ is metric, one can use ''​isMetric()''​ method: + + def indices = '''​_{a}^{A \\alpha}_{a'​} '''​.si + println indices.collect { [[type: it.type, metric: it.type.isMetric()]] } + ​ + + > [[[type:​LatinLower,​ metric:​true]],​ [[type:​LatinUpper,​ metric:​true]], ​ + [[type:​GreekLower,​ metric:​true]],​ [[type:​Matrix1,​ metric:​false]]] + ​ + ====Available types==== + The possible values of ''​IndexType''​ are: + <​html>​ + <​center>​ + ​ +
<​b>​IndexType​ + <​b>​Description ​ +
<​code>​LatinLower​ + ​Latin lower case indices from <​code>​a​ to <​code>​z​ and subscripted like <​code>​a_{12}​ etc.  ​ +
<​code>​LatinUpper​ + ​Latin upper case indices from <​code>​A​ to <​code>​Z​ and subscripted like <​code>​X_{12}​ etc.  ​ +
<​code>​GreekLower​ + ​Greek lower case indices like <​code>​\\alpha,​ <​code>​\\theta​ and subscripted like <​code>​\\rho_{123}​ etc.  ​ +
<​code>​GreekUpper​ + ​Greek upper case indices like <​code>​\\Lambda,​ <​code>​\\Theta​ and subscripted like <​code>​\\Psi_{123}​ etc. Note, that some letters are excluded since they have same UTF8 representation as Latin letters (e.g. capital alpha to beta).  ​ +
<​code>​Matrix1​ + ​Latin lower case indices with strokes from <​code>​a'​ to <​code>​z'​ and subscripted like <​code>​a'​_{12}​ etc.  ​ +
<​code>​Matrix2​ + ​Latin upper case indices with strokes like <​code>​A'​ or <​code>​ E'​_{12}​.  ​ +
<​code>​Matrix3​ + ​Greek lower case indices with strokes like <​code>​\\alpha'​ or <​code>​\\theta'​_{12}​.  ​ +
<​code>​Matrix4​ + ​Greek upper case indices with strokes like <​code>​\\Lambda'​ or <​code>​\\Psi'​_{12}​.  ​ +
+ + + + + + + + + + + + + + + + + ​ + ​ + ​ + + By default all ''​Matrix''​ index types are used for [[documentation:​guide:​setting_up_matrix_objects|matrix indices]] and there is no metric specified for indices of ''​Matrix''​ types. ​ + + =====See also===== + * Related guides: [[documentation:​guide:​tensors_and_indices]] + * Reference material: [[documentation:​ref:​indices]],​ [[documentation:​ref:​simpletensor]],​ [[documentation:​ref:​simpleindices]],​ [[documentation:​ref:​metric_tensor]] + * JavaDocs: [[http://​api.redberry.cc/​redberry/​1.1.9/​java-api/​cc/​redberry/​core/​indices/​IndexType.html| IndexType]] + * Source code: [[https://​bitbucket.org/​redberry/​redberry/​src/​tip/​core/​src/​main/​java/​cc/​redberry/​core/​indices/​IndexType.java|IndexType.java]]