# SquareComplexMatrix¶

class SquareComplexMatrix(*args)

Complex square matrix.

Parameters:
sizeint, , optional

Matrix size. Default is 1.

valuessequence of complex with size , 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. Accessor to the conjugate complex matrix. Accessor to the transposed conjugate complex matrix. Accessor to the object's name. getId() Accessor to the object's id. Accessor to the underlying implementation. getName() Accessor to the object's name. Accessor to the number of columns. 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. Accessor to the transposed complex matrix.
 getDimension solveLinearSystem solveLinearSystemInPlace
__init__(*args)
clean(threshold)

Clean the matrix according to a specific threshold.

Parameters:
thresholdpositive float

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

conjugate()

Accessor to the conjugate complex matrix.

Returns:
NComplexMatrix

The conjugate matrix of size associated with the given complex matrix such as .

conjugateTranspose()

Accessor to the transposed conjugate complex matrix.

Returns:
NComplexMatrix

The transposed conjugate matrix of size associated with the given complex matrix such as .

getClassName()

Accessor to the object’s name.

Returns:
class_namestr

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

getId()

Accessor to the object’s id.

Returns:
idint

Internal unique identifier.

getImplementation()

Accessor to the underlying implementation.

Returns:
implImplementation

A copy of the underlying implementation object.

getName()

Accessor to the object’s name.

Returns:
namestr

The name of the object.

getNbColumns()

Accessor to the number of columns.

Returns:
ncinteger

The number of columns of .

getNbRows()

Accessor to the number of rows.

Returns:
nrinteger

The number of rows of .

imag()

Accessor to the imaginary part.

Returns:
imatMatrix

A real matix of size such .

isEmpty()

Test whether the matrix is empty or not.

Returns:
isEmptybool

Flag telling whether the dimensions of the matrix is zero.

real()

Accessor to the real part.

Returns:
rmatMatrix

A real matix of size such .

setName(name)

Accessor to the object’s name.

Parameters:
namestr

The name of the object.

transpose()

Accessor to the transposed complex matrix.

Returns:
NComplexMatrix

The transposed matrix of size associated with the given complex matrix such as .

## Examples using the class¶

Create a spectral model

Create a spectral model