BasisShape

About the BasisShape class

The WaveBlocks Project

@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016 R. Bourquin @license: Modified BSD License

Inheritance diagram

Inheritance diagram of BasisShape

Class documentation

class WaveBlocksND.BasisShape[source]

This class defines the abstract interface to basis shapes. A basis shape is essentially all information and operations related to the set \mathfrak{K} of multi-indices k.

Basis shapes must be immutable objects.

__init__()[source]
Raise:NotImplementedError Abstract interface.
__str__()[source]
Returns:A string describing the basis shape \mathfrak{K}.
Raise:NotImplementedError Abstract interface.
__hash__()[source]

Implement a custom hash function for basis shapes. This is important for storing wavepackets.

Raise:NotImplementedError Abstract interface.
__iter__()[source]

Implements iteration over the multi-indices k of the non-extended basis set \mathfrak{K}.

Raise:NotImplementedError Abstract interface.
__contains__(k)[source]

Checks if a given multi-index k is part of the basis set \mathfrak{K}.

Raise:NotImplementedError Abstract interface.
contains(k)[source]

Checks if a given multi-index k is part of the basis set \mathfrak{K}.

Parameters:k (tuple) – The multi-index we want to test.
Raise:NotImplementedError Abstract interface.
find_largest_index()[source]

Find the index k \in \mathfrak{K} with maximal distance \sum_{d=0}^D k_d^2 from the zero index. In case of multiple maxima the method returns the first one found.

get_basis_size(extended=False)[source]

Returns the size |\mathfrak{K}| of the basis. The size is the number of distinct multi-indices k that belong to the basis \mathfrak{K}.

Raise:NotImplementedError Abstract interface.
get_description()[source]

Return a description of this basis shape object. A description is a dict containing all key-value pairs necessary to reconstruct the current basis shape. A description never contains any data.

Raise:NotImplementedError Abstract interface.
get_dimension()[source]

Returns the dimension D of the basis shape \mathfrak{K}. This is defined as the number of components each multi-index k = (k_0, \ldots, k_{D-1}) has.

Raise:NotImplementedError Abstract interface.
get_neighbours(k, direction=None)[source]

Returns a list of all multi-indices that are neighbours of a given multi-index k. A direct neighbours is defines as (k_0, \ldots, k_d \pm 1, \ldots, k_{D-1}) \forall d \in [0 \ldots D-1].

Parameters:
  • k (tuple) – The multi-index of which we want to get the neighbours.
  • direction (int) – The direction 0 \leq d < D in which we want to find the neighbours k \pm e_d.
Returns:

A list containing the pairs (d, k^\prime).

Raise:

NotImplementedError Abstract interface.

get_node_iterator(mode='lex')[source]

Returns an iterator to iterate over all basis elements k.

Parameters:mode (string) – The mode by which we iterate over the indices. Default is ‘lex’ for lexicographical order. Supported is also ‘chain’, for the chain-like mode, details see the manual.
Raise:NotImplementedError Abstract interface.