graph2mat.Formats

class graph2mat.Formats[source]

Bases: object

Class holding all known formats.

These are referenced by the conversion manager to understand what a function converts from and to.

Methods

add_alias(fmt, *aliases)

Add an alias for a format.

string_to_attr_name(format_string)

Get the attribute name that corresponds to a given format string.

Attributes

BASISCONFIGURATION

The format for graph2mat's BasisConfiguration class.

BASISMATRIX

The format for graph2mat's BasisMatrix.

BASISMATRIXDATA

The format for graph2mat's BasisMatrixData class

BLOCK_DICT

The format for a row block dictionary.

NODESEDGES

Pseudoformat, arrays for edge and node values, without a container.

NUMPY

Numpy array

ORBITALCONFIGURATION

The format for graph2mat's OrbitalConfiguration class.

SCIPY_COO

Scipy sparse COO matrix/array

SCIPY_CSR

Scipy sparse CSR matrix/array

SISL

Sisl SparseOrbital class

SISL_DM

Sisl DensityMatrix class

SISL_EDM

Sisl EnergyDensityMatrix class

SISL_GEOMETRY

Sisl Geometry class, doesn't contain matrix information.

SISL_H

Sisl Hamiltonian class

SISL_SILE

Pseudoformat, path to a file from which sisl can read a matrix's data.

TORCH

Torch tensor

TORCH_BASISMATRIXDATA

The format for graph2mat's TorchBasisMatrixData class.

TORCH_COO

Torch sparse COO tensor

TORCH_CSR

Torch sparse CSR tensor

TORCH_NODESEDGES

Pseudoformat, same as NODESEDGES but in torch tensors.

BASISCONFIGURATION = 'basisconfiguration'

The format for graph2mat’s BasisConfiguration class.

BASISMATRIX = 'basismatrix'

The format for graph2mat’s BasisMatrix.

BASISMATRIXDATA = 'basismatrixdata'

The format for graph2mat’s BasisMatrixData class

BLOCK_DICT = 'block_dict'

The format for a row block dictionary.

NODESEDGES = 'nodesedges'

Pseudoformat, arrays for edge and node values, without a container.

NUMPY = 'numpy'

Numpy array

ORBITALCONFIGURATION = 'orbitalconfiguration'

The format for graph2mat’s OrbitalConfiguration class.

SCIPY_COO = 'scipy_coo'

Scipy sparse COO matrix/array

SCIPY_CSR = 'scipy_csr'

Scipy sparse CSR matrix/array

SISL = 'sisl'

Sisl SparseOrbital class

SISL_DM = 'sisl_DM'

Sisl DensityMatrix class

SISL_EDM = 'sisl_EDM'

Sisl EnergyDensityMatrix class

SISL_GEOMETRY = 'sisl_geometry'

Sisl Geometry class, doesn’t contain matrix information.

SISL_H = 'sisl_H'

Sisl Hamiltonian class

SISL_SILE = 'sisl_sile'

Pseudoformat, path to a file from which sisl can read a matrix’s data.

TORCH = 'torch'

Torch tensor

TORCH_BASISMATRIXDATA = 'torch_basismatrixdata'

The format for graph2mat’s TorchBasisMatrixData class.

TORCH_COO = 'torch_coo'

Torch sparse COO tensor

TORCH_CSR = 'torch_csr'

Torch sparse CSR tensor

TORCH_NODESEDGES = 'torch_nodesedges'

Pseudoformat, same as NODESEDGES but in torch tensors.

classmethod add_alias(fmt: str, *aliases: Any)[source]

Add an alias for a format.

Parameters:
  • fmt – The format name.

  • aliases – The aliases that will be associated with the format. They don’t need to be strings, they can be e.g. a class.

classmethod string_to_attr_name(format_string: str) str[source]

Get the attribute name that corresponds to a given format string.

This function is quite slow.

Parameters:

format_string – The format string.

Returns:

The attribute name.

Return type:

attr_name