HAT Documentation

Submodules

HAT.Hypergraph module

HAT.HAT module

HAT.draw module

HAT.draw.incidencePlot(H, shadeRows=True, connectNodes=True, dpi=200, edgeColors=None)[source]

Plot the incidence matrix of a hypergraph.

Parameters:
  • H – a HAT.hypergraph object

  • shadeRows – shade rows (bool)

  • connectNodes – connect nodes in each hyperedge (bool)

  • dpi – the resolution of the image (int)

  • edgeColors – The colors of edges represented in the incidence matrix. This is random by default

Returns:

matplotlib axes with figure drawn on to it

HAT.multilinalg module

HAT.multilinalg.hosvd(T, M=True, uniform=False, sym=False)[source]

Higher Order Singular Value Decomposition

Parameters:
  • uniform – Indicates if T is a uniform tensor

  • sym – Indicates if T is a super symmetric tensor

  • M – Indicates if the factor matrices are required as well as the core tensor

Returns:

The singular values of the core diagonal tensor and the factor matrices.

HAT.multilinalg.supersymHosvd(T)[source]

Computes the singular values of a uniform, symetric tensor. See Algorithm 1 in [1].

Parameters:

T – A uniform, symmetric multidimensional array

Returns:

The singular values that compose the core tensor of the HOSVD on T.

References

HAT.multilinalg.HammingSimilarity(A1, A2)[source]

Computes the Spectral-S similarity of 2 Adjacency tensors [1].

Parameters:
  • A1 (ndarray) – adjacency tensor 1

  • A2 (ndarray) – adjacency tensor 2

Returns:

Hamming similarity measure

Return type:

float

References

HAT.multilinalg.SpectralHSimilarity(L1, L2)[source]

Computes the Spectral-S similarity of 2 Laplacian tensors [1].

Parameters:
  • L1 (ndarray) – Laplacian tensor 1

  • L2 (ndarray) – Laplacian tensor 2

Returns:

Spectral-S similarity measure

Return type:

float

References

HAT.multilinalg.kronExponentiation(M, x)[source]

Kronecker Product Exponential.

Parameters:
  • M (ndarray) – a matrix

  • x (int) – power of exponentiation

Returns:

Krnoecker Product exponentiation of M a total of x times

Return type:

ndarray

This function performs the Kronecker Product on a matrix \(M\) a total of \(x\) times. The Kronecker product is defined for two matrices \(A\in\mathbf{R}^{l \times m}, B\in\mathbf{R}^{m \times n}\) as the matrix

\[\begin{split}A \bigotimes B= \begin{pmatrix} A_{1,1}B & A_{1,2}B & \dots & A_{1,m}B \\ A_{2,1}B & A_{2,2}B & \dots & A_{2,m}B \\ \vdots & \vdots & \ddots & \vdots \\ A_{l,1}B & A_{l,2}B & \dots & A_{l,n}B \end{pmatrix}\end{split}\]

Bug Reporting

Please report all bugs or defects in HAT to this page.