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¶
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 of multi-indices .
Basis shapes must be immutable objects.
-
__str__
()[source]¶ Returns: A string describing the basis shape . 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 of the non-extended basis set .
Raise: NotImplementedError
Abstract interface.
-
__contains__
(k)[source]¶ Checks if a given multi-index is part of the basis set .
Raise: NotImplementedError
Abstract interface.
-
contains
(k)[source]¶ Checks if a given multi-index is part of the basis set .
Parameters: k (tuple) – The multi-index we want to test. Raise: NotImplementedError
Abstract interface.
-
find_largest_index
()[source]¶ Find the index with maximal distance 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 of the basis. The size is the number of distinct multi-indices that belong to the basis .
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 of the basis shape . This is defined as the number of components each multi-index 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 . A direct neighbours is defines as .
Parameters: - k (tuple) – The multi-index of which we want to get the neighbours.
- direction (int) – The direction in which we want to find the neighbours .
Returns: A list containing the pairs .
Raise: NotImplementedError
Abstract interface.
-
get_node_iterator
(mode='lex')[source]¶ Returns an iterator to iterate over all basis elements .
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.
-