SymmetricMatrixQualifier#

class nvmath.linalg.SymmetricMatrixQualifier[source]#

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

Examples

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

Create a symmetric matrix qualifier:

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

Create a conjugate symmetric matrix qualifier:

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

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

>>> qualifiers = np.full(
...     2,
...     GeneralMatrixQualifier.create(),
...     dtype=matrix_qualifiers_dtype,
... )
>>> qualifiers[1] = SymmetricMatrixQualifier.create()
>>> qualifiers  
array([('ge', False, False, 2, 0, 0), ('sy', 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 symmetric 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] = 'sy'#