GTCompactStore
GTCompactStore[matrix]
allows to store sparse matrices in a compact form.
Details and Options
- Tight-binding Hamiltionians in real space are represented by large matrices. If a limited interaction radius of the atoms is considered the matrices are sparse. GTCompactStore is used especially in the calculation of the adjacency matrix. GTCompactStore only stores the non-zero elements and the position of those elements. The full matrix can be restored.
- The following options can be given:
-
GOCompact False store matrix in compact form GOMatrixType "General" type of the matrix - See: W. Hergert, M. Geilhufe, Group Theory in Solid State Physics and Photonics. Problem Solving with Mathematica, chapter 9.7.3
Examples
open allclose allBasic Examples (1)
A general matrix of size with randomly set elements is constructed.
The matrix can be easily visualized.
Only non-zero elements are stored in the compact storage format. At first the dimension is given in the list. All nonzero elements follow. The last list contains the positions of the non-zero elements.
Options (2)
GOCompact (1)
GOMatrixType (1)
If the matrix is symmetric even less information has to be stored in the compact format. First, a symmetric matrix, randomly occupied, is generated.
Store the matrix in compact form assuming, that it is a general matrix:
Use, that the matrix is symmetric:
If the matrix is stored with symmety information, you will get only one triangle, if GOMatrixType is not used.
If the information on the matrix type is given, the full matrix is reconstructed.