Filters¶
The Filters
class is defined below.
The WaveletFilters
class inherits from the previous class and
is specific to Daubechies wavelets, where a so-called magic filter has
to be defined, in addition to the gradient and laplacian filters.
Both classes are used to define some families of filters:
- FD2_filters, for the Finite Difference filters of order 2,
- FD8_filters, for the Finite Difference filters of order 8,
- Sym8_filters, for a family of Daubechies wavelets filters.
These three families of filters are easily available:
>>> from siegpy import FD2_filters, FD8_filters, Sym8_filters
-
class
siegpy.filters.
Filters
(grad_filter, laplac_filter)[source]¶ Bases:
object
This class specifies a family of filters that are useful to describe numerical Hamiltonians. It allows the definition of the gradient and Laplacian operators in matrix form by means of filters and a specified number of grid points.
Parameters: - grad_filter (numpy array or list) – Gradient filter.
- laplac_filter (numpy array or list) – Laplacian filter.
-
grad_filter
¶ Returns: Gradient filter. Return type: numpy array
-
laplac_filter
¶ Returns: Laplacian filter. Return type: numpy array
-
fill_gradient_matrix
(npts)[source]¶ Fill a gradient matrix of dimension
npts
.Parameters: npts (int) – Number of grid points. Returns: Gradient matrix. Return type: 2D numpy array
-
fill_laplacian_matrix
(npts)[source]¶ Fill a Laplacian matrix of dimension
npts
.Parameters: npts (int) – Number of grid points. Returns: Laplacian matrix. Return type: 2D numpy array
-
static
_fill_matrix
(_filter, npts)[source]¶ This method creates a matrix operator, given a filter and a number of grid points.
Parameters: - _filter (numpy array) – Filter of an operator.
- npts (int) – Number of grid points.
Returns: Operator in matrix form, filled thanks to a filter.
Return type: numpy array
Raises: ValueError
– If the filter is larger than the discretization grid.
-
class
siegpy.filters.
WaveletFilters
(grad_filter, laplac_filter, magic_filter)[source]¶ Bases:
siegpy.filters.Filters
This class defines the methods specific to the Daubechies wavelets filers.
The main difference with respect to the parent class is the requirement of a so-called magic filter.
Parameters: - grad_filter (numpy array or list) – Gradient filter.
- laplac_filter (numpy array or list) – Laplacian filter.
- magic_filter (numpy array or list) – Magic filter.
-
magic_filter
¶ Returns: Magic filter. Return type: numpy array