HermitianMatrixQualifier#

class nvmath.linalg.HermitianMatrixQualifier[source]#

A class which constructs and validates matrix_qualifiers_dtype for a hermitian matrix.

Examples

>>> import numpy as np
>>> from nvmath.linalg import (
...     HermitianMatrixQualifier,
...     GeneralMatrixQualifier,
...     matrix_qualifiers_dtype,
... )

Create a hermitian matrix qualifier:

>>> HermitianMatrixQualifier.create()  
array(('he', False, False, 0, 0, 0),
      dtype=[('abbreviation', '<U2'), ('conjugate', '?'), ...

Create a conjugate hermitian matrix qualifier:

>>> HermitianMatrixQualifier.create(conjugate=True)  
array(('he', True, False, 0, 0, 0),
      dtype=[('abbreviation', '<U2'), ('conjugate', '?'), ...

Create an array of matrix qualifiers with one general and one hermitian matrix:

>>> qualifiers = np.full(
...     2,
...     GeneralMatrixQualifier.create(),
...     dtype=matrix_qualifiers_dtype,
... )
>>> qualifiers[1] = HermitianMatrixQualifier.create()
>>> qualifiers  
array([('ge', False, False, 2, 0, 0), ('he', False, False, 0, 0, 0)],
      dtype=[('abbreviation', '<U2'), ('conjugate', '?'), ...

Methods

__init__()[source]#
classmethod create(
conjugate: bool = False,
transpose: bool = False,
uplo: FillMode = FillMode.LOWER,
)[source]#

Return a np.ndarray of type matrix_qualifiers_dtype whose element describes a hermitian matrix.

Parameters:
  • conjugate – Whether the matrix is conjugate.

  • transpose – Whether the matrix is transpose.

  • uplo – The FillMode of the matrix. e.g. upper, lower…

classmethod is_valid(other)[source]#

Return True if all elements of other are valid examples of the matrix_qualifiers_dtype constructed by this class.

classmethod to_string(
other: ndarray[tuple[Any, ...], dtype[_ScalarT]],
) str[source]#

Return a pretty string representation of other.

Attributes

abbreviation: ClassVar[str] = 'he'#