GTCompactStore
  • See Also
    • GTAdjacencyMatrix
    • GTTbHamiltonianRS
  • Related Guides
    • Auxiliary
    • The Mathematica Group Theory Package GTPack, V 1.4
  • Tech Notes
    • The tight-binding method
    • See Also
      • GTAdjacencyMatrix
      • GTTbHamiltonianRS
    • Related Guides
      • Auxiliary
      • The Mathematica Group Theory Package GTPack, V 1.4
    • Tech Notes
      • The tight-binding method

GTCompactStore[matrix]

allows to store sparse matrices in a compact form.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Options  
GOCompact  
GOMatrixType  
See Also
Tech Notes
Related Guides
GROUP THEORY SYMBOL
  • See Also
    • GTAdjacencyMatrix
    • GTTbHamiltonianRS
  • Related Guides
    • Auxiliary
    • The Mathematica Group Theory Package GTPack, V 1.4
  • Tech Notes
    • The tight-binding method
    • See Also
      • GTAdjacencyMatrix
      • GTTbHamiltonianRS
    • Related Guides
      • Auxiliary
      • The Mathematica Group Theory Package GTPack, V 1.4
    • Tech Notes
      • The tight-binding method
GroupTheory`
GroupTheory`

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 Falsestore 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 all close all

Basic Examples  (1)

First load the package:

Wolfram Language code: Needs["GroupTheory`"]

A general matrix of size with randomly set elements is constructed.

Wolfram Language code: lm = 20; mat = Table[0, {lm}, {lm}]; Do[ r1 = RandomInteger[{1, lm}]; r2 = RandomInteger[{1, lm}]; mat[[r1, r2]] = k , {k, 1, 25}]

The matrix can be easily visualized.

Wolfram Language code: MatrixPlot[mat, Mesh -> All]

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.

Wolfram Language code: matc = GTCompactStore[mat]

Options  (2)

GOCompact  (1)

As a standard GOCompact is set to False assuming that the matrix should be stored in compact form. Setting the option to True allows to get the matrix back in full form.

Wolfram Language code: matr = GTCompactStore[matc, GOCompact -> True];MatrixPlot[matr, Mesh -> All]

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.

Wolfram Language code: lm = 20; mat = Table[0, {lm}, {lm}]; Do[ r1 = RandomInteger[{1, lm}]; r2 = RandomInteger[{1, lm}]; mat[[r1, r2]] = k; mat[[r2, r1]] = k , {k, 1, 10}]
Wolfram Language code: MatrixPlot[mat, Mesh -> All]

Store the matrix in compact form assuming, that it is a general matrix:

Wolfram Language code: matc = GTCompactStore[mat]

Use, that the matrix is symmetric:

Wolfram Language code: matcs = GTCompactStore[mat, GOMatrixType -> "Symmetric"]

If the matrix is stored with symmety information, you will get only one triangle, if GOMatrixType is not used.

Wolfram Language code: matr = GTCompactStore[matcs, GOCompact -> True];MatrixPlot[matr, Mesh -> All]

If the information on the matrix type is given, the full matrix is reconstructed.

Wolfram Language code: matr = GTCompactStore[matcs, GOCompact -> True, GOMatrixType -> "Symmetric"];MatrixPlot[matr, Mesh -> All]

See Also

GTAdjacencyMatrix  GTTbHamiltonianRS

Tech Notes

    ▪
  • The tight-binding method

Related Guides

    ▪
  • Auxiliary
  • ▪
  • The Mathematica Group Theory Package GTPack, V 1.4
Not Found - Wolfram Cloud