InhomogeneousInnerProductLCWP

About the InhomogeneousInnerProductLCWP 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 InhomogeneousInnerProductLCWP

Class documentation

class WaveBlocksND.InhomogeneousInnerProductLCWP(delegate=None, oracle=None)[source]
__init__(delegate=None, oracle=None)[source]

This class computes the inhomogeneous inner product \langle\Upsilon|f|\Upsilon^\prime\rangle of two linear combinations \Upsilon and \Upsilon^\prime. The delegate inner product class used for computing \langle\Psi|f|\Psi^\prime\rangle has to be of inhomogeneous type.

Parameters:
  • delegate (A InnerProduct subclass instance.) – The delegate inner product.
  • oracle – The sparsity oracle to use. If the variable is None no oracle is used and all integrals are computed.

Note

Make sure to use an inhomogeneous inner product here.

build_matrix(lcbra, lcket=None, operator=None, component=None, eval_at_once=False)[source]

Delegates the computation of the matrix elements of \langle\Upsilon|f|\Upsilon^\prime\rangle for a general function f(x) with x \in \mathbb{R}^D. The matrix is computed without including the coefficients c_j and c_j^\prime.

Parameters:
  • lcbra – The linear combination \Upsilon from the bra with J summands \Psi_j.
  • lcket – The linear combination \Upsilon^\prime from the ket with J^\prime summands \Psi_j^\prime.
  • operator – A matrix-valued function f(x): \mathbb{R}^D \rightarrow \mathbb{R}^{N \times N^\prime}.
  • component (Integer or None, default is None.) – The index i of the component \Phi_j of \Psi_j. If set only those components will be taken into account for the computation.
  • eval_at_once (Boolean, default is False.) – Flag to tell whether the operator supports the entry=(r,c) call syntax.
Returns:

A matrix of size \sum_{j\in J} N_j \times \sum_{j^\prime\in J^\prime} N_{j^\prime}.

Type:

An ndarray.

get_delegate()

Return the Quadrature subclass instance used for evaluation of this inner product.

Returns:The current instance of the quadrature.
get_description()[source]

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

get_oracle()[source]

Return the sparsity oracle in use or None.

quadrature(lcbra, lcket=None, operator=None, component=None, eval_at_once=False)[source]

Delegates the evaluation of \langle\Upsilon|f|\Upsilon^\prime\rangle for a general function f(x) with x \in \mathbb{R}^D.

Parameters:
  • lcbra – The linear combination \Upsilon from the bra with J summands \Psi_j.
  • lcket – The linear combination \Upsilon^\prime from the ket with J^\prime summands \Psi_j^\prime.
  • operator – A matrix-valued function f(x): \mathbb{R}^D \rightarrow \mathbb{R}^{N \times N^\prime}.
  • component (Integer or None, default is None.) – The index i of the component \Phi_j of \Psi_j. If set only those components will be taken into account for the computation.
  • eval_at_once (Boolean, default is False.) – Flag to tell whether the operator supports the entry=(r,c) call syntax.
Returns:

The value of \langle\Upsilon|f|\Upsilon^\prime\rangle.

Type:

An ndarray.

set_delegate(delegate)

Set the Quadrature subclass instance used for quadrature.

Parameters:delegate – The new Quadrature instance.
set_oracle(new_oracle)[source]

Set the sparsity oracle.

Parameters:new_oracle – The new oracle to use. If the variable is None no oracle is used and all integrals are computed.