Tensor
A tensor is an extension of the concept of a vector and a matrix. A scalar is a zero-order tensor, a vector is a first-order tensor, a matrix is a second-order tensor, and a third-order tensor is like a cube matrix.
A tensor is a multilinear function that can be used to express the linear relationship between some vectors, scalars, and other tensors.
There is a reason for the emergence of tensors, because we cannot completely represent all physical quantities with scalars and vectors, so the concept of mathematical quantities used by physicists must be expanded, so tensors appear. The reason why a tensor is important is that it can satisfy all physical laws that must be independent of the choice of coordinate system.
Tensor (the Tensor) is defined in a vector space, and some number of dual space is the Cartesian product of multilinear map on which coordinates | n- | dimensional space, there is | n- | a component amount of one, wherein each of Each component is a function of coordinates , and during coordinate transformation, these components are also linearly transformed according to certain rules . r is called the rank or order of the tensor (it has nothing to do with the rank and order of the matrix ).
In the sense of isomorphism , the zeroth order tensor (r = 0) is a scalar (Scalar), the first order tensor (r = 1) is a vector (Vector), and the second order tensor (r = 2) is Become a matrix (Matrix). For example, for a 3 -dimensional space , the tensor when r=1 is this vector: (x, y, z). Due to the different transformation methods, tensors are divided into covariant tensors (Covariant Tensor, index in the lower), contravariant tensor (Contravariant Tensor, index in the upper), mixed tensor (indicator at the top and index at the bottom) ) Three categories.
In mathematics , a tensor is a geometric entity, or "quantity" in a broad sense. The concept of tensor includes scalar, vector and linear operator. A tensor can be expressed in a coordinate system, denoted as an array of scalars, but it is defined as "independent of the choice of the reference system". Tensors are very important in physics and engineering. For example, in diffusion tensor imaging, a tensor expressing the differential permeability of the organ to water in various directions can be used to generate a scan of the brain. Perhaps the most important engineering example is the stress tensor and strain tensor. They are both second-order tensors. For general linear materials, the relationship between them is determined by a fourth-order elastic tensor.
Although tensors can be represented by multi-dimensional arrays of components, the significance of tensor theory is to further illustrate the meaning of calling a quantity a tensor, not just that it requires a certain number of indexed components. In particular, during coordinate transformation , the component values of tensors obey certain transformation rules. The abstract theory of tensors is a branch of linear algebra , now called multilinear algebra .
The term "tensor" was first introduced by William Ron Hamilton in 1846 , but he used the term to refer to objects now called modules . The modern meaning of the word was first used by Waldemar Vogt in 1899 .
This concept was developed by Gregorio Ricci-Culbastro in 1890 under the heading "Absolute Differential Geometry", following Levi-Civita's classic article "Absolute Differential" in 1900 ( It is known to many mathematicians that it was published in Italian, and other translations were subsequently published. With the introduction of Einstein 's general theory of relativity around 1915, tensor calculus gained wider recognition. General relativity is completely expressed by tensor language. Einstein learned a lot of tensor language from Levi-Civita himself (actually Marcel Grossman, he was a classmate of Einstein at ETH Zurich , a geometer) , Is also Einstein's mentor and helpful friend in tensor language-see "Subtle is the Lord" by Abraham Pais), and learned very hard. But tensors are also used in other fields, such as continuous mechanics, such as strain tensors (see linear elasticity ).
Note that the term "tensor" is often used as a tensor field abbreviated, and tensor field is a manifold of a given magnitude at each point Zhang. To better understand the tensor field, you must first understand the basic idea of tensor.
Visually and intuitively understand tensors
Below is the diagram that describes the Tensor's dimensions in a very efficient way.
Now let's get a little bit knowledge about the notation of Tensors
The tensor notation is similar to the metrics notation. A capital letter represents the tensor, and the lower letter with subscript integer represents scalar values within the tensor.
符号约定
下标标记法
求和约定
关于自由标号
同一方程式中,各张量的自由标号相同,即同阶标号字母相同。
关于Kronecker delta (δij)符号
张量的基本运算
https://www.cnblogs.com/arxive/p/4967486.html
引力场
https://dev.to/juancarlospaco/tensors-for-busy-people-315k
How it looks like on Code?.
letmyscalar=42
Scalar can be a variety of things, usually numeric values, to keep things simple and easy to understand we will use an integer here, 42 is our Scalar.
letmyvector=[1,2,3]
Vector is a collection of items, we continue using integers, it can be seen on the code as an array or list, you can draw it as a Rank 1 Vector.
letmymatrix=[[1,2,3],[4,5,6],]
We continue adding dimensions then we end up with the Matrix, a 2D Tensor, can be simplified on code as a list with lists inside.
letmytensor=[[[1,2,3],[4,5,6],],[[7,8,9],[10,11,12],],]
Wow, we reached the crazy cube, a multiple dimensions array of integers,
we need to convert this jam of lists into a Tensor object!.
importarraymancerletmytensor=[[[1,2,3],[4,5,6],],[[7,8,9],[10,11,12],],].toTensor
Done, congrats you coded your first Tensor!.
Tensor can be categorized by rank, i.e. how many "rows and columns they have."
Rank 0: Scalar/Number
Rank 1: Vector
Rank 2: NxN matrix
Rank >= 3: Tensor
I did a visualization of these ranks below
Why are tensors important though?
Well, engineers use them a lot when dealing with the forces and stresses on an object.
Relativists use them to package equations like the Einstein Field Equations which would otherwise be (4x4)16 equations! Wow!
How many equations do you think the Riemann Curvature Tensor below can package?
In the field of Physics and Engineering, as a tool, tensor and tensor algebra widely used. We can say it is a set of techniques in machine learning in the operation and training of deep learning models can be described regarding tensors.
Dot product of two 4D tensors
https://discuss.pytorch.org/t/dot-product-of-two-4d-tensors/69555
度量张量
参考资料
https://www.youtube.com/watch?v=f5liqUk0ZTw
https://www.youtube.com/watch?v=e0eJXttPRZI
https://www.zhihu.com/question/23720923