# sparse¶

Classes

 FlatHermitianOperator(npc_matvec, leg, dtype) Hermitian variant of FlatLinearOperator. FlatLinearOperator(npc_matvec, leg, dtype[, …]) Square Linear operator acting on numpy arrays based on a matvec acting on npc Arrays. NpcLinearOperator Prototype for a Linear Operator acting on Array. NpcLinearOperatorWrapper(orig_operator) Base class for wrapping around another NpcLinearOperator. OrthogonalNpcLinearOperator(orig_operator, …) Replace H -> P H P with the projector P = 1 - sum_o |o>

Module description

Providing support for sparse algorithms (using matrix-vector products only).

Some linear algebra algorithms, e.g. Lanczos, do not require the full representations of a linear operator, but only the action on a vector, i.e., a matrix-vector product matvec. Here we define the strucuture of such a general operator, NpcLinearOperator, as it is used in our own implementations of these algorithms (e.g., lanczos). Moreover, the FlatLinearOperator` allows to use all the scipy sparse methods by providing functionality to convert flat numpy arrays to and from np_conserved arrays.