Rountines for defining the index set associated with multivariate polynomials.
Basis class constructor.
basis_type (str) – The type of index set to be used. Options include: univariate, total-order, tensor-grid,
sparse-grid, hyperbolic-basis  and euclidean-degree ; all basis are isotropic.
orders (list, optional) – List of integers corresponding to the highest polynomial order in each direction.
growth_rule (str, optional) – The type of growth rule associated with sparse grids.
Options include: linear and exponential. This input is only required when using a sparse grid.
q (float, optional) – The q parameter is used to control the number of basis terms used in a hyperbolic basis (see ).
Varies between 0.0 to 1.0. A value of 1.0 yields a total order basis.
>>> # Total order basis
>>> mybasis = eq.Basis('total-order', orders=[3,3,3])
>>> # Euclidean degree basis
>>> mybasis2 = eq.Basis('euclidean-degree', orders=[2,2])
>>> # Sparse grid basis
>>> mybasis3 = eq.Basis('sparse-grid', growth_rule='linear', level=3)
Blatman, G., Sudret, B., (2011) Adaptive Sparse Polynomial Chaos Expansion Based on Least Angle Regression. Journal of Computational Physics, 230(6), 2345-2367.
Trefethen, L., (2017) Multivariate Polynomial Approximation in the Hypercube. Proceedings of the American Mathematical Society, 145(11), 4837-4844. Pre-print.
Gets the index set elements for the Basis object.
Elements associated with the multi-index set. For total-order, tensor-grid, hyperbolic-basis, hyperbolic-basis and euclidean-degree these correspond to the multi-index set elements within the set. For a sparse-grid the output will comprise of three arguments: (i) list of tensor grid orders (anisotropic), (ii) the positive and negative weights, and (iii) the individual sparse grid multi-index elements.
ValueError – invalid value for basis_type!
Returns the number of elements of an index set.
The number of multi-index elements of the basis.
Returns the elements of an index set.
The multi-index elements of the basis.
Plot the index set. See plot_index_set() for full description.
Prunes down the number of elements in an index set.
number_of_elements_to_delete (int) – The number of multi-indices the user would like to delete.
ValueError – In Basis() –> prune(): Number of elements to be deleted must be greater than the total number of elements
Sets the highest order in each direction of the basis.
orders (list) – The highest polynomial order along each dimension.
ValueError – Basis __init__: invalid value for basis_type!
Routine that sorts a multi-index in ascending order based on the total orders. The constructor by default calls this function.