symmray.sparse.sparse_abelian_array

Abelian symmetric arrays with block sparse backend.

Classes

AbelianArray

A block sparse array with symmetry constraints.

Z2Array

A block array with Z2 symmetry.

U1Array

A block array with U1 symmetry.

Z2Z2Array

A block array with Z2 x Z2 symmetry.

U1U1Array

A block array with U1 x U1 symmetry.

Module Contents

class symmray.sparse.sparse_abelian_array.AbelianArray(indices, charge=None, blocks=(), symmetry=None, label=None)[source]

Bases: symmray.sparse.sparse_array_common.SparseArrayCommon, symmray.sparse.sparse_data_common.BlockCommon, symmray.bosonic_common.BosonicCommon, symmray.array_common.ArrayCommon, symmray.common.SymmrayCommon

A block sparse array with symmetry constraints.

Parameters:
  • indices (tuple[BlockIndex]) – The indices of the array.

  • charge (hashable, optionals) – The total charge of the array, if not given it will be inferred from either the first sector or set to the identity charge, if no sectors are given.

  • blocks (dict[tuple[hashable], array_like]) – A mapping of each ‘sector’ (tuple of charges) to the data array.

  • symmetry (str or Symmetry, optional) – The symmetry of the array, if not using a specific symmetry class.

__slots__ = ('_blocks', '_charge', '_indices', '_label', '_symmetry')
fermionic = False
static_symmetry = None
new_with(indices, charge, blocks, label=None) AbelianArray[source]

Create a new block sparse abelian array of the same class as this one. Unlike copy, this does not copy over any existing data and drops for example label.

copy()[source]

Copy this abelian block sparse array.

copy_with(indices=None, charge=None, blocks=None)[source]

A copy of this block array with some attributes replaced. Note that checks are not performed on the new properties, this is intended for internal use.

modify(indices=None, charge=None, blocks=None)[source]

Modify this block array in place with some attributes replaced. Note that checks are not performed on the new properties, this is intended for internal use.

classmethod from_pytree(pytree)[source]

Create a sparse abelian array from a pytree purely of non-symmray containers and objects.

_map_blocks(fn_block=None, fn_sector=None, fn_filter=None)[source]

Map the blocks and their keys (sectors) of the array inplace.

solve(b: AbelianArray, **kwargs) AbelianArray[source]

Solve the linear system A @ x == b for x, where A is this array.

Parameters:

b (AbelianArray) – The right-hand side array.

Returns:

x – The solution array.

Return type:

AbelianArray

class symmray.sparse.sparse_abelian_array.Z2Array(indices, charge=None, blocks=(), symmetry=None, label=None)[source]

Bases: AbelianArray

A block array with Z2 symmetry.

static_symmetry
to_pyblock3(flat=False)[source]
class symmray.sparse.sparse_abelian_array.U1Array(indices, charge=None, blocks=(), symmetry=None, label=None)[source]

Bases: AbelianArray

A block array with U1 symmetry.

static_symmetry
to_pyblock3(flat=False)[source]
to_yastn(**config_opts)[source]
class symmray.sparse.sparse_abelian_array.Z2Z2Array(indices, charge=None, blocks=(), symmetry=None, label=None)[source]

Bases: AbelianArray

A block array with Z2 x Z2 symmetry.

static_symmetry
class symmray.sparse.sparse_abelian_array.U1U1Array(indices, charge=None, blocks=(), symmetry=None, label=None)[source]

Bases: AbelianArray

A block array with U1 x U1 symmetry.

static_symmetry