NSDInhomogeneous

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

Class documentation

class WaveBlocksND.NSDInhomogeneous(QR=None)[source]
__init__(QR=None)[source]

Initialize the numerical steepest descent transformation for quadrature of highly oscillatory overlap integrals.

Parameters:QR – Typically one uses an instance of GaussHermiteOriginalQR.
build_bilinear(Pibra, Piket)[source]

Convert the oscillator -\overline{g_k} + g_l occuring in the integral \langle\phi_k\left[\Pi_k\right] | \phi_l\left[\Pi_l\right]\rangle into a bilinear form g(x) = \underline{x}^{\mathrm{H}} \mathbf{A} \underline{x} + \underline{b}^{\mathrm{T}} \underline{x} + c.

Parameters:
  • Pibra – The parameters \Pi_k = (\underline{q_k}, \underline{p_k}, \mathbf{Q_k}, \mathbf{P_k}) from the ‘bra’ packet.
  • Piket – The parameters \Pi_l = (\underline{q_l}, \underline{p_l}, \mathbf{Q_l}, \mathbf{P_l}) from the ‘ket’ packet.
Returns:

Three arrays: a matrix \mathbf{A} of shape D \times D, a vector \underline{b} of shape D \times 1 and a scalar value c.

do_nsd(row, col)[source]

Evaluates by numerical steepest descent the integral \langle \Phi_i | f | \Phi^\prime_j \rangle for a polynomial function f(x) with x \in \mathbb{R}^D.

Parameters:
  • row – The index i of the component \Phi_i of \Psi.
  • row – The index j of the component \Phi^\prime_j of \Psi^\prime.
Returns:

A complex valued matrix of shape |\mathfrak{K}_i| \times |\mathfrak{K}^\prime_j|.

get_description()[source]

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

get_qr()

Return the QuadratureRule subclass instance used for quadrature.

Returns:The current instance of the quadrature rule.
initialize_operator(operator=None, matrix=False, eval_at_once=False)[source]

Provide the operator part of the inner product to evaluate. This function initializes the operator used for quadratures and for building matrices.

Note that the operator must not have residues and can be maximally polynomial but not exponential.

Parameters:
  • operator – The operator of the inner product. If None a suitable identity is used.
  • matrix – Set this to True (Default is False) in case we want to compute the matrix elements. For nasty technical reasons we can not yet unify the operator call syntax.
  • eval_at_once (Boolean, default is False.) – Flag to tell whether the operator supports the entry=(r,c) call syntax.
initialize_packet(pacbra, packet=None)[source]

Provide the wavepacket parts of the inner product to evaluate. Since the quadrature is inhomogeneous, different wavepackets can be used for the ‘bra’ as well as the ‘ket’ part.

Parameters:
  • pacbra – The packet that is used for the ‘bra’ part.
  • packet – The packet that is used for the ‘ket’ part.
mix_parameters(Pibra, Piket)[source]

Mix the two parameter sets \Pi_i and \Pi_j from the ‘bra’ and the ‘ket’ wavepackets \Phi\left[\Pi_i\right] and \Phi^\prime\left[\Pi_j\right].

Parameters:
  • Pibra – The parameter set \Pi_i from the bra part wavepacket.
  • Piket – The parameter set \Pi_j from the ket part wavepacket.
Returns:

The mixed parameters q_0 and Q_S. (See the theory for details.)

perform_build_matrix(row, col)[source]

Computes by standard quadrature the matrix elements \langle\Phi_i | f |\Phi^\prime_j\rangle for a general function f(x) with x \in \mathbb{R}^D.

Parameters:
  • row – The index i of the component \Phi_i of \Psi.
  • row – The index j of the component \Phi^\prime_j of \Psi^\prime.
Returns:

A complex valued matrix of shape |\mathfrak{K}_i| \times |\mathfrak{K}^\prime_j|.

perform_quadrature(row, col)[source]

Evaluates by numerical steepest descent the integral \langle \Phi_i | f | \Phi^\prime_j \rangle for a polynomial function f(x) with x \in \mathbb{R}^D.

Parameters:
  • row – The index i of the component \Phi_i of \Psi.
  • row – The index j of the component \Phi^\prime_j of \Psi^\prime.
Returns:

A single complex floating point number.

prepare(rows, cols)[source]

Precompute some values needed for evaluating the quadrature \langle \Phi_i | f(x) | \Phi^\prime_j \rangle or the corresponding matrix over the basis functions of \Phi_i and \Phi^\prime_j.

Parameters:
  • rows – A list of all i with 0 \leq i \leq N selecting the \Phi_i for which te precompute values.
  • cols – A list of all j with 0 \leq j \leq N selecting the \Phi^\prime_j for which te precompute values.

Note that the two arguments are not used in the current implementation.

set_qr(QR)

Set the QuadratureRule subclass instance used for quadrature.

Parameters:QR – The new QuadratureRule instance.