HomogeneousQuadrature

About the HomogeneousQuadrature class

The WaveBlocks Project

@author: R. Bourquin @copyright: Copyright (C) 2010, 2011, 2012 R. Bourquin @license: Modified BSD License

Inheritance diagram

Inheritance diagram of HomogeneousQuadrature

Class documentation

class WaveBlocks.HomogeneousQuadrature(QR=None, order=None)
build_matrix(packet, operator=None)

Calculate the matrix representation of \langle\Psi|f|\Psi\rangle.

Parameters:
  • packet – The wavepacket |\Psi>.
  • operator – A function with two arguments f:(q, x) \rightarrow \mathbb{R}.
Returns:

A square matrix of size \sum_i K_i \times \sum_j K_j.

build_qr(qorder)

Create a quadrature rule of the given order.

Parameters:qorder – The order of the quadrature rule.
get_qr()

Return the GaussHermiteQR instance used for quadrature.

Returns:The current instance of the quadrature rule.
quadrature(packet, operator=None, summed=False, component=None, diag_component=None)

Performs the quadrature of \langle\Psi|f|\Psi\rangle for a general f.

Parameters:
  • packet – The wavepacket |\Psi>.
  • operator – A real-valued function f(x):R \rightarrow R^{N \times N}.
  • summed – Whether to sum up the individual integrals \langle\Phi_i|f_{i,j}|\Phi_j\rangle.
  • component – Request only the i-th component of the result. Remember that i \in [0, N^2-1].
  • diag_component – Request only the i-th component from the diagonal entries, here i \in [0, N-1]
Returns:

The value of \langle\Psi|f|\Psi\rangle. This is either a scalar value or a list of N^2 scalar elements.

Note

‘component’ takes precedence over ‘diag_component’ if both are supplied. (Which is discouraged)

set_qr(QR)

Set the GaussHermiteQR instance used for quadrature.

Parameters:QR – The new GaussHermiteQR instance.
transform_nodes(Pi, eps, QR=None)

Transform the quadrature nodes such that they fit the given wavepacket.

Parameters:
  • Pi – The parameter set of the wavepacket.
  • eps – The epsilon of the wavepacket.
  • QR – An optional quadrature rule providing the nodes.

Table Of Contents

Previous topic

Quadrature

Next topic

InhomogeneousQuadrature

This Page