InhomogeneousQuadrature

About the InhomogeneousQuadrature class

The WaveBlocks Project

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

Inheritance diagram

Inheritance diagram of InhomogeneousQuadrature

Class documentation

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

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

Parameters:
  • pacbra – The wavepacket <\Psi| from the bra with Nbra components and basis size of Kbra.
  • packet – The wavepacket |\Psi> from the ket with Nket components and basis size of Kket.
  • operator – A function with two arguments f:(q, x) \rightarrow R^{Nbra \times Nket}.
Returns:

A square matrix of size \sum_i Kbra_i \times \sum_j Kket_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.
mix_parameters(Pibra, Piket)

Mix the two parameter sets Pi_bra and Pi_ket from the bra and the ket wavepacket.

Parameters:
  • Pibra – The parameter set Pi from the bra.
  • Piket – The parameter set Pi from the ket.
Returns:

The mixed parameters q0 and QS. (See the theory for details.)

quadrature(pacbra, packet, operator=None, summed=False, component=None, diag_component=None)

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

Parameters:
  • pacbra – The wavepacket <\Psi| from the bra with Nbra components and basis size of Kbra.
  • packet – The wavepacket |\Psi> from the ket with Nket components and basis size of Kket.
  • operator – A real-valued function f(x):R \rightarrow R^{Nbra \times Nket}.
  • 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, Nbra*Nket-1].
  • diag_component – Request only the i-th component from the diagonal entries, here i \in [0, Nket-1]
Returns:

The value of \langle\Psi|f|\Psi\rangle. This is either a scalar value or a list of Nbra*Nket 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(Pibra, Piket, eps, QR=None)

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

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

Table Of Contents

Previous topic

HomogeneousQuadrature

Next topic

Propagator

This Page