Physlib Documentation

Physlib.Relativity.Tensors.Elab

Elaboration of tensor expressions #

Examples #

Comments #

Indices #

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    A syntax category for indices of tensor expressions.

    Equations
    Instances For

      A basic index is a ident.

      Equations
      Instances For

        An index can be a num, which will be used to evaluate the tensor.

        Equations
        Instances For

          Notation to describe the jiggle of a tensor index.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Notation to describe the evaluation of a tensor index.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Bool which is true if an index is a num.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For

                Bool which is true if an index is evaluated bracket [μ].

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  If an index is a num - the underlying natural number.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For

                    When an index is not a num, the corresponding ident.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Takes a pair a b : ℕ × TSyntax `indexExpr. If a.1 < b.1 and a.2 = b.2 then outputs some (a.1, b.1), otherwise none.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Bool which is true if an index is of the form τ(i) that is, to be dualed.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For

                          Manipulation of lists of indexExpr #

                          Adjusts a list List by subtracting from each natural number the number of elements before it in the list which are less than itself. This is used to form a list of pairs which can be used for evaluating indices.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            For list of indexExpr e.g. [α, 3, β, 2, γ], getEvalPos returns a list of pairs ℕ × ℕ related to indices which are numbers. The second element of each pair is the number corresponding to that index. The first element is the position of that number in the list of indices when all other numbered indices before it are removed. Thus for the example given getEvalPos outputs [(1, 3), (2, 2)].

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              For list of indexExpr e.g. [α, 3, β, 2, [γ]], getEvalPos returns a list of pairs ℕ × Term related to indices which are evaluated e.g. [μ]. The second element of each pair is the value corresponding to that index. The first element is the position of that number in the list of indices when all other numbered indices before it are removed. Thus for the example given getEvalBracketPos outputs [(4, γ)].

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                For list of indexExpr e.g. [α, 3, β, α, 2, γ], getContrPos first removes all indices which are numbers (e.g. [α, β, α, γ]). It then outputs pairs (a, b) in ℕ × ℕ of positions of this list with a < b such that the index at a is equal to the index at b. It checks whether or not an element is contracted more then once.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For

                                  The list of indices after contraction or evaluation.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For

                                    Takes a list and puts consecutive elements into pairs. e.g. [0, 1, 2, 3] becomes [(0, 1), (2, 3)].

                                    Equations
                                    Instances For

                                      Adjusts a list List (ℕ × ℕ) by subtracting from each natural number the number of elements before it in the list which are less than itself. This is used to form a list of pairs which can be used for contracting indices.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For

                                        Permutations of indices #

                                        Given two lists of indices, all of which are indent, returns the List (ℕ) representing the how one list permutes into the other.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For

                                          The construction of an expression corresponding to the type of a given string once parsed.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For

                                            Given two lists of indices returns the permutation between them based on finMapToEquiv.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For

                                              Syntax for tensor expressions. #

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For

                                                A syntax category for tensor expressions.

                                                Equations
                                                Instances For

                                                  The syntax for a tensor node.

                                                  Equations
                                                  • One or more equations did not get rendered due to their size.
                                                  Instances For

                                                    Equality.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For

                                                      The syntax for tensor prod two tensor nodes.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For

                                                        The syntax for tensor addition.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For

                                                          Allowing brackets to be used in a tensor expression.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For

                                                            Scalar multiplication for tensors.

                                                            Equations
                                                            • One or more equations did not get rendered due to their size.
                                                            Instances For

                                                              group action for tensors.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For

                                                                Negation of a tensor tree.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For

                                                                  Syntax of tensor expressions to indices. #

                                                                  For syntax of the form T where T is S.F.obj (OverColor.mk c) this returns the value of TensorSpecies.numIndices T. That is, the exact number of indices associated with that tensor.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For

                                                                    For syntax of the form T | α β 2 β, getAllIndices returns a list [α, β, 2, β] of all indexExpr.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For

                                                                      The function getProdIndices is defined for the following syntax:

                                                                      1. For e.g. T | α β 2 β, it returns all uncontracted and unevaluated indices e.g.[α]
                                                                      2. For e.g. T1 | α β 2 β ⊗ T2 | α γ δ δ it returns all unevaluated indices which are not contracted in either tensor e.g. [α, α, γ].
                                                                      3. For e.g. (T1 | α β 2 β ⊗ T2 | α γ δ δ) ⊗ T3 | γ it does 2 recursively e.g. [γ, γ]

                                                                      Returns the remaining indices of a tensor expression after contraction and evaluation. Thus every index in the output of getIndicesFull is ident and there are no duplicates. Examples are:

                                                                      1. T | α β 2 β gives [α]
                                                                      2. T1 | α β 2 β ⊗ T2 | α γ δ δ gives [γ]
                                                                      3. (T1 | α β 2 β ⊗ T2 | α γ δ δ) ⊗ T3 | γ gives []
                                                                      4. T1 | α β 2 β + T2 | α 4 δ δ gives [α]

                                                                      Gets the indices associated with the LHS of an addition.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For

                                                                        Gets the indices associated with the RHS of an addition.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For

                                                                          Gets the indices associated with the LHS of an equality.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For

                                                                            Gets the indices associated with the RHS of an equality.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For

                                                                              Modifying terms to tensor trees #

                                                                              For a term of the form T where T is S.F.obj (OverColor.mk c), tensorTermToTensorTree returns the term corresponding to the tensorNode T

                                                                              Equations
                                                                              Instances For

                                                                                Given a list l of pairs ℕ × ℕ and a term T corresponding to a tensor tree, for each (a, b) in l, evalSyntax applies TensorTree.eval a b to T recursively. Here a is the position of the index to be evaluated and b is the value it is evaluated to.

                                                                                For example, if l is [(1, 2), (1, 4)] and T is a tensor tree then evalSyntax l T is TensorTree.eval 1 4 (TensorTree.eval 1 2 T).

                                                                                The list l is expected to be the output of getEvalPos.

                                                                                Equations
                                                                                • One or more equations did not get rendered due to their size.
                                                                                Instances For

                                                                                  Given a list l of pairs ℕ × Term and a term T corresponding to a tensor tree, for each (a, b) in l, evalSyntax applies TensorTree.eval a b to T recursively. Here a is the position of the index to be evaluated and b is the value it is evaluated to from the [μ] syntax.

                                                                                  For example, if l is [(1, μ), (1, ν)] and T is a tensor tree then evalSyntax l T is TensorTree.eval 1 ν (TensorTree.eval 1 μ T).

                                                                                  The list l is expected to be the output of getEvalBracketPos.

                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For

                                                                                    For each element of l : List (ℕ × ℕ) applies TensorTree.contr to the given term.

                                                                                    Equations
                                                                                    • One or more equations did not get rendered due to their size.
                                                                                    Instances For

                                                                                      The syntax associated with a product of tensors.

                                                                                      Equations
                                                                                      Instances For

                                                                                        The syntax associated with negation of tensors.

                                                                                        Equations
                                                                                        Instances For

                                                                                          The syntax associated with the scalar multiplication of tensors.

                                                                                          Equations
                                                                                          Instances For

                                                                                            The syntax associated with the group action of tensors.

                                                                                            Equations
                                                                                            Instances For

                                                                                              The syntax for a equality of tensor trees.

                                                                                              Equations
                                                                                              • One or more equations did not get rendered due to their size.
                                                                                              Instances For

                                                                                                The syntax for a equality of tensor trees.

                                                                                                Equations
                                                                                                • One or more equations did not get rendered due to their size.
                                                                                                Instances For

                                                                                                  Syntax to tensor tree #

                                                                                                  Takes a syntax corresponding to a tensor expression and turns it into a term corresponding to a tensor tree.

                                                                                                  Elaboration #

                                                                                                  Takes a syntax corresponding to a tensor expression and turns it into an expression corresponding to a tensor tree.

                                                                                                  Equations
                                                                                                  Instances For

                                                                                                    The tensor tree corresponding to a tensor expression.

                                                                                                    Equations
                                                                                                    • One or more equations did not get rendered due to their size.
                                                                                                    Instances For

                                                                                                      Test cases #