Constants
ginjax.geometric.constants
¤
KroneckerDeltaSymbol
¤
TODO: the KroneckerDelta should only be a 2-tensor, not a k-tensor.
Source code in ginjax/geometric/constants.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
get(D: int, k: int) -> np.ndarray
classmethod
¤
Get the Levi Civita symbol for dimension D from the cache, or creating it on a cache miss args: D (int): dimension of the Kronecker symbol k (int): order of the Kronecker Delta symbol
Source code in ginjax/geometric/constants.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
LeviCivitaSymbol
¤
The Levi Civita symbol, the unique alternating D-tensor. The \(i_{1},...,i_{D}\) entry of tensor is +1 for a positive parity sequence, -1 for a negative parity sequence, and 0 if any indices are repeated.
Source code in ginjax/geometric/constants.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
get(D: int) -> jnp.ndarray
classmethod
¤
Get the Levi Civita symbol for dimension D from the cache, or creating it on a cache miss
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
D
|
int
|
dimension of the Levi Civita symbol |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
the Levi Civita tensor |
Source code in ginjax/geometric/constants.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
permutation_parity(pi: Sequence[int]) -> int
¤
Code taken from Sympy Permutations: https://github.com/sympy/sympy/blob/26f7bdbe3f860e7b4492e102edec2d6b429b5aaf/sympy/combinatorics/permutations.py#L114 Slightly modified to return 1 for even permutations, -1 for odd permutations, and 0 for repeated digits Permutations of length n must consist of numbers {0, 1, ..., n-1}
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pi
|
Sequence[int]
|
permutation sequence |
required |
Returns:
| Type | Description |
|---|---|
int
|
parity of the permutation |
Source code in ginjax/geometric/constants.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |