fulqrum.core.CSRLinearOperator¶
- class CSRLinearOperator(*args, **kwargs)[source]¶
A SciPy LinearOperator wrapper for a CSR array. Allows for parallel computation of the sparse-matrix vector product needed for eigensolving.
Methods
matvec(x)Matrix-vector multiplication.
Attributes
HHermitian adjoint.
TTranspose.
An estimate of the raw memory size of the underlying CSR array in bytes
Number of nonzero elements in the underlying CSR matrix
ndim- matvec(x)[source]¶
Matrix-vector multiplication.
Applies
Ato x, whereAis anMxNlinear operator (or batch of linear operators) and x is a row vector (or batch of such vectors).- Parameters:
x ({matrix, ndarray}) –
An array with shape
(..., N)representing a row vector (or batch of row vectors).Added in version 1.18.0: A
FutureWarningis emitted for column vector input of shape(N, 1), for which an array with shape(M, 1)is returned. matmat can be called instead for identical behaviour on such input.- Returns:
y – An array with shape
(..., M).- Return type:
{matrix, ndarray}
Notes
This method wraps the user-specified
matvecroutine or overridden_matvecmethod to ensure that y has the correct shape and type.
- property memory_size¶
An estimate of the raw memory size of the underlying CSR array in bytes
- Returns:
Memory size in bytes
- Return type:
int
- property nnz¶
Number of nonzero elements in the underlying CSR matrix
- Returns:
int