张量计算比较繁琐,尤其是广义相对论和黎曼几何结合起来的计算更是冗繁。好在现在已经出现了很多计算张量的工具包。吴老师使用Maple的 GRTenser 计算,我打算看看针对 Mathematica 的 EDC and RGTC。

EDC and RGTC,即 Riemannian Geometry & Tensor Calculus @ Mathematica,链接:http://www.inp.demokritos.gr/~sbonano/RGTC/

Download RGTC (Version 3.8.9 – May 2013)

  • Download all files – compressed: .sit format (100 KB), .zip format (135 KB)
  • Uncompressed files (~1000 KB):  RGTC.nb  —  OperatorPLT.nb  —  NPsymbolPLT.nb  —  EDCRGTCcode.m. (Only the combined matrixEDC and RGTC code in package format is included — it must be placed in an appropriate directory).
  • Note: RGTC cannot be used for calculations with abstract tensors (manipulation of tensor expressions with abstract indices). It only operates on explicit tensors (nested lists of components which are functions of the coordinates). For abstract calculations try the package xTensor.

Additional Examples can be found here.

英文版维基百科的介绍如下(来自 Tensor software https://en.wikipedia.org/wiki/Tensor_software),红色字体是和广义相对论计算有关的工具,我专门标注了出来。


Standalone software

  • SPLATT[1] is an open source software package for high-performance sparse tensor factorization. SPLATT ships a stand-alone executable, C/C++ library, and Octave/MATLABAPI.
  • Cadabra[2] is a computer algebra system (CAS) designed specifically for the solution of problems encountered in field theory. It has extensive functionality for tensor polynomial simplification including multi-term symmetries, fermions and anti-commuting variables, Clifford algebras and Fierz transformations, implicit coordinate dependence, multiple index types and many more. The input format is a subset of TeX. Both a command-line and a graphical interface are available.
  • Tela[3] is a software package similar to Matlab and (GNU) Octave, but designed specifically for tensors.

Software for use with Mathematica

  • Tensor[4] is a tensor package written for the Mathematica system. It provides many functions relevant for General Relativity calculations in general Riemann-Cartan geometries.
  • Ricci[5] is a system for Mathematica 2.x and later for doing basic tensor analysis, available for free.
  • TTC[6] Tools of Tensor Calculus is a Mathematica package for doing tensor and exterior calculus on differentiable manifolds.
  • EDC and RGTC,[7] “Exterior Differential Calculus” and “Riemannian Geometry & Tensor Calculus,” are free Mathematica packages for tensor calculus especially designed but not only for general relativity.
  • Tensorial[8] “Tensorial 4.0” is a general purpose tensor calculus package for Mathematica.
  • xAct:[9] Efficient Tensor Computer Algebra for Mathematica. xAct is a collection of packages for fast manipulation of tensor expressions.
  • GREAT[10] is a free package for Mathematica that computes the Christoffel connection and the basic tensors of General Relativity from a given metric tensor.
  • Atlas 2 for Mathematica[11] is a powerful Mathematica toolbox which allows to do a wide range of modern differential geometry calculations
  • GRTensorM[12] is a computer algebra package for performing calculations in the general area of differential geometry.
  • MathGR[13] is a package to manipulate tensor and GR calculations with either abstract or explicit indices, simplify tensors with permutational symmetries, decompose tensors from abstract indices to partially or completely explicit indices and convert partial derivatives into total derivatives.
  • TensoriaCalc[14] is a tensor calculus package written for Mathematica 9 and higher, aimed at providing user-friendly functionality and a smooth consistency with the Mathematica language itself. As of January 2015, given a metric and the coordinates used, TensoriaCalc can compute Christoffel symbols, the Riemann curvature tensor, and Ricci tensor/scalar; it allows for user-defined tensors and is able to perform basic operations such as taking the covariant derivatives of tensors. TensoriaCalc is continuously under development due to time constraints faced by its inventor/developer.

Software for use with Maple

  • GRTensorII[15] is a computer algebra package for performing calculations in the general area of differential geometry.
  • Atlas 2 for Maple[16] is a modern differential geometry for Maple.
  • DifferentialGeometry[17] is a package which performs fundamental operations of calculus on manifolds, differential geometry, tensor calculus, General Relativity, Lie algebras, Lie groups, transformation groups, jet spaces, and the variational calculus. It is included with Maple.

Software for use with Matlab

Software for use with Maxima

Maxima[23] is a free open source general purpose computer algebra system which includes several packages for tensor algebra calculations in its core distribution. It is particularly useful for calculations with abstract tensors, i.e., when one wishes to do calculations without defining all components of the tensor explicitly. It comes with three tensor packages:[24]

  • itensor for abstract (indicial) tensor manipulation,
  • ctensor for component-defined tensors, and
  • atensor for algebraic tensor manipulation.

Software for use with R

  • Tensor[25] is an R package for basic tensor operations.
  • rTensor[26] provides several tensor decomposition approaches.
  • tensorBF[27] is an R package for Bayesian Tensor decomposition.
  • MTF[28] Bayesian Multi-Tensor Factorization for data fusion and Bayesian versions of Tensor PCA and Tensor CCA. Software: MTF

Libraries

  • Redberry[29] is an open source computer algebra system designed for symbolic tensor manipulation. Redberry provides common tools for expression manipulation, generalized on tensorial objects, as well as tensor-specific features: indices symmetries, LaTeX-style input, natural dummy indices handling, multiple index types etc. The HEP package includes tools for Feynman diagrams calculation: Dirac and SU(N) algebra, Levi-Civita simplifications, tools for calculation of one-loop counterterms etc. Redberry is written in Java and provides extensive Groovy-based programming language.
  • libxm[30] is a lightweight distributed-parallel tensor library written in C.
  • FTensor[31] is a high performance tensor library written in C++.
  • TL[32] is a multi-threaded tensor library implemented in C++ used in Dynare++. The library allows for folded/unfolded, dense/sparse tensor representations, general ranks (symmetries). The library implements Faa Di Bruno formula and is adaptive to available memory. Dynare++ is a standalone package solving higher order Taylor approximations to equilibria of non-linear stochastic models with rational expectations.
  • vmmlib[33] is a C++ linear algebra library that supports 3-way tensors, emphasizing computation and manipulation of several tensor decompositions.
  • Spartns[34] is a Sparse Tensor framework for Common Lisp.
  • FAstMat[35] is a thread-safe general tensor algebra library written in C++ and specially designed for FEM/FVM/BEM/FDM element/edge wise computations.
  • Cyclops Tensor Framework [36] is a distributed memory library for efficient decomposition of tensors of arbitrary type and parallel MPI+OpenMP execution of tensor contractions/functions.
  • TiledArray[37] is a scalable, block-sparse tensor library that is designed to aid in rapid composition of high-performance algebraic tensor equation. It is designed to scale from a single multicore computer to a massively-parallel, distributed-memory system.
  • libtensor [38] is a set of performance linear tensor algebra routines for large tensors found in post-Hartree-Fock methods in quantum chemistry.
  • ITensor [39] features automatic contraction of matching tensor indices. It is written in C++ and has higher-level features for quantum physics algorithms based on tensor networks.
  • Fastor [40] is a high performance C++ tensor algebra library that supports tensors of any arbitrary dimensions and all their possible contraction and permutation thereof. It employs compile-time graph search optimisations to find the optimal contraction sequence between arbitrary number of tensors in a network. It has high level domain specific features for solving nonlinear multiphysics problem using FEM.
  • Xerus [41] is a C++ tensor algebra library for tensors of arbitrary dimensions and tensor decomposition into general tensor networks (focusing on matrix product states). It offers Einstein notation like syntax and optimizes the contraction order of any network of tensors at runtime so that dimensions need not be fixed at compile-time.

我对广义相对论的很多计算并不是很清楚,基本上也没怎么计算过度规、张量、四维电磁势等等东西,只是在现成的度规下开始做黑洞解,然后算一些温度、熵,深一些就做一些泰勒展开,或者用一下留数定理等,对张量的完整计算并不熟悉。

吴老师使用Maple的GRTenser张量包来计算黑洞相关的解,效果非常好,只可惜我没用过Maple,也不是很懂这个软件。对于Mathematica用的稍微多一点的我,在网上找到了一些书,这些书基本上是外文图书,但是内容都很不错。突然感叹,外国人虽少,但对某一点是真专注,再小众也有人做的非常深非常好,佩服。

这是在亚马逊搜索到的图书:查看链接

我下载了几本电子书,感觉还可以,放到这里可以下载:

MATHEMATICA全书(第4版).pdf
Mathmatica for theoretical physics I.pdf
Mathmatica for theoretical physics II.pdf

今天在国际在线网站上出现一个新闻:西班牙上千只鸟集体飞舞 铺天盖地仿佛龙卷风。其中鸟群的变换依然是那么迷人。

鸟群是由一个个独立的个体组成,但是它们在整体上似乎就像烟雾一样,临近的个体只是随着邻居的动作而变化,不会突然出现拐点。这在数学上就是一个光滑曲线。

但是,从微观上看,鸟与鸟之间是有间隙的,这个曲线可以说是分段函数,定义域是不连续的。即在数值上是离散的。

这些离散数值却构成连续曲线,它们的关系自然有另外的函数来约束。

自然界中的宏观变化似乎也跟这个很像。比如烟或水蒸气。都是由小颗粒组成,但是却是连续变化的。这些烟雾颗粒之间并不像鸟群一样有什么判断力,它们只随物理定律和空气扰动而变化。但是在观感上与鸟群看起来很像。当然只是很像,鸟群可以用粒子群优化算法来模拟,而烟雾用流体力学来模拟,但二者之间有没有其他联系呢?

另外,随机游走时,让比邻的数据之间移动方式相关联,是不是也会产生随机性的“烟雾”或“鸟群”呢?