Skip to content

Commit 769da76

Browse files
committed
Other operations
1 parent 345bce2 commit 769da76

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/math/differential-geometry.rst

+21-2
Original file line numberDiff line numberDiff line change
@@ -1352,12 +1352,12 @@ As well as::
13521352
Here A and B are not tensors, they are arrays, but the tensor representation
13531353
works just as well for them.
13541354

1355-
List of tensor operations::
1355+
List of fundamental tensor operations::
13561356

13571357
Product
13581358
Add
13591359
Transpose
1360-
Contraction
1360+
Contract / Contraction
13611361
Assign
13621362
Rank
13631363

@@ -1396,6 +1396,25 @@ Dot proudct :code:`dot_product(A, B)` is represented by
13961396
:code:`Contraction(Product([A, B]), [Rank(A), Rank(A)+1])`, typically
13971397
:code:`Rank(A) == 1`.
13981398

1399+
Rank 0 tensors are scalars. Their value can be used instead of their symbol,
1400+
e.g., 1, 2, -1, $i$, etc. A subtraction of two tensors $A - B$ can thus be
1401+
defined as :code:`Add(A, Product([-1, B]))`, where $-1$ is a scalar tensor of
1402+
rank 0, or to be completely explicit::
1403+
1404+
MinusOne = Tensor("-1", 0)
1405+
Add(A, Product([MinusOne, B]))
1406+
1407+
Using the fundamental tensor operations above we can then build/define many
1408+
other tensor operations::
1409+
1410+
dot_product(A, B) = Contraction(Product([A, B]), [Rank(A), Rank(A)+1])
1411+
matmul(A, B) = Contraction(Product([A, B]), [Rank(A), Rank(A)+1])
1412+
Tr A = Contract(A, [1, 2]) # assuming Rank(A) = 2
1413+
|A| = sqrt(Contract(Product([A,A]), [1, Rank(A)+1], [2, Rank(A)+2], ...
1414+
[Rank(A), 2*Rank(A)]))
1415+
A^n = Product([A, A, ..., A]) # n-times
1416+
Exp(A) = sum_n^oo A^n/n!
1417+
13991418
Examples
14001419
========
14011420

0 commit comments

Comments
 (0)