SquareComplexMatrix

class SquareComplexMatrix(*args)

Complex square matrix.

Parameters:

size : int, n > 0, optional

Matrix size. Default is 1.

values : sequence of complex with size n^2, optional

Values. OpenTURNS uses column-major ordering (like Fortran) for reshaping the flat list of values. Default creates a zero matrix.

Examples

Create a matrix

>>> import openturns as ot
>>> M = ot.SquareComplexMatrix(2, range(2 * 2))
>>> print(M)
[[ (0,0) (2,0) ]
 [ (1,0) (3,0) ]]

Get or set terms

>>> print(M[0, 0])
0j
>>> M[0, 0] = 1.0
>>> print(M[0, 0])
(1+0j)
>>> print(M[:, 0])
[[ (1,0) ]
 [ (1,0) ]]

Create an openturns matrix from a square numpy 2d-array (or matrix, or 2d-list)…

>>> import numpy as np
>>> np_2d_array = np.array([[1.0, 2.0], [3.0, 4.0]])
>>> ot_matrix = ot.SquareComplexMatrix(np_2d_array)

and back

>>> np_matrix = np.matrix(ot_matrix)

Methods

clean(threshold) Clean the matrix according to a specific threshold.
conjugate() Accessor to the conjugate complex matrix.
conjugateTranspose() Accessor to the transposed conjugate complex matrix.
getClassName() Accessor to the object’s name.
getDimension()
getId() Accessor to the object’s id.
getImplementation(*args) Accessor to the underlying implementation.
getName() Accessor to the object’s name.
getNbColumns() Accessor to the number of columns.
getNbRows() Accessor to the number of rows.
imag() Accessor to the imaginary part.
isEmpty() Test whether the matrix is empty or not.
real() Accessor to the real part.
setName(name) Accessor to the object’s name.
solveLinearSystem(*args)
transpose() Accessor to the transposed complex matrix.
__init__(*args)

x.__init__(…) initializes x; see help(type(x)) for signature

clean(threshold)

Clean the matrix according to a specific threshold.

Parameters:

threshold : positive float

Numerical sample which is the collection of points stored by the history strategy.

conjugate()

Accessor to the conjugate complex matrix.

Returns:

N : ComplexMatrix

The conjugate matrix \mat{N} of size n_r \times n_c associated with the given complex matrix \mat{M} such as N_{i, j} = \overline{M}_{i, j}.

conjugateTranspose()

Accessor to the transposed conjugate complex matrix.

Returns:

N : ComplexMatrix

The transposed conjugate matrix \mat{N} of size n_c \times n_r associated with the given complex matrix \mat{M} such as N_{i, j} = \overline{M}_{j, i}.

getClassName()

Accessor to the object’s name.

Returns:

class_name : str

The object class name (object.__class__.__name__).

getId()

Accessor to the object’s id.

Returns:

id : int

Internal unique identifier.

getImplementation(*args)

Accessor to the underlying implementation.

Returns:

impl : Implementation

The implementation class.

getName()

Accessor to the object’s name.

Returns:

name : str

The name of the object.

getNbColumns()

Accessor to the number of columns.

Returns:

nc : integer

The number of columns of \mat{M}.

getNbRows()

Accessor to the number of rows.

Returns:

nr : integer

The number of rows of \mat{M}.

imag()

Accessor to the imaginary part.

Returns:

imat : Matrix

A real matix \mat{A} of size n_r \times n_c such A_{i, j} = \mathrm{Im} (M_{i, j}).

isEmpty()

Test whether the matrix is empty or not.

Returns:

isEmpty : bool

Flag telling whether the dimensions of the matrix is zero.

real()

Accessor to the real part.

Returns:

rmat : Matrix

A real matix \mat{A} of size n_r \times n_c such A_{i, j} = \mathrm{Re} (M_{i, j}).

setName(name)

Accessor to the object’s name.

Parameters:

name : str

The name of the object.

transpose()

Accessor to the transposed complex matrix.

Returns:

N : ComplexMatrix

The transposed matrix \mat{N} of size n_c \times n_r associated with the given complex matrix \mat{M} such as N_{i, j} = M_{j, i}.