Differences

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

Link to this comparison view

documentation:ref:indextype [2015/11/21 12:33]
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:
 +<sxh groovy; gutter: false>
 +println IndexType.values()
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > [LatinLower,​ LatinUpper, GreekLower, GreekUpper, Matrix1, Matrix2, ​
 +      Matrix3, Matrix4]
 +</​sxh>​
 +
 +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:
 +<sxh groovy; gutter: false>
 +//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
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > X + Y
 +</​sxh>​
 +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:
 +<sxh groovy; gutter: false>
 +def indices = '''​_{a}^{A \\alpha}_{a'​} '''​.si
 +println indices.collect { [[type: it.type, metric: it.type.isMetric()]] }
 +</​sxh>​
 +<sxh plain; gutter: false>
 +   > [[[type:​LatinLower,​ metric:​true]],​ [[type:​LatinUpper,​ metric:​true]], ​
 +        [[type:​GreekLower,​ metric:​true]],​ [[type:​Matrix1,​ metric:​false]]]
 +</​sxh>​
 +====Available types====
 +The possible values of ''​IndexType''​ are:
 +<​html>​
 +<​center>​
 +<table style="​width:​600px;"​ cellpadding="​10">​
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​b>​IndexType</​b></​td>​
 +  <td valign="​top"​ align="​center"​ style="​padding:​ 15px; border: 1px solid gray;"><​b>​Description</​b></​td> ​
 +</tr>
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​LatinLower</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Latin lower case indices from <​code>​a</​code>​ to <​code>​z</​code>​ and subscripted like <​code>​a_{12}</​code>​ etc. </​td> ​
 +</tr>
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​LatinUpper</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Latin upper case indices from <​code>​A</​code>​ to <​code>​Z</​code>​ and subscripted like <​code>​X_{12}</​code>​ etc. </​td> ​
 +</tr>
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​GreekLower</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Greek lower case indices like <​code>​\\alpha</​code>,​ <​code>​\\theta</​code>​ and subscripted like <​code>​\\rho_{123}</​code>​ etc. </​td> ​
 +  <tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​GreekUpper</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Greek upper case indices like <​code>​\\Lambda</​code>,​ <​code>​\\Theta</​code>​ and subscripted like <​code>​\\Psi_{123}</​code>​ etc. Note, that some letters are excluded since they have same UTF8 representation as Latin letters (e.g. capital alpha to beta). </​td> ​
 +</tr>
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​Matrix1</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Latin lower case indices with strokes from <​code>​a'</​code>​ to <​code>​z'</​code>​ and subscripted like <​code>​a'​_{12}</​code>​ etc. </​td> ​
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​Matrix2</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Latin upper case indices with strokes like <​code>​A'</​code>​ or <​code>​ E'​_{12}</​code>​. </​td> ​
 +</tr>
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​Matrix3</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Greek lower case indices with strokes like <​code>​\\alpha'</​code>​ or <​code>​\\theta'​_{12}</​code>​. </​td> ​
 +</tr>
 +<tr>
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;"><​code>​Matrix4</​code></​td>​
 +  <td valign="​top"​ style="​padding:​ 15px; border: 1px solid gray;">​Greek upper case indices with strokes like <​code>​\\Lambda'</​code>​ or <​code>​\\Psi'​_{12}</​code>​. </​td> ​
 +</tr>
 +</tr>
 +</​table>​
 +</​center>​
 +</​html>​
 +
 +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]]