{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
module Math.Tensor.Examples.Gravity (
delta3, delta9, delta20,
delta3A,
eta, invEta, etaA, invEtaA, etaAbs,
epsilon, epsilonInv, epsilonA, epsilonInvA,
lorentzJ1, lorentzJ2, lorentzJ3, lorentzK1, lorentzK2, lorentzK3,
flatArea,
interI2, interJ2,
interIArea, interJArea,
interArea, interMetric,
flatInterMetric, flatInter,
interEqn2, interEqn3, interEqn4, interEqn5,
interEqn2Metric, interEqn3Metric, interEqn4Metric, interEqn5Metric,
randArea, randFlatArea, randAreaDerivative1, randAreaDerivative2, randMetric, randAxon,
generic4Ansatz, generic5Ansatz, generic6Ansatz,
generic8Ansatz, generic9Ansatz, generic10_1Ansatz, generic10_2Ansatz, generic11Ansatz, generic12_1Ansatz,
) where
import System.Random.TF.Instances (randomRs)
import System.Random.TF.Init (newTFGen)
import qualified Data.Map.Strict as M
import qualified Data.IntMap.Strict as I
import Data.List (permutations, nub, sort)
import Math.Tensor
liftSTtoATens :: STTens n1 n2 v -> ATens 0 0 0 0 n1 n2 v
liftSTtoATens :: STTens n1 n2 v -> ATens 0 0 0 0 n1 n2 v
liftSTtoATens = Tensor 0 Ind20 (Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v)))
-> ATens 0 0 0 0 n1 n2 v
forall v k. v -> Tensor 0 k v
Scalar (Tensor 0 Ind20 (Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v)))
-> ATens 0 0 0 0 n1 n2 v)
-> (STTens n1 n2 v
-> Tensor 0 Ind20 (Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v))))
-> STTens n1 n2 v
-> ATens 0 0 0 0 n1 n2 v
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v))
-> Tensor 0 Ind20 (Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v)))
forall v k. v -> Tensor 0 k v
Scalar (Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v))
-> Tensor 0 Ind20 (Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v))))
-> (STTens n1 n2 v
-> Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v)))
-> STTens n1 n2 v
-> Tensor 0 Ind20 (Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Tensor 0 Ind9 (STTens n1 n2 v)
-> Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v))
forall v k. v -> Tensor 0 k v
Scalar (Tensor 0 Ind9 (STTens n1 n2 v)
-> Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v)))
-> (STTens n1 n2 v -> Tensor 0 Ind9 (STTens n1 n2 v))
-> STTens n1 n2 v
-> Tensor 0 Ind9 (Tensor 0 Ind9 (STTens n1 n2 v))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. STTens n1 n2 v -> Tensor 0 Ind9 (STTens n1 n2 v)
forall v k. v -> Tensor 0 k v
Scalar
delta3 :: STTens 1 1 (SField Rational)
delta3 :: STTens 1 1 (SField Rational)
delta3 = [(IndTuple2 1 1 Ind3, SField Rational)]
-> STTens 1 1 (SField Rational)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 ([(IndTuple2 1 1 Ind3, SField Rational)]
-> STTens 1 1 (SField Rational))
-> [(IndTuple2 1 1 Ind3, SField Rational)]
-> STTens 1 1 (SField Rational)
forall a b. (a -> b) -> a -> b
$ [IndTuple2 1 1 Ind3]
-> [SField Rational] -> [(IndTuple2 1 1 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [(Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 Int
i),Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 Int
i)) | Int
i <- [Int
0..Int
3]] (SField Rational -> [SField Rational]
forall a. a -> [a]
repeat (SField Rational -> [SField Rational])
-> SField Rational -> [SField Rational]
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1)
delta3A :: ATens 0 0 0 0 1 1 (SField Rational)
delta3A :: ATens 0 0 0 0 1 1 (SField Rational)
delta3A = STTens 1 1 (SField Rational) -> ATens 0 0 0 0 1 1 (SField Rational)
forall (n1 :: Nat) (n2 :: Nat) v.
STTens n1 n2 v -> ATens 0 0 0 0 n1 n2 v
liftSTtoATens STTens 1 1 (SField Rational)
delta3
delta9 :: ATens 0 0 1 1 0 0 (SField Rational)
delta9 :: ATens 0 0 1 1 0 0 (SField Rational)
delta9 = [(IndTuple6 0 0 1 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 1 1 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 0 1 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 1 1 0 0 (SField Rational))
-> [(IndTuple6 0 0 1 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 1 1 0 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ [IndTuple6 0 0 1 1 0 0 Ind20 Ind9 Ind3]
-> [SField Rational]
-> [(IndTuple6 0 0 1 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [(IndList 0 Ind20
forall a. IndList 0 a
Empty, IndList 0 Ind20
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Int -> Ind9
Ind9 Int
i),Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Int -> Ind9
Ind9 Int
i), IndList 0 Ind3
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty) | Int
i <- [Int
0..Int
9]] (SField Rational -> [SField Rational]
forall a. a -> [a]
repeat (SField Rational -> [SField Rational])
-> SField Rational -> [SField Rational]
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1)
delta20 :: ATens 1 1 0 0 0 0 (SField Rational)
delta20 :: ATens 1 1 0 0 0 0 (SField Rational)
delta20 = [(IndTuple6 1 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 1 1 0 0 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 1 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 1 1 0 0 0 0 (SField Rational))
-> [(IndTuple6 1 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 1 1 0 0 0 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ [IndTuple6 1 1 0 0 0 0 Ind20 Ind9 Ind3]
-> [SField Rational]
-> [(IndTuple6 1 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [(Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 Int
i),Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 Int
i), IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty) | Int
i <- [Int
0..Int
20]] (SField Rational -> [SField Rational]
forall a. a -> [a]
repeat (SField Rational -> [SField Rational])
-> SField Rational -> [SField Rational]
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1)
eta :: STTens 0 2 (SField Rational)
eta :: STTens 0 2 (SField Rational)
eta = [(IndTuple2 0 2 Ind3, SField Rational)]
-> STTens 0 2 (SField Rational)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [(IndTuple2 0 2 Ind3, SField Rational)]
forall a. [((IndList 0 a, IndList 2 Ind3), SField Rational)]
l
where
l :: [((IndList 0 a, IndList 2 Ind3), SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 0 a, IndList 2 Ind3), SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 0 a, IndList 2 Ind3), SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((IndList 0 a
forall a. IndList 0 a
Empty,Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
x) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (1 - 1) Ind3 -> IndList 1 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
y) IndList (1 - 1) Ind3
forall a. IndList 0 a
Empty),Rational -> SField Rational
forall a. a -> SField a
SField Rational
z))
[(Int
0,Int
0,-Rational
1),(Int
1,Int
1,Rational
1),(Int
2,Int
2,Rational
1),(Int
3,Int
3,Rational
1)]
etaA :: ATens 0 0 0 0 0 2 (SField Rational)
etaA :: ATens 0 0 0 0 0 2 (SField Rational)
etaA = STTens 0 2 (SField Rational) -> ATens 0 0 0 0 0 2 (SField Rational)
forall (n1 :: Nat) (n2 :: Nat) v.
STTens n1 n2 v -> ATens 0 0 0 0 n1 n2 v
liftSTtoATens STTens 0 2 (SField Rational)
eta
invEta :: STTens 2 0 (SField Rational)
invEta :: STTens 2 0 (SField Rational)
invEta = [(IndTuple2 2 0 Ind3, SField Rational)]
-> STTens 2 0 (SField Rational)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [(IndTuple2 2 0 Ind3, SField Rational)]
forall a. [((IndList 2 Ind3, IndList 0 a), SField Rational)]
l
where
l :: [((IndList 2 Ind3, IndList 0 a), SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 2 Ind3, IndList 0 a), SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 2 Ind3, IndList 0 a), SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
x) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (1 - 1) Ind3 -> IndList 1 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
y) IndList (1 - 1) Ind3
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty),Rational -> SField Rational
forall a. a -> SField a
SField Rational
z))
[(Int
0,Int
0,-Rational
1),(Int
1,Int
1,Rational
1),(Int
2,Int
2,Rational
1),(Int
3,Int
3,Rational
1)]
invEtaA :: ATens 0 0 0 0 2 0 (SField Rational)
invEtaA :: ATens 0 0 0 0 2 0 (SField Rational)
invEtaA = STTens 2 0 (SField Rational) -> ATens 0 0 0 0 2 0 (SField Rational)
forall (n1 :: Nat) (n2 :: Nat) v.
STTens n1 n2 v -> ATens 0 0 0 0 n1 n2 v
liftSTtoATens STTens 2 0 (SField Rational)
invEta
etaAbs :: ATens 0 0 0 1 0 0 (SField Rational)
etaAbs :: ATens 0 0 0 1 0 0 (SField Rational)
etaAbs = [(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 1 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a a a a a.
[((IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a),
SField Rational)]
l
where
l :: [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a),
SField Rational)]
l = ((Int, Rational)
-> ((IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a),
SField Rational))
-> [(Int, Rational)]
-> [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a),
SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Rational
y) -> ((IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Ind9 -> IndList 1 Ind9) -> Ind9 -> IndList 1 Ind9
forall a b. (a -> b) -> a -> b
$ Int -> Ind9
Ind9 Int
x, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty),Rational -> SField Rational
forall a. a -> SField a
SField Rational
y))
[(Int
0,-Rational
1),(Int
4,Rational
1),(Int
7,Rational
1),(Int
9,Rational
1)]
epsilon :: STTens 0 4 (SField Rational)
epsilon :: STTens 0 4 (SField Rational)
epsilon = [(IndTuple2 0 4 Ind3, SField Rational)]
-> STTens 0 4 (SField Rational)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [(IndTuple2 0 4 Ind3, SField Rational)]
ls
where
ls :: [(IndTuple2 0 4 Ind3, SField Rational)]
ls = (([Int], Rational) -> (IndTuple2 0 4 Ind3, SField Rational))
-> [([Int], Rational)] -> [(IndTuple2 0 4 Ind3, SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int
i,Int
j,Int
k,Int
l],Rational
v) -> ((IndList 0 Ind3
forall a. IndList 0 a
Empty, Ind3 -> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
i) (IndList (4 - 1) Ind3 -> IndList 4 Ind3)
-> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
j) (IndList (3 - 1) Ind3 -> IndList 3 Ind3)
-> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
k) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 Int
l)),Rational -> SField Rational
forall a. a -> SField a
SField Rational
v)) [([Int], Rational)]
epsL
epsSign :: a -> a -> a -> a -> a
epsSign a
i a
j a
k a
l = (-a
1) a -> Int -> a
forall a b. (Num a, Integral b) => a -> b -> a
^ [Bool] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length ((Bool -> Bool) -> [Bool] -> [Bool]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool -> Bool
forall a. Eq a => a -> a -> Bool
==Bool
True) [a
ja -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
i,a
ka -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
i,a
la -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
i,a
ka -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
j,a
la -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
j,a
la -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
k])
epsL :: [([Int], Rational)]
epsL = ([Int] -> ([Int], Rational)) -> [[Int]] -> [([Int], Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\x :: [Int]
x@[Int
i,Int
j,Int
k,Int
l] -> ([Int]
x, Int -> Int -> Int -> Int -> Rational
forall a a. (Num a, Ord a) => a -> a -> a -> a -> a
epsSign Int
i Int
j Int
k Int
l)) ([[Int]] -> [([Int], Rational)]) -> [[Int]] -> [([Int], Rational)]
forall a b. (a -> b) -> a -> b
$ [Int] -> [[Int]]
forall a. [a] -> [[a]]
permutations [Int
0,Int
1,Int
2,Int
3]
epsilonA :: ATens 0 0 0 0 0 4 (SField Rational)
epsilonA :: ATens 0 0 0 0 0 4 (SField Rational)
epsilonA = STTens 0 4 (SField Rational) -> ATens 0 0 0 0 0 4 (SField Rational)
forall (n1 :: Nat) (n2 :: Nat) v.
STTens n1 n2 v -> ATens 0 0 0 0 n1 n2 v
liftSTtoATens STTens 0 4 (SField Rational)
epsilon
epsilonInv :: STTens 4 0 (SField Rational)
epsilonInv :: STTens 4 0 (SField Rational)
epsilonInv = [(IndTuple2 4 0 Ind3, SField Rational)]
-> STTens 4 0 (SField Rational)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
[(IndTuple2 n1 n2 k1, v)] -> AbsTensor2 n1 n2 k1 v
fromListT2 [(IndTuple2 4 0 Ind3, SField Rational)]
ls
where
ls :: [(IndTuple2 4 0 Ind3, SField Rational)]
ls = (([Int], Rational) -> (IndTuple2 4 0 Ind3, SField Rational))
-> [([Int], Rational)] -> [(IndTuple2 4 0 Ind3, SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\([Int
i,Int
j,Int
k,Int
l],Rational
v) -> ((Ind3 -> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
i) (IndList (4 - 1) Ind3 -> IndList 4 Ind3)
-> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
j) (IndList (3 - 1) Ind3 -> IndList 3 Ind3)
-> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
k) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 Int
l), IndList 0 Ind3
forall a. IndList 0 a
Empty),Rational -> SField Rational
forall a. a -> SField a
SField Rational
v)) [([Int], Rational)]
epsL
epsSign :: a -> a -> a -> a -> a
epsSign a
i a
j a
k a
l = (-a
1) a -> Int -> a
forall a b. (Num a, Integral b) => a -> b -> a
^ [Bool] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length ((Bool -> Bool) -> [Bool] -> [Bool]
forall a. (a -> Bool) -> [a] -> [a]
filter (Bool -> Bool -> Bool
forall a. Eq a => a -> a -> Bool
==Bool
True) [a
ja -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
i,a
ka -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
i,a
la -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
i,a
ka -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
j,a
la -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
j,a
la -> a -> Bool
forall a. Ord a => a -> a -> Bool
>a
k])
epsL :: [([Int], Rational)]
epsL = ([Int] -> ([Int], Rational)) -> [[Int]] -> [([Int], Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\x :: [Int]
x@[Int
i,Int
j,Int
k,Int
l] -> ([Int]
x, Int -> Int -> Int -> Int -> Rational
forall a a. (Num a, Ord a) => a -> a -> a -> a -> a
epsSign Int
i Int
j Int
k Int
l)) ([[Int]] -> [([Int], Rational)]) -> [[Int]] -> [([Int], Rational)]
forall a b. (a -> b) -> a -> b
$ [Int] -> [[Int]]
forall a. [a] -> [[a]]
permutations [Int
0,Int
1,Int
2,Int
3]
epsilonInvA :: ATens 0 0 0 0 4 0 (SField Rational)
epsilonInvA :: ATens 0 0 0 0 4 0 (SField Rational)
epsilonInvA = STTens 4 0 (SField Rational) -> ATens 0 0 0 0 4 0 (SField Rational)
forall (n1 :: Nat) (n2 :: Nat) v.
STTens n1 n2 v -> ATens 0 0 0 0 n1 n2 v
liftSTtoATens STTens 4 0 (SField Rational)
epsilonInv
lorentzJ1 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzJ1 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzJ1 = [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 0 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
forall a a a a.
[((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l
where
l :: [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
x,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
y), Rational -> SField Rational
forall a. a -> SField a
SField Rational
z)) [(Int
3,Int
2,Rational
1),(Int
2,Int
3,-Rational
1)]
lorentzJ2 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzJ2 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzJ2 = [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 0 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
forall a a a a.
[((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l
where
l :: [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
x,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
y), Rational -> SField Rational
forall a. a -> SField a
SField Rational
z)) [(Int
3,Int
1,-Rational
1),(Int
1,Int
3,Rational
1)]
lorentzJ3 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzJ3 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzJ3 = [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 0 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
forall a a a a.
[((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l
where
l :: [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
x,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
y), Rational -> SField Rational
forall a. a -> SField a
SField Rational
z)) [(Int
2,Int
1,Rational
1),(Int
1,Int
2,-Rational
1)]
lorentzK1 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzK1 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzK1 = [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 0 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
forall a a a a.
[((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l
where
l :: [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
x,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
y), Rational -> SField Rational
forall a. a -> SField a
SField Rational
z)) [(Int
0,Int
1,Rational
1),(Int
1,Int
0,Rational
1)]
lorentzK2 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzK2 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzK2 = [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 0 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
forall a a a a.
[((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l
where
l :: [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
x,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
y), Rational -> SField Rational
forall a. a -> SField a
SField Rational
z)) [(Int
0,Int
2,Rational
1),(Int
2,Int
0,Rational
1)]
lorentzK3 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzK3 :: ATens 0 0 0 0 1 1 (SField Rational)
lorentzK3 = [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 0 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 0 0 0 1 1 Ind20 Ind9 Ind3, SField Rational)]
forall a a a a.
[((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l
where
l :: [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
l = ((Int, Int, Rational)
-> ((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational))
-> [(Int, Int, Rational)]
-> [((IndList 0 a, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 1 Ind3),
SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
x,Int
y,Rational
z) -> ((IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,IndList 0 a
forall a. IndList 0 a
Empty,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
x,Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
y), Rational -> SField Rational
forall a. a -> SField a
SField Rational
z)) [(Int
0,Int
3,Rational
1),(Int
3,Int
0,Rational
1)]
flatArea :: ATens 0 1 0 0 0 0 (SField Rational)
flatArea :: ATens 0 1 0 0 0 0 (SField Rational)
flatArea = [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational))
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ((Int, Rational)
-> (IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational))
-> [(Int, Rational)]
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
i,Rational
v) -> ( (IndList 0 Ind20
forall a. IndList 0 a
Empty, Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20) -> Ind20 -> IndList 1 Ind20
forall a b. (a -> b) -> a -> b
$ Int -> Ind20
Ind20 Int
i, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty), Rational -> SField Rational
forall a. a -> SField a
SField Rational
v))
[(Int
0,-Rational
1),(Int
5,-Rational
1),(Int
6,-Rational
1),(Int
9,Rational
1),(Int
11,-Rational
1),(Int
12,-Rational
1),(Int
15,Rational
1),(Int
18,Rational
1),(Int
20,Rational
1)]
trianMap2 :: M.Map (IndList 2 Ind3) (IndList 1 Ind9)
trianMap2 :: Map (IndList 2 Ind3) (IndList 1 Ind9)
trianMap2 = [(IndList 2 Ind3, IndList 1 Ind9)]
-> Map (IndList 2 Ind3) (IndList 1 Ind9)
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([(IndList 2 Ind3, IndList 1 Ind9)]
-> Map (IndList 2 Ind3) (IndList 1 Ind9))
-> [(IndList 2 Ind3, IndList 1 Ind9)]
-> Map (IndList 2 Ind3) (IndList 1 Ind9)
forall a b. (a -> b) -> a -> b
$ [IndList 2 Ind3]
-> [IndList 1 Ind9] -> [(IndList 2 Ind3, IndList 1 Ind9)]
forall a b. [a] -> [b] -> [(a, b)]
zip [ Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
a) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
b | Int
a <- [Int
0..Int
3], Int
b <- [Int
a..Int
3] ] ([IndList 1 Ind9] -> [(IndList 2 Ind3, IndList 1 Ind9)])
-> [IndList 1 Ind9] -> [(IndList 2 Ind3, IndList 1 Ind9)]
forall a b. (a -> b) -> a -> b
$ (Int -> IndList 1 Ind9) -> [Int] -> [IndList 1 Ind9]
forall a b. (a -> b) -> [a] -> [b]
map (Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Ind9 -> IndList 1 Ind9) -> (Int -> Ind9) -> Int -> IndList 1 Ind9
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Ind9
Ind9) [Int
0..]
trianMapArea :: M.Map (IndList 4 Ind3) (IndList 1 Ind20)
trianMapArea :: Map (IndList 4 Ind3) (IndList 1 Ind20)
trianMapArea = [(IndList 4 Ind3, IndList 1 Ind20)]
-> Map (IndList 4 Ind3) (IndList 1 Ind20)
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([(IndList 4 Ind3, IndList 1 Ind20)]
-> Map (IndList 4 Ind3) (IndList 1 Ind20))
-> [(IndList 4 Ind3, IndList 1 Ind20)]
-> Map (IndList 4 Ind3) (IndList 1 Ind20)
forall a b. (a -> b) -> a -> b
$ [IndList 4 Ind3]
-> [IndList 1 Ind20] -> [(IndList 4 Ind3, IndList 1 Ind20)]
forall a b. [a] -> [b] -> [(a, b)]
zip [ Ind3 -> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
a) (IndList (4 - 1) Ind3 -> IndList 4 Ind3)
-> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
b) (IndList (3 - 1) Ind3 -> IndList 3 Ind3)
-> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
c) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
d | Int
a <- [Int
0..Int
2], Int
b <- [Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
+Int
1..Int
3], Int
c <- [Int
a..Int
2], Int
d <- [Int
cInt -> Int -> Int
forall a. Num a => a -> a -> a
+Int
1..Int
3], Bool -> Bool
not (Bool -> Bool) -> Bool -> Bool
forall a b. (a -> b) -> a -> b
$ Int
a Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
c Bool -> Bool -> Bool
&& Int
b Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
> Int
d ] ([IndList 1 Ind20] -> [(IndList 4 Ind3, IndList 1 Ind20)])
-> [IndList 1 Ind20] -> [(IndList 4 Ind3, IndList 1 Ind20)]
forall a b. (a -> b) -> a -> b
$ (Int -> IndList 1 Ind20) -> [Int] -> [IndList 1 Ind20]
forall a b. (a -> b) -> [a] -> [b]
map (Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20)
-> (Int -> Ind20) -> Int -> IndList 1 Ind20
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Ind20
Ind20) [Int
0..]
jMult2 :: (Eq a) => IndList 2 a -> Rational
jMult2 :: IndList 2 a -> Rational
jMult2 (Append a
a (Append a
b IndList ((2 - 1) - 1) a
Empty))
| a
a a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
b = Rational
1
| Bool
otherwise = Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
2
_jMult3 :: (Eq a) => IndList 3 a -> Rational
_jMult3 :: IndList 3 a -> Rational
_jMult3 (Append a
a (Append a
b (Append a
c IndList (((3 - 1) - 1) - 1) a
Empty)))
| Int
i Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
1 = Rational
1
| Int
i Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
2 = Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
3
| Bool
otherwise = Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
6
where
i :: Int
i = [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length ([a] -> Int) -> [a] -> Int
forall a b. (a -> b) -> a -> b
$ [a] -> [a]
forall a. Eq a => [a] -> [a]
nub [a
a,a
b,a
c]
jMultArea :: (Eq a) => IndList 4 a -> Rational
jMultArea :: IndList 4 a -> Rational
jMultArea (Append a
a (Append a
b (Append a
c (Append a
d IndList ((((4 - 1) - 1) - 1) - 1) a
Empty))))
| a
a a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
c Bool -> Bool -> Bool
&& a
b a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
d = Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
4
| Bool
otherwise = Rational
1Rational -> Rational -> Rational
forall a. Fractional a => a -> a -> a
/Rational
8
_isZeroArea :: (Eq a) => IndList 4 a -> Bool
_isZeroArea :: IndList 4 a -> Bool
_isZeroArea (Append a
a (Append a
b (Append a
c (Append a
d IndList ((((4 - 1) - 1) - 1) - 1) a
Empty)))) = a
a a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
b Bool -> Bool -> Bool
|| a
c a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
d
areaSign :: (Eq a, Ord a) => IndList 4 a -> Rational
areaSign :: IndList 4 a -> Rational
areaSign (Append a
a (Append a
b (Append a
c (Append a
d IndList ((((4 - 1) - 1) - 1) - 1) a
Empty)))) = Rational
s1 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* Rational
s2
where
s1 :: Rational
s1 = a -> a -> Rational
forall a p. (Ord a, Num p) => a -> a -> p
pairSign a
a a
b
s2 :: Rational
s2 = a -> a -> Rational
forall a p. (Ord a, Num p) => a -> a -> p
pairSign a
c a
d
pairSign :: a -> a -> p
pairSign a
x a
y = if a
x a -> a -> Bool
forall a. Ord a => a -> a -> Bool
< a
y then p
1 else -p
1
canonicalizeArea :: (Eq a, Ord a) => IndList 4 a -> (IndList 4 a, Rational)
canonicalizeArea :: IndList 4 a -> (IndList 4 a, Rational)
canonicalizeArea (Append a
a (Append a
b (Append a
c (Append a
d IndList ((((4 - 1) - 1) - 1) - 1) a
Empty)))) = (a -> IndList (4 - 1) a -> IndList 4 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
a' (a -> IndList (3 - 1) a -> IndList 3 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
b' (a -> IndList (2 - 1) a -> IndList 2 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
c' (a -> IndList (1 - 1) a -> IndList 1 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
d' IndList (1 - 1) a
forall a. IndList 0 a
Empty))),Rational
s)
where
s :: Rational
s = IndList 4 a -> Rational
forall a. (Eq a, Ord a) => IndList 4 a -> Rational
areaSign (a -> IndList (4 - 1) a -> IndList 4 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
a (a -> IndList (3 - 1) a -> IndList 3 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
b (a -> IndList (2 - 1) a -> IndList 2 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
c (a -> IndList (1 - 1) a -> IndList 1 a
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append a
d IndList (1 - 1) a
forall a. IndList 0 a
Empty))))
[[a
a',a
b'],[a
c',a
d']] = [[a]] -> [[a]]
forall a. Ord a => [a] -> [a]
sort ([[a]] -> [[a]]) -> [[a]] -> [[a]]
forall a b. (a -> b) -> a -> b
$ ([a] -> [a]) -> [[a]] -> [[a]]
forall a b. (a -> b) -> [a] -> [b]
map [a] -> [a]
forall a. Ord a => [a] -> [a]
sort [[a
a,a
b],[a
c,a
d]]
interI2 :: ATens 0 0 1 0 0 2 (SField Rational)
interI2 :: ATens 0 0 1 0 0 2 (SField Rational)
interI2 = [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 1 0 0 2 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 1 0 0 2 (SField Rational))
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 1 0 0 2 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational))
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Rational -> SField Rational)
-> (IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField) ([(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational)])
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational) -> Bool)
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
forall a. (a -> Bool) -> [a] -> [a]
filter (\(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3
_,Rational
k) -> Rational
k Rational -> Rational -> Bool
forall a. Eq a => a -> a -> Bool
/= Rational
0) ([(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)])
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> a -> b
$ (IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3
-> (IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational))
-> [IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3]
-> [(IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3
x -> (IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3
x,IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3 -> Rational
forall p a b d e.
Num p =>
(a, b, IndList 1 Ind9, d, e, IndList 2 Ind3) -> p
f IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3
x)) [IndTuple6 0 0 1 0 0 2 Ind20 Ind9 Ind3]
forall a a a a.
[(IndList 0 a, IndList 0 a, IndList 1 Ind9, IndList 0 a,
IndList 0 a, IndList 2 Ind3)]
inds
where
trian2 :: Map (IndList 2 Ind3) (IndList 1 Ind9)
trian2 = Map (IndList 2 Ind3) (IndList 1 Ind9)
trianMap2
inds :: [(IndList 0 a, IndList 0 a, IndList 1 Ind9, IndList 0 a,
IndList 0 a, IndList 2 Ind3)]
inds = [ (IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Ind9 -> IndList 1 Ind9) -> Ind9 -> IndList 1 Ind9
forall a b. (a -> b) -> a -> b
$ Int -> Ind9
Ind9 Int
a, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
b) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
c) | Int
a <- [Int
0..Int
9], Int
b <- [Int
0..Int
3], Int
c <- [Int
0..Int
3]]
f :: (a, b, IndList 1 Ind9, d, e, IndList 2 Ind3) -> p
f (a
_, b
_, IndList 1 Ind9
ind1, d
_, e
_, IndList 2 Ind3
ind2)
| IndList 1 Ind9
ind1 IndList 1 Ind9 -> IndList 1 Ind9 -> Bool
forall a. Eq a => a -> a -> Bool
== Map (IndList 2 Ind3) (IndList 1 Ind9)
-> IndList 2 Ind3 -> IndList 1 Ind9
forall k a. Ord k => Map k a -> k -> a
(M.!) Map (IndList 2 Ind3) (IndList 1 Ind9)
trian2 (IndList 2 Ind3 -> IndList 2 Ind3
forall a (n :: Nat). (Ord a, Eq a) => IndList n a -> IndList n a
sortInd IndList 2 Ind3
ind2) = p
1
| Bool
otherwise = p
0
interJ2 :: ATens 0 0 0 1 2 0 (SField Rational)
interJ2 :: ATens 0 0 0 1 2 0 (SField Rational)
interJ2 = [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 1 2 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 1 2 0 (SField Rational))
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 1 2 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational))
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Rational -> SField Rational)
-> (IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField) ([(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational)])
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational) -> Bool)
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
forall a. (a -> Bool) -> [a] -> [a]
filter (\(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3
_,Rational
k) -> Rational
k Rational -> Rational -> Bool
forall a. Eq a => a -> a -> Bool
/= Rational
0) ([(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)])
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> a -> b
$ (IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3
-> (IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational))
-> [IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3]
-> [(IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3
x -> (IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3
x,IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3 -> Rational
forall a b c f.
(a, b, c, IndList 1 Ind9, IndList 2 Ind3, f) -> Rational
f IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3
x)) [IndTuple6 0 0 0 1 2 0 Ind20 Ind9 Ind3]
forall a a a a.
[(IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 2 Ind3, IndList 0 a)]
inds
where
trian2 :: Map (IndList 2 Ind3) (IndList 1 Ind9)
trian2 = Map (IndList 2 Ind3) (IndList 1 Ind9)
trianMap2
inds :: [(IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 2 Ind3, IndList 0 a)]
inds = [ (IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Ind9 -> IndList 1 Ind9) -> Ind9 -> IndList 1 Ind9
forall a b. (a -> b) -> a -> b
$ Int -> Ind9
Ind9 Int
a, Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
b) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
c, IndList 0 a
forall a. IndList 0 a
Empty) | Int
a <- [Int
0..Int
9], Int
b <- [Int
0..Int
3], Int
c <- [Int
0..Int
3]]
f :: (a, b, c, IndList 1 Ind9, IndList 2 Ind3, f) -> Rational
f (a
_, b
_, c
_, IndList 1 Ind9
ind1, IndList 2 Ind3
ind2, f
_)
| IndList 1 Ind9
ind1 IndList 1 Ind9 -> IndList 1 Ind9 -> Bool
forall a. Eq a => a -> a -> Bool
== Map (IndList 2 Ind3) (IndList 1 Ind9)
-> IndList 2 Ind3 -> IndList 1 Ind9
forall k a. Ord k => Map k a -> k -> a
(M.!) Map (IndList 2 Ind3) (IndList 1 Ind9)
trian2 (IndList 2 Ind3 -> IndList 2 Ind3
forall a (n :: Nat). (Ord a, Eq a) => IndList n a -> IndList n a
sortInd IndList 2 Ind3
ind2) = IndList 2 Ind3 -> Rational
forall a. Eq a => IndList 2 a -> Rational
jMult2 IndList 2 Ind3
ind2
| Bool
otherwise = Rational
0
interIArea :: ATens 1 0 0 0 0 4 (SField Rational)
interIArea :: ATens 1 0 0 0 0 4 (SField Rational)
interIArea = [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 1 0 0 0 0 4 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 1 0 0 0 0 4 (SField Rational))
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 1 0 0 0 0 4 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational))
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Rational -> SField Rational)
-> (IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField) ([(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational)])
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational) -> Bool)
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
forall a. (a -> Bool) -> [a] -> [a]
filter (\(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3
_,Rational
k) -> Rational
k Rational -> Rational -> Bool
forall a. Eq a => a -> a -> Bool
/= Rational
0) ([(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)])
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> a -> b
$ (IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3
-> (IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational))
-> [IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3]
-> [(IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3
x -> (IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3
x,IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3 -> Rational
forall b c d e.
(IndList 1 Ind20, b, c, d, e, IndList 4 Ind3) -> Rational
f IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3
x)) [IndTuple6 1 0 0 0 0 4 Ind20 Ind9 Ind3]
forall a a a a.
[(IndList 1 Ind20, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 4 Ind3)]
inds
where
trianArea :: Map (IndList 4 Ind3) (IndList 1 Ind20)
trianArea = Map (IndList 4 Ind3) (IndList 1 Ind20)
trianMapArea
inds :: [(IndList 1 Ind20, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 4 Ind3)]
inds = [ (Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 Int
a), IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind3 -> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
b) (IndList (4 - 1) Ind3 -> IndList 4 Ind3)
-> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
c) (IndList (3 - 1) Ind3 -> IndList 3 Ind3)
-> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
d) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
e) | Int
a <- [Int
0..Int
20], Int
b <- [Int
0..Int
3], Int
c <- [Int
0..Int
3], Int
d <- [Int
0..Int
3], Int
e <- [Int
0..Int
3], Bool -> Bool
not (Int
b Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
c Bool -> Bool -> Bool
|| Int
d Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
e)]
f :: (IndList 1 Ind20, b, c, d, e, IndList 4 Ind3) -> Rational
f (IndList 1 Ind20
ind1, b
_, c
_, d
_, e
_, IndList 4 Ind3
ind2)
| IndList 1 Ind20
ind1 IndList 1 Ind20 -> IndList 1 Ind20 -> Bool
forall a. Eq a => a -> a -> Bool
== Map (IndList 4 Ind3) (IndList 1 Ind20)
-> IndList 4 Ind3 -> IndList 1 Ind20
forall k a. Ord k => Map k a -> k -> a
(M.!) Map (IndList 4 Ind3) (IndList 1 Ind20)
trianArea IndList 4 Ind3
indArea = Rational
s
| Bool
otherwise = Rational
0
where
(IndList 4 Ind3
indArea, Rational
s) = IndList 4 Ind3 -> (IndList 4 Ind3, Rational)
forall a. (Eq a, Ord a) => IndList 4 a -> (IndList 4 a, Rational)
canonicalizeArea IndList 4 Ind3
ind2
interJArea :: ATens 0 1 0 0 4 0 (SField Rational)
interJArea :: ATens 0 1 0 0 4 0 (SField Rational)
interJArea = [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 4 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 4 0 (SField Rational))
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 4 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational))
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational)]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((Rational -> SField Rational)
-> (IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)
-> (IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField) ([(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational)])
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ ((IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational) -> Bool)
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
forall a. (a -> Bool) -> [a] -> [a]
filter (\(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3
_,Rational
k) -> Rational
k Rational -> Rational -> Bool
forall a. Eq a => a -> a -> Bool
/= Rational
0) ([(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)])
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> a -> b
$ (IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3
-> (IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational))
-> [IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3]
-> [(IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3, Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3
x -> (IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3
x,IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3 -> Rational
forall a c d f.
(a, IndList 1 Ind20, c, d, IndList 4 Ind3, f) -> Rational
f IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3
x)) [IndTuple6 0 1 0 0 4 0 Ind20 Ind9 Ind3]
forall a a a a.
[(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 4 Ind3, IndList 0 a)]
inds
where
trianArea :: Map (IndList 4 Ind3) (IndList 1 Ind20)
trianArea = Map (IndList 4 Ind3) (IndList 1 Ind20)
trianMapArea
inds :: [(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 4 Ind3, IndList 0 a)]
inds = [ (IndList 0 a
forall a. IndList 0 a
Empty, Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20) -> Ind20 -> IndList 1 Ind20
forall a b. (a -> b) -> a -> b
$ Int -> Ind20
Ind20 Int
a, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind3 -> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
b) (IndList (4 - 1) Ind3 -> IndList 4 Ind3)
-> IndList (4 - 1) Ind3 -> IndList 4 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
c) (IndList (3 - 1) Ind3 -> IndList 3 Ind3)
-> IndList (3 - 1) Ind3 -> IndList 3 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 Int
d) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
e, IndList 0 a
forall a. IndList 0 a
Empty) | Int
a <- [Int
0..Int
20], Int
b <- [Int
0..Int
3], Int
c <- [Int
0..Int
3], Int
d <- [Int
0..Int
3], Int
e <- [Int
0..Int
3], Bool -> Bool
not (Int
b Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
c Bool -> Bool -> Bool
|| Int
d Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== Int
e)]
f :: (a, IndList 1 Ind20, c, d, IndList 4 Ind3, f) -> Rational
f (a
_, IndList 1 Ind20
ind1, c
_, d
_, IndList 4 Ind3
ind2, f
_)
| IndList 1 Ind20
ind1 IndList 1 Ind20 -> IndList 1 Ind20 -> Bool
forall a. Eq a => a -> a -> Bool
== Map (IndList 4 Ind3) (IndList 1 Ind20)
-> IndList 4 Ind3 -> IndList 1 Ind20
forall k a. Ord k => Map k a -> k -> a
(M.!) Map (IndList 4 Ind3) (IndList 1 Ind20)
trianArea IndList 4 Ind3
indArea = Rational
s Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* IndList 4 Ind3 -> Rational
forall a. Eq a => IndList 4 a -> Rational
jMultArea IndList 4 Ind3
indArea
| Bool
otherwise = Rational
0
where
(IndList 4 Ind3
indArea, Rational
s) = IndList 4 Ind3 -> (IndList 4 Ind3, Rational)
forall a. (Eq a, Ord a) => IndList 4 a -> (IndList 4 a, Rational)
canonicalizeArea IndList 4 Ind3
ind2
interArea :: ATens 1 1 0 0 1 1 (SField Rational)
interArea :: ATens 1 1 0 0 1 1 (SField Rational)
interArea = Rational -> SField Rational
forall a. a -> SField a
SField (-Rational
4 :: Rational) SField Rational
-> ATens 1 1 0 0 1 1 (SField Rational)
-> Tensor
1
Ind20
(TProd
(SField Rational)
(Tensor 1 Ind20 (Tensor2 0 0 Ind9 (STTens 1 1 (SField Rational)))))
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. (Int, Int)
-> AbsTensor6
1 1 0 0 (1 + 1) (1 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> ATens 1 1 0 0 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
contrATens3 (Int
1,Int
1) ((Int, Int)
-> AbsTensor6
1 1 0 0 (2 + 1) (2 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
contrATens3 (Int
2,Int
2) (AbsTensor6
1 1 0 0 (2 + 1) (2 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational))
-> AbsTensor6
1 1 0 0 (2 + 1) (2 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
forall a b. (a -> b) -> a -> b
$ (Int, Int)
-> AbsTensor6
1 1 0 0 (3 + 1) (3 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 3 3 Ind20 Ind9 Ind3 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
contrATens3 (Int
3,Int
3) (AbsTensor6
1 1 0 0 (3 + 1) (3 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 3 3 Ind20 Ind9 Ind3 (SField Rational))
-> AbsTensor6
1 1 0 0 (3 + 1) (3 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 3 3 Ind20 Ind9 Ind3 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ATens 1 0 0 0 0 4 (SField Rational)
interIArea ATens 1 0 0 0 0 4 (SField Rational)
-> ATens 0 1 0 0 4 0 (SField Rational)
-> TProd
(ATens 1 0 0 0 0 4 (SField Rational))
(ATens 0 1 0 0 4 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 1 0 0 4 0 (SField Rational)
interJArea)
interMetric :: ATens 0 0 1 1 1 1 (SField Rational)
interMetric :: ATens 0 0 1 1 1 1 (SField Rational)
interMetric = Rational -> SField Rational
forall a. a -> SField a
SField (-Rational
2 :: Rational) SField Rational
-> ATens 0 0 1 1 1 1 (SField Rational)
-> Tensor
0
Ind20
(TProd
(SField Rational)
(Tensor 0 Ind20 (Tensor2 1 1 Ind9 (STTens 1 1 (SField Rational)))))
forall k s v (n :: Nat).
(TIndex k, Prod s v) =>
s -> Tensor n k v -> Tensor n k (TProd s v)
&. (Int, Int)
-> AbsTensor6
0 0 1 1 (1 + 1) (1 + 1) Ind20 Ind9 Ind3 (SField Rational)
-> ATens 0 0 1 1 1 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor6 n1 n2 n3 n4 (n5 + 1) (n6 + 1) k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
contrATens3 (Int
0,Int
0) (ATens 0 0 1 0 0 2 (SField Rational)
interI2 ATens 0 0 1 0 0 2 (SField Rational)
-> ATens 0 0 0 1 2 0 (SField Rational)
-> TProd
(ATens 0 0 1 0 0 2 (SField Rational))
(ATens 0 0 0 1 2 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 1 2 0 (SField Rational)
interJ2)
flatInter :: ATens 0 1 0 0 1 1 (SField Rational)
flatInter :: ATens 0 1 0 0 1 1 (SField Rational)
flatInter = (Int, Int)
-> AbsTensor2
(0 + 1)
(1 + 1)
Ind20
(Tensor2 0 0 Ind9 (STTens 1 1 (SField Rational)))
-> ATens 0 1 0 0 1 1 (SField Rational)
forall k1 v (n1 :: Nat) (n2 :: Nat).
(TIndex k1, TAdd v) =>
(Int, Int)
-> AbsTensor2 (n1 + 1) (n2 + 1) k1 v -> AbsTensor2 n1 n2 k1 v
contrATens1 (Int
0,Int
1) (AbsTensor2
(0 + 1)
(1 + 1)
Ind20
(Tensor2 0 0 Ind9 (STTens 1 1 (SField Rational)))
-> ATens 0 1 0 0 1 1 (SField Rational))
-> AbsTensor2
(0 + 1)
(1 + 1)
Ind20
(Tensor2 0 0 Ind9 (STTens 1 1 (SField Rational)))
-> ATens 0 1 0 0 1 1 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ATens 1 1 0 0 1 1 (SField Rational)
interArea ATens 1 1 0 0 1 1 (SField Rational)
-> ATens 0 1 0 0 0 0 (SField Rational)
-> TProd
(ATens 1 1 0 0 1 1 (SField Rational))
(ATens 0 1 0 0 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 1 0 0 0 0 (SField Rational)
flatArea
flatInterMetric :: ATens 0 0 0 1 1 1 (SField Rational)
flatInterMetric :: ATens 0 0 0 1 1 1 (SField Rational)
flatInterMetric = (Int, Int)
-> AbsTensor4
0 0 (0 + 1) (1 + 1) Ind20 Ind9 (STTens 1 1 (SField Rational))
-> ATens 0 0 0 1 1 1 (SField Rational)
forall k1 k2 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat).
(TIndex k1, TIndex k2, TAdd v) =>
(Int, Int)
-> AbsTensor4 n1 n2 (n3 + 1) (n4 + 1) k1 k2 v
-> AbsTensor4 n1 n2 n3 n4 k1 k2 v
contrATens2 (Int
0,Int
1) (AbsTensor4
0 0 (0 + 1) (1 + 1) Ind20 Ind9 (STTens 1 1 (SField Rational))
-> ATens 0 0 0 1 1 1 (SField Rational))
-> AbsTensor4
0 0 (0 + 1) (1 + 1) Ind20 Ind9 (STTens 1 1 (SField Rational))
-> ATens 0 0 0 1 1 1 (SField Rational)
forall a b. (a -> b) -> a -> b
$ ATens 0 0 1 1 1 1 (SField Rational)
interMetric ATens 0 0 1 1 1 1 (SField Rational)
-> ATens 0 0 0 1 0 0 (SField Rational)
-> TProd
(ATens 0 0 1 1 1 1 (SField Rational))
(ATens 0 0 0 1 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 1 0 0 (SField Rational)
etaAbs
interEqn2 :: ATens 1 1 0 0 2 2 (SField Rational)
interEqn2 :: AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
interEqn2 = AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
int1 AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
-> AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&- AbsTensor6 1 1 0 0 2 2 Ind20 Ind9 Ind3 (SField Rational)
int2
where
int1 :: TProd
(ATens 1 1 0 0 1 1 (SField Rational))
(ATens 0 0 0 0 1 1 (SField Rational))
int1 = ATens 1 1 0 0 1 1 (SField Rational)
interArea ATens 1 1 0 0 1 1 (SField Rational)
-> ATens 0 0 0 0 1 1 (SField Rational)
-> TProd
(ATens 1 1 0 0 1 1 (SField Rational))
(ATens 0 0 0 0 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 0 1 1 (SField Rational)
delta3A
int2 :: TProd
(Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational)))))
(ATens 1 1 0 0 0 0 (SField Rational))
int2 = (Int, Int)
-> Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational))))
-> Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational))))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
tensorTrans6 (Int
0,Int
1) (ATens 0 0 0 0 1 1 (SField Rational)
delta3A ATens 0 0 0 0 1 1 (SField Rational)
-> ATens 0 0 0 0 1 1 (SField Rational)
-> TProd
(ATens 0 0 0 0 1 1 (SField Rational))
(ATens 0 0 0 0 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 0 1 1 (SField Rational)
delta3A) Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational))))
-> ATens 1 1 0 0 0 0 (SField Rational)
-> TProd
(Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational)))))
(ATens 1 1 0 0 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 1 1 0 0 0 0 (SField Rational)
delta20
interEqn2Metric :: ATens 0 0 1 1 2 2 (SField Rational)
interEqn2Metric :: ATens 0 0 1 1 2 2 (SField Rational)
interEqn2Metric = ATens 0 0 1 1 2 2 (SField Rational)
int1 ATens 0 0 1 1 2 2 (SField Rational)
-> ATens 0 0 1 1 2 2 (SField Rational)
-> ATens 0 0 1 1 2 2 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&- ATens 0 0 1 1 2 2 (SField Rational)
int2
where
int1 :: TProd
(ATens 0 0 1 1 1 1 (SField Rational))
(ATens 0 0 0 0 1 1 (SField Rational))
int1 = ATens 0 0 1 1 1 1 (SField Rational)
interMetric ATens 0 0 1 1 1 1 (SField Rational)
-> ATens 0 0 0 0 1 1 (SField Rational)
-> TProd
(ATens 0 0 1 1 1 1 (SField Rational))
(ATens 0 0 0 0 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 0 1 1 (SField Rational)
delta3A
int2 :: TProd
(Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational)))))
(ATens 0 0 1 1 0 0 (SField Rational))
int2 = (Int, Int)
-> Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational))))
-> Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational))))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
tensorTrans6 (Int
0,Int
1) (ATens 0 0 0 0 1 1 (SField Rational)
delta3A ATens 0 0 0 0 1 1 (SField Rational)
-> ATens 0 0 0 0 1 1 (SField Rational)
-> TProd
(ATens 0 0 0 0 1 1 (SField Rational))
(ATens 0 0 0 0 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 0 1 1 (SField Rational)
delta3A) Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational))))
-> ATens 0 0 1 1 0 0 (SField Rational)
-> TProd
(Tensor
0
Ind20
(Tensor
0 Ind20 (Tensor2 0 0 Ind9 (Tensor2 2 2 Ind3 (SField Rational)))))
(ATens 0 0 1 1 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 1 1 0 0 (SField Rational)
delta9
interEqn3 :: ATens 1 1 1 1 1 1 (SField Rational)
interEqn3 :: ATens 1 1 1 1 1 1 (SField Rational)
interEqn3 = ATens 1 1 1 1 1 1 (SField Rational)
int1 ATens 1 1 1 1 1 1 (SField Rational)
-> ATens 1 1 1 1 1 1 (SField Rational)
-> ATens 1 1 1 1 1 1 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&+ ATens 1 1 1 1 1 1 (SField Rational)
int2
where
int1 :: TProd
(ATens 1 1 0 0 1 1 (SField Rational))
(ATens 0 0 1 1 0 0 (SField Rational))
int1 = ATens 1 1 0 0 1 1 (SField Rational)
interArea ATens 1 1 0 0 1 1 (SField Rational)
-> ATens 0 0 1 1 0 0 (SField Rational)
-> TProd
(ATens 1 1 0 0 1 1 (SField Rational))
(ATens 0 0 1 1 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 1 1 0 0 (SField Rational)
delta9
int2 :: TProd
(ATens 0 0 1 1 1 1 (SField Rational))
(ATens 1 1 0 0 0 0 (SField Rational))
int2 = ATens 0 0 1 1 1 1 (SField Rational)
interMetric ATens 0 0 1 1 1 1 (SField Rational)
-> ATens 1 1 0 0 0 0 (SField Rational)
-> TProd
(ATens 0 0 1 1 1 1 (SField Rational))
(ATens 1 1 0 0 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 1 1 0 0 0 0 (SField Rational)
delta20
interEqn3Metric :: ATens 0 0 2 2 1 1 (SField Rational)
interEqn3Metric :: ATens 0 0 2 2 1 1 (SField Rational)
interEqn3Metric = ATens 0 0 2 2 1 1 (SField Rational)
int1 ATens 0 0 2 2 1 1 (SField Rational)
-> ATens 0 0 2 2 1 1 (SField Rational)
-> ATens 0 0 2 2 1 1 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&+ ATens 0 0 2 2 1 1 (SField Rational)
int2
where
int1 :: TProd
(ATens 0 0 1 1 1 1 (SField Rational))
(ATens 0 0 1 1 0 0 (SField Rational))
int1 = ATens 0 0 1 1 1 1 (SField Rational)
interMetric ATens 0 0 1 1 1 1 (SField Rational)
-> ATens 0 0 1 1 0 0 (SField Rational)
-> TProd
(ATens 0 0 1 1 1 1 (SField Rational))
(ATens 0 0 1 1 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 1 1 0 0 (SField Rational)
delta9
int2 :: TProd
(ATens 0 0 1 1 0 0 (SField Rational))
(ATens 0 0 1 1 1 1 (SField Rational))
int2 = ATens 0 0 1 1 0 0 (SField Rational)
delta9 ATens 0 0 1 1 0 0 (SField Rational)
-> ATens 0 0 1 1 1 1 (SField Rational)
-> TProd
(ATens 0 0 1 1 0 0 (SField Rational))
(ATens 0 0 1 1 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 1 1 1 1 (SField Rational)
interMetric
interEqn4 :: ATens 1 1 0 1 3 1 (SField Rational)
interEqn4 :: ATens 1 1 0 1 3 1 (SField Rational)
interEqn4 = ATens 1 1 0 1 3 1 (SField Rational)
block1 ATens 1 1 0 1 3 1 (SField Rational)
-> ATens 1 1 0 1 3 1 (SField Rational)
-> ATens 1 1 0 1 3 1 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&- ATens 1 1 0 1 3 1 (SField Rational)
block2
where
block1' :: TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 1 1 0 0 1 1 (SField Rational))
block1' = ATens 0 0 0 1 2 0 (SField Rational)
interJ2 ATens 0 0 0 1 2 0 (SField Rational)
-> ATens 1 1 0 0 1 1 (SField Rational)
-> TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 1 1 0 0 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 1 1 0 0 1 1 (SField Rational)
interArea
block1 :: ATens 1 1 0 1 3 1 (SField Rational)
block1 = ATens 1 1 0 1 3 1 (SField Rational)
block1' ATens 1 1 0 1 3 1 (SField Rational)
-> ATens 1 1 0 1 3 1 (SField Rational)
-> ATens 1 1 0 1 3 1 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&+ (Int, Int)
-> ATens 1 1 0 1 3 1 (SField Rational)
-> ATens 1 1 0 1 3 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
tensorTrans5 (Int
1,Int
2) ATens 1 1 0 1 3 1 (SField Rational)
block1'
block2 :: TProd
(ATens 1 1 0 0 1 1 (SField Rational))
(ATens 0 0 0 1 2 0 (SField Rational))
block2 = ATens 1 1 0 0 0 0 (SField Rational)
delta20 ATens 1 1 0 0 0 0 (SField Rational)
-> ATens 0 0 0 0 1 1 (SField Rational)
-> TProd
(ATens 1 1 0 0 0 0 (SField Rational))
(ATens 0 0 0 0 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 0 1 1 (SField Rational)
delta3A ATens 1 1 0 0 1 1 (SField Rational)
-> ATens 0 0 0 1 2 0 (SField Rational)
-> TProd
(ATens 1 1 0 0 1 1 (SField Rational))
(ATens 0 0 0 1 2 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 1 2 0 (SField Rational)
interJ2
interEqn4Metric :: ATens 0 0 1 2 3 1 (SField Rational)
interEqn4Metric :: ATens 0 0 1 2 3 1 (SField Rational)
interEqn4Metric = ATens 0 0 1 2 3 1 (SField Rational)
block1 ATens 0 0 1 2 3 1 (SField Rational)
-> ATens 0 0 1 2 3 1 (SField Rational)
-> ATens 0 0 1 2 3 1 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&- ATens 0 0 1 2 3 1 (SField Rational)
block2
where
block1' :: TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 0 0 1 1 1 1 (SField Rational))
block1' = ATens 0 0 0 1 2 0 (SField Rational)
interJ2 ATens 0 0 0 1 2 0 (SField Rational)
-> ATens 0 0 1 1 1 1 (SField Rational)
-> TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 0 0 1 1 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 1 1 1 1 (SField Rational)
interMetric
block1 :: ATens 0 0 1 2 3 1 (SField Rational)
block1 = ATens 0 0 1 2 3 1 (SField Rational)
block1' ATens 0 0 1 2 3 1 (SField Rational)
-> ATens 0 0 1 2 3 1 (SField Rational)
-> ATens 0 0 1 2 3 1 (SField Rational)
forall k v (n :: Nat).
(TIndex k, TAdd v) =>
Tensor n k v -> Tensor n k v -> Tensor n k v
&+ (Int, Int)
-> ATens 0 0 1 2 3 1 (SField Rational)
-> ATens 0 0 1 2 3 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
(Int, Int)
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
tensorTrans5 (Int
1,Int
2) ATens 0 0 1 2 3 1 (SField Rational)
block1'
block2 :: TProd
(Tensor
0
Ind20
(Tensor
0
Ind20
(Tensor
0
Ind9
(Tensor
1 Ind9 (Tensor 3 Ind3 (Tensor 1 Ind3 (SField Rational)))))))
(ATens 0 0 1 1 0 0 (SField Rational))
block2 = ATens 0 0 0 0 1 1 (SField Rational)
delta3A ATens 0 0 0 0 1 1 (SField Rational)
-> ATens 0 0 0 1 2 0 (SField Rational)
-> TProd
(ATens 0 0 0 0 1 1 (SField Rational))
(ATens 0 0 0 1 2 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 0 1 2 0 (SField Rational)
interJ2 Tensor
0
Ind20
(Tensor
0
Ind20
(Tensor
0
Ind9
(Tensor 1 Ind9 (Tensor 3 Ind3 (Tensor 1 Ind3 (SField Rational))))))
-> ATens 0 0 1 1 0 0 (SField Rational)
-> TProd
(Tensor
0
Ind20
(Tensor
0
Ind20
(Tensor
0
Ind9
(Tensor
1 Ind9 (Tensor 3 Ind3 (Tensor 1 Ind3 (SField Rational)))))))
(ATens 0 0 1 1 0 0 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 1 1 0 0 (SField Rational)
delta9
interEqn5 :: ATens 1 1 0 1 3 1 (SField Rational)
interEqn5 :: ATens 1 1 0 1 3 1 (SField Rational)
interEqn5 = [Int]
-> ATens 1 1 0 1 3 1 (SField Rational)
-> ATens 1 1 0 1 3 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicSymATens5 [Int
0,Int
1,Int
2] ATens 1 1 0 1 3 1 (SField Rational)
intA1
where
intA1 :: TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 1 1 0 0 1 1 (SField Rational))
intA1 = ATens 0 0 0 1 2 0 (SField Rational)
interJ2 ATens 0 0 0 1 2 0 (SField Rational)
-> ATens 1 1 0 0 1 1 (SField Rational)
-> TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 1 1 0 0 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 1 1 0 0 1 1 (SField Rational)
interArea
interEqn5Metric :: ATens 0 0 1 2 3 1 (SField Rational)
interEqn5Metric :: ATens 0 0 1 2 3 1 (SField Rational)
interEqn5Metric = [Int]
-> ATens 0 0 1 2 3 1 (SField Rational)
-> ATens 0 0 1 2 3 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[Int]
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
-> AbsTensor5 n1 n2 n3 n4 n5 k1 k2 k3 v
cyclicSymATens5 [Int
0,Int
1,Int
2] ATens 0 0 1 2 3 1 (SField Rational)
intA1
where
intA1 :: TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 0 0 1 1 1 1 (SField Rational))
intA1 = ATens 0 0 0 1 2 0 (SField Rational)
interJ2 ATens 0 0 0 1 2 0 (SField Rational)
-> ATens 0 0 1 1 1 1 (SField Rational)
-> TProd
(ATens 0 0 0 1 2 0 (SField Rational))
(ATens 0 0 1 1 1 1 (SField Rational))
forall k v v' (n :: Nat) (m :: Nat).
(TIndex k, Prod v v') =>
Tensor n k v
-> Tensor m k v' -> TProd (Tensor n k v) (Tensor m k v')
&* ATens 0 0 1 1 1 1 (SField Rational)
interMetric
generic4Ansatz :: ATens 1 0 0 0 0 0 (AnsVar (SField Rational))
generic4Ansatz :: ATens 1 0 0 0 0 0 (AnsVar (SField Rational))
generic4Ansatz = [(IndTuple6 1 0 0 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 1 0 0 0 0 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 1 0 0 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
forall a a a a a.
[((IndList 1 Ind20, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a),
AnsVar (SField Rational))]
list
where
list :: [((IndList 1 Ind20, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a),
AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int
forall p. p -> p
dof Int
a) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21] ]
dof :: p -> p
dof p
a = p
a
generic5Ansatz :: ATens 1 0 0 0 1 0 (AnsVar (SField Rational))
generic5Ansatz :: ATens 1 0 0 0 1 0 (AnsVar (SField Rational))
generic5Ansatz = [(IndTuple6 1 0 0 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 1 0 0 0 1 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 1 0 0 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
forall a a a a.
[((IndList 1 Ind20, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 0 a),
AnsVar (SField Rational))]
list
where
list :: [((IndList 1 Ind20, IndList 0 a, IndList 0 a, IndList 0 a,
IndList 1 Ind3, IndList 0 a),
AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int
forall a. Num a => a -> a -> a
dof Int
a Int
p) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 (Int -> Ind3) -> Int -> Ind3
forall a b. (a -> b) -> a -> b
$ Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1 ), IndList 0 a
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
p <- [Int
1..Int
4] ]
dof :: a -> a -> a
dof a
a a
p = a
1 a -> a -> a
forall a. Num a => a -> a -> a
+ a
21 a -> a -> a
forall a. Num a => a -> a -> a
+ a
4a -> a -> a
forall a. Num a => a -> a -> a
*(a
aa -> a -> a
forall a. Num a => a -> a -> a
-a
1) a -> a -> a
forall a. Num a => a -> a -> a
+ (a
pa -> a -> a
forall a. Num a => a -> a -> a
-a
1)
generic6Ansatz :: ATens 1 0 1 0 0 0 (AnsVar (SField Rational))
generic6Ansatz :: ATens 1 0 1 0 0 0 (AnsVar (SField Rational))
generic6Ansatz = [(IndTuple6 1 0 1 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 1 0 1 0 0 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 1 0 1 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
forall a a a a.
[((IndList 1 Ind20, IndList 0 a, IndList 1 Ind9, IndList 0 a,
IndList 0 a, IndList 0 a),
AnsVar (SField Rational))]
list
where
list :: [((IndList 1 Ind20, IndList 0 a, IndList 1 Ind9, IndList 0 a,
IndList 0 a, IndList 0 a),
AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int
forall a. Num a => a -> a -> a
dof Int
a Int
i) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 a
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Int -> Ind9
Ind9 (Int -> Ind9) -> Int -> Ind9
forall a b. (a -> b) -> a -> b
$ Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
i <- [Int
1..Int
10] ]
dof :: a -> a -> a
dof a
a a
i = a
1 a -> a -> a
forall a. Num a => a -> a -> a
+ a
21 a -> a -> a
forall a. Num a => a -> a -> a
+ a
84 a -> a -> a
forall a. Num a => a -> a -> a
+ a
10a -> a -> a
forall a. Num a => a -> a -> a
*(a
aa -> a -> a
forall a. Num a => a -> a -> a
-a
1) a -> a -> a
forall a. Num a => a -> a -> a
+ (a
ia -> a -> a
forall a. Num a => a -> a -> a
-a
1)
generic8Ansatz :: ATens 2 0 0 0 0 0 (AnsVar (SField Rational))
generic8Ansatz :: ATens 2 0 0 0 0 0 (AnsVar (SField Rational))
generic8Ansatz = [(IndTuple6 2 0 0 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 2 0 0 0 0 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 2 0 0 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list
where
list :: [(IndTuple6 2 0 0 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int
dof Int
a Int
b) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind20 -> IndList 2 Ind20)
-> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a b. (a -> b) -> a -> b
$ Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind20
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
b <- [Int
1..Int
21] ]
dof :: Int -> Int -> Int
dof Int
a Int
b = let a' :: Int
a' = Int -> Int -> Int
forall a. Ord a => a -> a -> a
min Int
a Int
b
b' :: Int
b' = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max Int
a Int
b
in Map [Int] Int
trian Map [Int] Int -> [Int] -> Int
forall k a. Ord k => Map k a -> k -> a
M.! [Int
a',Int
b'] Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
315
trian :: Map [Int] Int
trian = [([Int], Int)] -> Map [Int] Int
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([([Int], Int)] -> Map [Int] Int)
-> [([Int], Int)] -> Map [Int] Int
forall a b. (a -> b) -> a -> b
$ [[Int]] -> [Int] -> [([Int], Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [[Int]]
j [Int]
k
where
j :: [[Int]]
j = [ [Int
a,Int
b] | Int
a <- [Int
1..Int
315], Int
b <- [Int
a..Int
315] ]
k :: [Int]
k = [Int
1..]
generic9Ansatz :: ATens 2 0 0 0 1 0 (AnsVar (SField Rational))
generic9Ansatz :: ATens 2 0 0 0 1 0 (AnsVar (SField Rational))
generic9Ansatz = [(IndTuple6 2 0 0 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 2 0 0 0 1 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 2 0 0 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list
where
list :: [(IndTuple6 2 0 0 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int -> Int
dof Int
a Int
b Int
p) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind20 -> IndList 2 Ind20)
-> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a b. (a -> b) -> a -> b
$ Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind20
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 (Int -> Ind3) -> Int -> Ind3
forall a b. (a -> b) -> a -> b
$ Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind3
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
b <- [Int
1..Int
21], Int
p <- [Int
1..Int
4]]
dof :: Int -> Int -> Int -> Int
dof Int
a Int
b Int
p = Map [Int] Int
trian Map [Int] Int -> [Int] -> Int
forall k a. Ord k => Map k a -> k -> a
M.! [Int
a,Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
21 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
4Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)] Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
315
trian :: Map [Int] Int
trian = [([Int], Int)] -> Map [Int] Int
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([([Int], Int)] -> Map [Int] Int)
-> [([Int], Int)] -> Map [Int] Int
forall a b. (a -> b) -> a -> b
$ [[Int]] -> [Int] -> [([Int], Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [[Int]]
j [Int]
k
where
j :: [[Int]]
j = [ [Int
a,Int
b] | Int
a <- [Int
1..Int
315], Int
b <- [Int
a..Int
315] ]
k :: [Int]
k = [Int
1..]
generic10_1Ansatz :: ATens 2 0 0 0 2 0 (AnsVar (SField Rational))
generic10_1Ansatz :: ATens 2 0 0 0 2 0 (AnsVar (SField Rational))
generic10_1Ansatz = [(IndTuple6 2 0 0 0 2 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 2 0 0 0 2 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 2 0 0 0 2 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list
where
list :: [(IndTuple6 2 0 0 0 2 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int -> Int -> Int
dof Int
a Int
b Int
p Int
q) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind20 -> IndList 2 Ind20)
-> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a b. (a -> b) -> a -> b
$ Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind20
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, Ind3 -> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind3
Ind3 (Int -> Ind3) -> Int -> Ind3
forall a b. (a -> b) -> a -> b
$ Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind3 -> IndList 2 Ind3)
-> IndList (2 - 1) Ind3 -> IndList 2 Ind3
forall a b. (a -> b) -> a -> b
$ Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 (Int -> Ind3) -> Int -> Ind3
forall a b. (a -> b) -> a -> b
$ Int
qInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind3
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
b <- [Int
1..Int
21], Int
p <- [Int
1..Int
4], Int
q <- [Int
1..Int
4]]
dof :: Int -> Int -> Int -> Int -> Int
dof Int
a Int
b Int
p Int
q = let
a' :: Int
a' = Int -> Int -> Int
forall a. Ord a => a -> a -> a
min (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
21 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
4Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)) (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
21 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
4Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
qInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1))
b' :: Int
b' = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
21 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
4Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)) (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
21 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
4Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
qInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1))
in Map [Int] Int
trian Map [Int] Int -> [Int] -> Int
forall k a. Ord k => Map k a -> k -> a
M.! [Int
a',Int
b'] Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
315
trian :: Map [Int] Int
trian = [([Int], Int)] -> Map [Int] Int
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([([Int], Int)] -> Map [Int] Int)
-> [([Int], Int)] -> Map [Int] Int
forall a b. (a -> b) -> a -> b
$ [[Int]] -> [Int] -> [([Int], Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [[Int]]
j [Int]
k
where
j :: [[Int]]
j = [ [Int
a,Int
b] | Int
a <- [Int
1..Int
315], Int
b <- [Int
a..Int
315] ]
k :: [Int]
k = [Int
1..]
generic10_2Ansatz :: ATens 2 0 1 0 0 0 (AnsVar (SField Rational))
generic10_2Ansatz :: ATens 2 0 1 0 0 0 (AnsVar (SField Rational))
generic10_2Ansatz = [(IndTuple6 2 0 1 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 2 0 1 0 0 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 2 0 1 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list
where
list :: [(IndTuple6 2 0 1 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int -> Int
dof Int
a Int
b Int
i) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind20 -> IndList 2 Ind20)
-> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a b. (a -> b) -> a -> b
$ Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind20
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Int -> Ind9
Ind9 (Int -> Ind9) -> Int -> Ind9
forall a b. (a -> b) -> a -> b
$ Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
b <- [Int
1..Int
21], Int
i <- [Int
1..Int
10]]
dof :: Int -> Int -> Int -> Int
dof Int
a Int
b Int
i = Map [Int] Int
trian Map [Int] Int -> [Int] -> Int
forall k a. Ord k => Map k a -> k -> a
M.! [Int
a,Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
105 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
10Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)] Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
315
trian :: Map [Int] Int
trian = [([Int], Int)] -> Map [Int] Int
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([([Int], Int)] -> Map [Int] Int)
-> [([Int], Int)] -> Map [Int] Int
forall a b. (a -> b) -> a -> b
$ [[Int]] -> [Int] -> [([Int], Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [[Int]]
j [Int]
k
where
j :: [[Int]]
j = [ [Int
a,Int
b] | Int
a <- [Int
1..Int
315], Int
b <- [Int
a..Int
315] ]
k :: [Int]
k = [Int
1..]
generic11Ansatz :: ATens 2 0 1 0 1 0 (AnsVar (SField Rational))
generic11Ansatz :: ATens 2 0 1 0 1 0 (AnsVar (SField Rational))
generic11Ansatz = [(IndTuple6 2 0 1 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 2 0 1 0 1 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 2 0 1 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list
where
list :: [(IndTuple6 2 0 1 0 1 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int -> Int -> Int
dof Int
a Int
b Int
i Int
p) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind20 -> IndList 2 Ind20)
-> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a b. (a -> b) -> a -> b
$ Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind20
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Int -> Ind9
Ind9 (Int -> Ind9) -> Int -> Ind9
forall a b. (a -> b) -> a -> b
$ Int
i Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind9
forall a. IndList 0 a
Empty, Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Int -> Ind3
Ind3 (Int -> Ind3) -> Int -> Ind3
forall a b. (a -> b) -> a -> b
$ Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind3
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
b <- [Int
1..Int
21], Int
i <- [Int
1..Int
10], Int
p <- [Int
1..Int
4]]
dof :: Int -> Int -> Int -> Int -> Int
dof Int
a Int
b Int
i Int
p = Map [Int] Int
trian Map [Int] Int -> [Int] -> Int
forall k a. Ord k => Map k a -> k -> a
M.! [Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
21 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
4Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
pInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1),Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
105 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
10Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)] Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
315
trian :: Map [Int] Int
trian = [([Int], Int)] -> Map [Int] Int
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([([Int], Int)] -> Map [Int] Int)
-> [([Int], Int)] -> Map [Int] Int
forall a b. (a -> b) -> a -> b
$ [[Int]] -> [Int] -> [([Int], Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [[Int]]
j [Int]
k
where
j :: [[Int]]
j = [ [Int
a,Int
b] | Int
a <- [Int
1..Int
315], Int
b <- [Int
a..Int
315] ]
k :: [Int]
k = [Int
1..]
generic12_1Ansatz :: ATens 2 0 2 0 0 0 (AnsVar (SField Rational))
generic12_1Ansatz :: ATens 2 0 2 0 0 0 (AnsVar (SField Rational))
generic12_1Ansatz = [(IndTuple6 2 0 2 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
-> ATens 2 0 2 0 0 0 (AnsVar (SField Rational))
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 2 0 2 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list
where
list :: [(IndTuple6 2 0 2 0 0 0 Ind20 Ind9 Ind3, AnsVar (SField Rational))]
list = [ let varMap :: AnsVar (SField Rational)
varMap = IntMap (SField Rational) -> AnsVar (SField Rational)
forall a. IntMap a -> AnsVar a
AnsVar (IntMap (SField Rational) -> AnsVar (SField Rational))
-> IntMap (SField Rational) -> AnsVar (SField Rational)
forall a b. (a -> b) -> a -> b
$ Int -> SField Rational -> IntMap (SField Rational)
forall a. Int -> a -> IntMap a
I.singleton (Int -> Int -> Int -> Int -> Int
dof Int
a Int
b Int
i Int
j) (SField Rational -> IntMap (SField Rational))
-> SField Rational -> IntMap (SField Rational)
forall a b. (a -> b) -> a -> b
$ Rational -> SField Rational
forall a. a -> SField a
SField Rational
1
in ((Ind20 -> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind20 -> IndList 2 Ind20)
-> IndList (2 - 1) Ind20 -> IndList 2 Ind20
forall a b. (a -> b) -> a -> b
$ Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Int -> Ind20
Ind20 (Int -> Ind20) -> Int -> Ind20
forall a b. (a -> b) -> a -> b
$ Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind20
forall a. IndList 0 a
Empty, Ind9 -> IndList (2 - 1) Ind9 -> IndList 2 Ind9
forall a (n :: Nat). a -> IndList (n - 1) a -> IndList n a
Append (Int -> Ind9
Ind9 (Int -> Ind9) -> Int -> Ind9
forall a b. (a -> b) -> a -> b
$ Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) (IndList (2 - 1) Ind9 -> IndList 2 Ind9)
-> IndList (2 - 1) Ind9 -> IndList 2 Ind9
forall a b. (a -> b) -> a -> b
$ Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Int -> Ind9
Ind9 (Int -> Ind9) -> Int -> Ind9
forall a b. (a -> b) -> a -> b
$ Int
j Int -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1), IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty), AnsVar (SField Rational)
varMap)
| Int
a <- [Int
1..Int
21], Int
b <- [Int
1..Int
21], Int
i <- [Int
1..Int
10], Int
j <- [Int
1..Int
10]]
dof :: Int -> Int -> Int -> Int -> Int
dof Int
a Int
b Int
i Int
j = let
a' :: Int
a' = Int -> Int -> Int
forall a. Ord a => a -> a -> a
min (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
105 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
10Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)) (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
105 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
10Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
jInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1))
b' :: Int
b' = Int -> Int -> Int
forall a. Ord a => a -> a -> a
max (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
105 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
10Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
aInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
iInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1)) (Int
1 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
105 Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
10Int -> Int -> Int
forall a. Num a => a -> a -> a
*(Int
bInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1) Int -> Int -> Int
forall a. Num a => a -> a -> a
+ (Int
jInt -> Int -> Int
forall a. Num a => a -> a -> a
-Int
1))
in Map [Int] Int
trian Map [Int] Int -> [Int] -> Int
forall k a. Ord k => Map k a -> k -> a
M.! [Int
a',Int
b'] Int -> Int -> Int
forall a. Num a => a -> a -> a
+ Int
315
trian :: Map [Int] Int
trian = [([Int], Int)] -> Map [Int] Int
forall k a. Ord k => [(k, a)] -> Map k a
M.fromList ([([Int], Int)] -> Map [Int] Int)
-> [([Int], Int)] -> Map [Int] Int
forall a b. (a -> b) -> a -> b
$ [[Int]] -> [Int] -> [([Int], Int)]
forall a b. [a] -> [b] -> [(a, b)]
zip [[Int]]
j [Int]
k
where
j :: [[Int]]
j = [ [Int
a,Int
b] | Int
a <- [Int
1..Int
315], Int
b <- [Int
a..Int
315] ]
k :: [Int]
k = [Int
1..]
randRats :: IO [Rational]
randRats :: IO [Rational]
randRats = do
TFGen
gen <- IO TFGen
newTFGen
let randList' :: [Int]
randList' = (Int, Int) -> TFGen -> [Int]
forall a g. (Random a, RandomGen g) => (a, a) -> g -> [a]
randomRs (-Int
10000,Int
10000) TFGen
gen :: [Int]
let randList :: [Rational]
randList = (Int -> Rational) -> [Int] -> [Rational]
forall a b. (a -> b) -> [a] -> [b]
map Int -> Rational
forall a b. (Integral a, Num b) => a -> b
fromIntegral [Int]
randList'
[Rational] -> IO [Rational]
forall (m :: * -> *) a. Monad m => a -> m a
return [Rational]
randList
randArea :: IO (ATens 0 1 0 0 0 0 (SField Rational))
randArea :: IO (ATens 0 1 0 0 0 0 (SField Rational))
randArea = do
[Rational]
randList <- IO [Rational]
randRats
let inds :: [(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a)]
inds = (Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a))
-> [Int]
-> [(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a)]
forall a b. (a -> b) -> [a] -> [b]
map (\Int
i -> (IndList 0 a
forall a. IndList 0 a
Empty, Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20) -> Ind20 -> IndList 1 Ind20
forall a b. (a -> b) -> a -> b
$ Int -> Ind20
Ind20 Int
i, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty)) [Int
0..Int
20]
ATens 0 1 0 0 0 0 (SField Rational)
-> IO (ATens 0 1 0 0 0 0 (SField Rational))
forall (m :: * -> *) a. Monad m => a -> m a
return (ATens 0 1 0 0 0 0 (SField Rational)
-> IO (ATens 0 1 0 0 0 0 (SField Rational)))
-> ATens 0 1 0 0 0 0 (SField Rational)
-> IO (ATens 0 1 0 0 0 0 (SField Rational))
forall a b. (a -> b) -> a -> b
$ [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational))
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ [IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3]
-> [SField Rational]
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3]
forall a a a a a.
[(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a)]
inds ([SField Rational]
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)])
-> [SField Rational]
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ (Rational -> SField Rational) -> [Rational] -> [SField Rational]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField [Rational]
randList
randAxon :: IO (ATens 0 1 0 0 0 0 (SField Rational))
randAxon :: IO (ATens 0 1 0 0 0 0 (SField Rational))
randAxon = do
[Rational]
randList <- IO [Rational]
randRats
let inds :: [(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a)]
inds = (Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a))
-> [Int]
-> [(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a)]
forall a b. (a -> b) -> [a] -> [b]
map (\Int
i -> (IndList 0 a
forall a. IndList 0 a
Empty, Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20) -> Ind20 -> IndList 1 Ind20
forall a b. (a -> b) -> a -> b
$ Int -> Ind20
Ind20 Int
i, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty)) [Int
5,Int
9,Int
12]
let randInd :: SField Rational
randInd = Rational -> SField Rational
forall a. a -> SField a
SField (Rational -> SField Rational) -> Rational -> SField Rational
forall a b. (a -> b) -> a -> b
$ [Rational] -> Rational
forall a. [a] -> a
head [Rational]
randList
let assocs :: [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
assocs = [IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3]
-> [SField Rational]
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3]
forall a a a a a.
[(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 0 a)]
inds [-SField Rational
randInd, SField Rational
randInd, -SField Rational
randInd]
let tens :: ATens 0 1 0 0 0 0 (SField Rational)
tens = [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
assocs
ATens 0 1 0 0 0 0 (SField Rational)
-> IO (ATens 0 1 0 0 0 0 (SField Rational))
forall (m :: * -> *) a. Monad m => a -> m a
return ATens 0 1 0 0 0 0 (SField Rational)
tens
randFlatArea :: IO (ATens 0 1 0 0 0 0 (SField Rational))
randFlatArea :: IO (ATens 0 1 0 0 0 0 (SField Rational))
randFlatArea = do
[Rational]
randList <- IO [Rational]
randRats
let assocs :: [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
assocs = ((Int, Rational)
-> (IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational))
-> [(Int, Rational)]
-> [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> [a] -> [b]
map (\(Int
i,Rational
v) -> ( (IndList 0 Ind20
forall a. IndList 0 a
Empty, Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20) -> Ind20 -> IndList 1 Ind20
forall a b. (a -> b) -> a -> b
$ Int -> Ind20
Ind20 Int
i, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind9
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty, IndList 0 Ind3
forall a. IndList 0 a
Empty), Rational -> SField Rational
forall a. a -> SField a
SField Rational
v))
[(Int
0, -Rational
1 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* [Rational] -> Rational
forall a. [a] -> a
head [Rational]
randList),(Int
5, [Rational]
randList [Rational] -> Int -> Rational
forall a. [a] -> Int -> a
!! Int
3),(Int
6, -Rational
1 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* [Rational]
randList [Rational] -> Int -> Rational
forall a. [a] -> Int -> a
!! Int
1),(Int
9, -Rational
1 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* [Rational]
randList [Rational] -> Int -> Rational
forall a. [a] -> Int -> a
!! Int
4),(Int
11, -Rational
1 Rational -> Rational -> Rational
forall a. Num a => a -> a -> a
* [Rational]
randList [Rational] -> Int -> Rational
forall a. [a] -> Int -> a
!! Int
2),(Int
12, [Rational]
randList [Rational] -> Int -> Rational
forall a. [a] -> Int -> a
!! Int
5),(Int
15, [Rational] -> Rational
forall a. [a] -> a
head [Rational]
randList),(Int
18, [Rational]
randList [Rational] -> Int -> Rational
forall a. [a] -> Int -> a
!! Int
1),(Int
20, [Rational]
randList [Rational] -> Int -> Rational
forall a. [a] -> Int -> a
!! Int
2)]
let tens :: ATens 0 1 0 0 0 0 (SField Rational)
tens = [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 [(IndTuple6 0 1 0 0 0 0 Ind20 Ind9 Ind3, SField Rational)]
assocs
ATens 0 1 0 0 0 0 (SField Rational)
-> IO (ATens 0 1 0 0 0 0 (SField Rational))
forall (m :: * -> *) a. Monad m => a -> m a
return ATens 0 1 0 0 0 0 (SField Rational)
tens
randAreaDerivative1 :: IO (ATens 0 1 0 0 0 1 (SField Rational))
randAreaDerivative1 :: IO (ATens 0 1 0 0 0 1 (SField Rational))
randAreaDerivative1 = do
[Rational]
randList <- IO [Rational]
randRats
let inds :: [(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 1 Ind3)]
inds = [ Int
-> Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 1 Ind3)
forall a a a a.
Int
-> Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 1 Ind3)
f Int
a Int
p | Int
a <- [Int
0..Int
20], Int
p <- [Int
0..Int
3]]
ATens 0 1 0 0 0 1 (SField Rational)
-> IO (ATens 0 1 0 0 0 1 (SField Rational))
forall (m :: * -> *) a. Monad m => a -> m a
return (ATens 0 1 0 0 0 1 (SField Rational)
-> IO (ATens 0 1 0 0 0 1 (SField Rational)))
-> ATens 0 1 0 0 0 1 (SField Rational)
-> IO (ATens 0 1 0 0 0 1 (SField Rational))
forall a b. (a -> b) -> a -> b
$ [(IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 1 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 1 (SField Rational))
-> [(IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 0 0 1 (SField Rational)
forall a b. (a -> b) -> a -> b
$ [IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3]
-> [SField Rational]
-> [(IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3]
forall a a a a.
[(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 1 Ind3)]
inds ([SField Rational]
-> [(IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3, SField Rational)])
-> [SField Rational]
-> [(IndTuple6 0 1 0 0 0 1 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ (Rational -> SField Rational) -> [Rational] -> [SField Rational]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField [Rational]
randList
where f :: Int
-> Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 0 a,
IndList 0 a, IndList 1 Ind3)
f Int
a Int
p = (IndList 0 a
forall a. IndList 0 a
Empty, Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20) -> Ind20 -> IndList 1 Ind20
forall a b. (a -> b) -> a -> b
$ Int -> Ind20
Ind20 Int
a, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind3 -> IndList 1 Ind3
forall a. a -> IndList 1 a
singletonInd (Ind3 -> IndList 1 Ind3) -> Ind3 -> IndList 1 Ind3
forall a b. (a -> b) -> a -> b
$ Int -> Ind3
Ind3 Int
p)
randAreaDerivative2 :: IO (ATens 0 1 0 1 0 0 (SField Rational))
randAreaDerivative2 :: IO (ATens 0 1 0 1 0 0 (SField Rational))
randAreaDerivative2 = do
[Rational]
randList <- IO [Rational]
randRats
let inds :: [(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)]
inds = [ Int
-> Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)
forall a a a a.
Int
-> Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)
f Int
a Int
i | Int
a <- [Int
0..Int
20], Int
i <- [Int
0..Int
9]]
ATens 0 1 0 1 0 0 (SField Rational)
-> IO (ATens 0 1 0 1 0 0 (SField Rational))
forall (m :: * -> *) a. Monad m => a -> m a
return (ATens 0 1 0 1 0 0 (SField Rational)
-> IO (ATens 0 1 0 1 0 0 (SField Rational)))
-> ATens 0 1 0 1 0 0 (SField Rational)
-> IO (ATens 0 1 0 1 0 0 (SField Rational))
forall a b. (a -> b) -> a -> b
$ [(IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 1 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 1 0 0 (SField Rational))
-> [(IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 1 0 1 0 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ [IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3]
-> [SField Rational]
-> [(IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3]
forall a a a a.
[(IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)]
inds ([SField Rational]
-> [(IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)])
-> [SField Rational]
-> [(IndTuple6 0 1 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ (Rational -> SField Rational) -> [Rational] -> [SField Rational]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField [Rational]
randList
where f :: Int
-> Int
-> (IndList 0 a, IndList 1 Ind20, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)
f Int
a Int
i = (IndList 0 a
forall a. IndList 0 a
Empty, Ind20 -> IndList 1 Ind20
forall a. a -> IndList 1 a
singletonInd (Ind20 -> IndList 1 Ind20) -> Ind20 -> IndList 1 Ind20
forall a b. (a -> b) -> a -> b
$ Int -> Ind20
Ind20 Int
a, IndList 0 a
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Ind9 -> IndList 1 Ind9) -> Ind9 -> IndList 1 Ind9
forall a b. (a -> b) -> a -> b
$ Int -> Ind9
Ind9 Int
i, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty)
randMetric :: IO (ATens 0 0 0 1 0 0 (SField Rational))
randMetric :: IO (ATens 0 0 0 1 0 0 (SField Rational))
randMetric = do
[Rational]
randList <- IO [Rational]
randRats
let inds :: [(IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)]
inds = (Int
-> (IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a))
-> [Int]
-> [(IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)]
forall a b. (a -> b) -> [a] -> [b]
map (\Int
i -> (IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty, Ind9 -> IndList 1 Ind9
forall a. a -> IndList 1 a
singletonInd (Ind9 -> IndList 1 Ind9) -> Ind9 -> IndList 1 Ind9
forall a b. (a -> b) -> a -> b
$ Int -> Ind9
Ind9 Int
i, IndList 0 a
forall a. IndList 0 a
Empty, IndList 0 a
forall a. IndList 0 a
Empty)) [Int
0..Int
20]
ATens 0 0 0 1 0 0 (SField Rational)
-> IO (ATens 0 0 0 1 0 0 (SField Rational))
forall (m :: * -> *) a. Monad m => a -> m a
return (ATens 0 0 0 1 0 0 (SField Rational)
-> IO (ATens 0 0 0 1 0 0 (SField Rational)))
-> ATens 0 0 0 1 0 0 (SField Rational)
-> IO (ATens 0 0 0 1 0 0 (SField Rational))
forall a b. (a -> b) -> a -> b
$ [(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 1 0 0 (SField Rational)
forall k1 k2 k3 v (n1 :: Nat) (n2 :: Nat) (n3 :: Nat) (n4 :: Nat)
(n5 :: Nat) (n6 :: Nat).
(TIndex k1, TIndex k2, TIndex k3, TAdd v) =>
[(IndTuple6 n1 n2 n3 n4 n5 n6 k1 k2 k3, v)]
-> AbsTensor6 n1 n2 n3 n4 n5 n6 k1 k2 k3 v
fromListT6 ([(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 1 0 0 (SField Rational))
-> [(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
-> ATens 0 0 0 1 0 0 (SField Rational)
forall a b. (a -> b) -> a -> b
$ [IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3]
-> [SField Rational]
-> [(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. [a] -> [b] -> [(a, b)]
zip [IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3]
forall a a a a a.
[(IndList 0 a, IndList 0 a, IndList 0 a, IndList 1 Ind9,
IndList 0 a, IndList 0 a)]
inds ([SField Rational]
-> [(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)])
-> [SField Rational]
-> [(IndTuple6 0 0 0 1 0 0 Ind20 Ind9 Ind3, SField Rational)]
forall a b. (a -> b) -> a -> b
$ (Rational -> SField Rational) -> [Rational] -> [SField Rational]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap Rational -> SField Rational
forall a. a -> SField a
SField [Rational]
randList