symmray.sparse.sparse_vector ============================ .. py:module:: symmray.sparse.sparse_vector .. autoapi-nested-parse:: Sparse backend block vector class. Classes ------- .. autoapisummary:: symmray.sparse.sparse_vector.BlockVector Module Contents --------------- .. py:class:: BlockVector(blocks) Bases: :py:obj:`symmray.sparse.sparse_data_common.BlockCommon`, :py:obj:`symmray.vector_common.VectorCommon`, :py:obj:`symmray.common.SymmrayCommon` Class for storing block vectors with sparse storage, e.g. for the singular- or eigen- values of a matrix. This is equivalent to the diagonal of a zero charge abelian matrix. :param blocks: A dictionary mapping sector keys to array blocks. :type blocks: dict .. py:attribute:: __slots__ :value: ('_blocks',) .. py:attribute:: ndim :value: 1 .. py:method:: copy() .. py:property:: size The total size of all elements in the vector. .. py:property:: shape Get the effective shape of the vector. .. py:method:: _binary_blockwise_op(other, fn, missing=None, inplace=False) .. py:method:: check() Check that the block vector is well formed. .. py:method:: to_flat() Convert the block sparse vector to a flat vector. .. py:method:: to_dense() Convert the block vector to a dense array. .. py:method:: allclose(other, **allclose_opts) .. py:method:: test_allclose(other, **allclose_opts) Like `allclose` but raises an AssertionError with details if not close. .. py:method:: __repr__()