張量(Tensor)
張量是矢量和矩陣概念的推廣畴蒲,標(biāo)量是0階張量悠鞍,矢量是1階張量,矩陣是二階張量模燥,而三階張量好比是立方體矩陣咖祭。
張量是一個可用來表示在一些矢量、標(biāo)量和其他張量之間的線性關(guān)系的多線性函數(shù)蔫骂。
形象直觀地來理解張量
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.
符號約定
下標(biāo)標(biāo)記法
求和約定
關(guān)于自由標(biāo)號
同一方程式中么翰,各張量的自由標(biāo)號相同,即同階標(biāo)號字母相同辽旋。
關(guān)于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
度量張量
張量簡史
張量的出現(xiàn)是有原因的浩嫌,因為我們無法用標(biāo)量和向量完整的表示所有的物理量,所以物理學(xué)家使用的數(shù)學(xué)量的概念就必須擴大补胚,所以張量就出現(xiàn)了固该。張量之所以重要,在于它可以滿足一切物理定律必須與坐標(biāo)系的選擇無關(guān)的特性糖儡。
張量(Tensor)是一個定義在一些向量空間和一些對偶空間的笛卡兒積上的多重線性映射伐坏,其坐標(biāo)是|n|維空間內(nèi),有|n|個分量的一種量握联, 其中每個分量都是坐標(biāo)的函數(shù)桦沉, 而在坐標(biāo)變換時,這些分量也依照某些規(guī)則作線性變換金闽。r 稱為該張量的秩或階(與矩陣的秩和階均無關(guān)系)纯露。
在同構(gòu)的意義下,第零階張量 (r = 0) 為標(biāo)量(Scalar)代芜,第一階張量 (r = 1) 為向量(Vector)埠褪, 第二階張量 (r = 2) 則成為矩陣(Matrix)。例如,對于3維空間钞速,r=1時的張量為此向量:(x,y,z)贷掖。由于變換方式的不同,張量分成協(xié)變張量 (Covariant Tensor渴语,指標(biāo)在下者)苹威、逆變張量 (Contravariant Tensor,指標(biāo)在上者)驾凶、 混合張量 (指標(biāo)在上和指標(biāo)在下兩者都有) 三類牙甫。
在數(shù)學(xué)里,張量是一種幾何實體调违,或者說廣義上的“數(shù)量”窟哺。張量概念包括標(biāo)量、向量和線性算子技肩。張量可以用坐標(biāo)系統(tǒng)來表達(dá)脏答,記作標(biāo)量的數(shù)組,但它是定義為“不依賴于參照系的選擇的”亩鬼。張量在物理和工程學(xué)中很重要殖告。例如在擴散張量成像中,表達(dá)器官對于水的在各個方向的微分透性的張量可以用來產(chǎn)生大腦的掃描圖雳锋』萍ǎ可能最重要的工程上的例子就是應(yīng)力張量和應(yīng)變張量了,它們都是二階張量玷过,對于一般線性材料他們之間的關(guān)系由一個四階彈性張量來決定爽丹。
雖然張量可以用分量的多維數(shù)組來表示,張量理論存在的意義在于進(jìn)一步說明把一個數(shù)量稱為張量的涵義辛蚊,而不僅僅是說它需要一定數(shù)量的有指標(biāo)索引的分量粤蝎。特別是,在坐標(biāo)轉(zhuǎn)換時袋马,張量的分量值遵守一定的變換法則初澎。張量的抽象理論是線性代數(shù)分支,現(xiàn)在叫做多重線性代數(shù)虑凛。
“張量”一詞最初由威廉·羅恩·哈密頓在1846年引入碑宴,但他把這個詞用于指代現(xiàn)在稱為模的對象。該詞的現(xiàn)代意義是沃爾德馬爾·福格特在1899年開始使用的桑谍。
這個概念由格雷戈里奧·里奇-庫爾巴斯特羅在1890年在《絕對微分幾何》的標(biāo)題下發(fā)展出來延柠,隨著1900年列維-奇維塔的經(jīng)典文章《絕對微分》(意大利文,隨后出版了其他譯本)的出版而為許多數(shù)學(xué)家所知锣披。隨著1915年左右愛因斯坦的廣義相對論的引入贞间,張量微積分獲得了更廣泛的承認(rèn)贿条。廣義相對論完全由張量語言表述,愛因斯坦從列維-奇維塔本人那里學(xué)了很多張量語言(其實是Marcel Grossman,他是愛因斯坦在蘇黎世聯(lián)邦理工學(xué)院的同學(xué)增热,一個幾何學(xué)家整以,也是愛因斯坦在張量語言方面的良師益友 - 參看Abraham Pais所著《上帝是微妙的(Subtle is the Lord)》),并學(xué)得很艱苦钓葫。但張量也用于其它領(lǐng)域悄蕾,例如連續(xù)力學(xué)票顾,譬如應(yīng)變張量(參看線性彈性)础浮。
注意“張量”一詞經(jīng)常用作張量場的簡寫,而張量場是對流形的每一點給定一個張量值奠骄。要更好的理解張量場豆同,必須首先理解張量的基本思想。
參考資料
https://www.youtube.com/watch?v=f5liqUk0ZTw
https://www.youtube.com/watch?v=e0eJXttPRZI
https://www.zhihu.com/question/23720923