HagedornWavepacketInhomogeneous

About the HagedornWavepacketInhomogeneous class

The WaveBlocks Project

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

Inheritance diagram

Inheritance diagram of HagedornWavepacketInhomogeneous

Class documentation

class WaveBlocks.HagedornWavepacketInhomogeneous(parameters)

This class represents inhomogeneous vector valued wavepackets |\Psi\rangle.

coefficients = None

The coefficients c^i of the linear combination for each component \Phi_i.

evaluate_at(nodes, component=None, prefactor=False)

Evaluete the Hagedorn wavepacket \Psi at the given nodes \gamma.

Parameters:
  • nodes – The nodes \gamma at which the Hagedorn wavepacket gets evaluated.
  • component – The index i of a single component \Phi_i to evaluate. (Defaults to ‘None’ for evaluating all components.)
  • prefactor – Whether to include a factor of \left(\det\left(Q_i\right)\right)^{-\frac{1}{2}}.
Returns:

A list of arrays or a single array containing the values of the \Phi_i at the nodes \gamma.

evaluate_basis_at(nodes, component, prefactor=False)

Evaluate the Hagedorn functions \phi_k recursively at the given nodes \gamma.

Parameters:
  • nodes – The nodes \gamma at which the Hagedorn functions are evaluated.
  • component – The index i of the component whose basis functions \phi^i_k we want to evaluate.
  • prefactor – Whether to include a factor of \left(\det\left(Q_i\right)\right)^{-\frac{1}{2}}.
Returns:

Returns a twodimensional array H where the entry H[k,i] is the value of the k-th Hagedorn function evaluated at the node i.

gen_id()

Generate an (unique) ID per wavepacket instance.

get_basis_size(component=None)
Returns:The size of the basis, i.e. the number K of {\phi_k}_{k=1}^K.
get_coefficient_vector()
Returns:The coefficients c^i of all components \Phi_i as a single long column vector.
get_coefficients(component=None)

Returns the coefficients c^i for some components \Phi_i of |\Psi\rangle.

Parameters:component – The index i of the coefficients c^i we want to get.
Returns:The coefficients c^i either for all components \Phi_i or for a specified one.
get_id()

Return the packet ID of this wavepacket instance. The ID may be used for storing packets in associative lists.

get_norm(component=None, summed=False)

Calculate the L^2 norm of the wavepacket |\Psi\rangle.

Parameters:
  • component – The component \Phi_i of which the norm is calculated.
  • summed – Whether to sum up the norms of the individual components \Phi_i.
Returns:

A list containing the norms of all components \Phi_i or the overall norm of \Psi.

get_number_components()
Returns:The number N of components the wavepacket \Psi has.
get_parameters(component=None, aslist=False)

Get the Hagedorn parameters \Pi_i of each component \Phi_i of the wavepacket \Psi.

Parameters:
  • component – The index i of the component whose parameters \Pi_i we want to get.
  • aslist – Dummy parameter for API compatibility with the homogeneous packets.
Returns:

A list with all the sets \Pi_i or a single set.

get_quadrature()

Return the InhomogeneousQuadrature instance used for evaluating brakets.

Returns:The current instance InhomogeneousQuadrature.
grady(component)

Calculate the effect of -i \epsilon^2 \frac{\partial}{\partial x} on a component \Phi_i of the Hagedorn wavepacket \Psi.

Parameters:component – The index i of the component \Phi_i on which we apply the above operator.
Returns:The modified coefficients.
kinetic_energy(summed=False)

Calculate the kinetic energy \langle\Psi|T|\Psi\rangle of the wavepacket componentwise.

Parameters:summed – Wheter to sum up the individual integrals \langle\Phi_i|T_{i,j}|\Phi_j\rangle.
Returns:The kinetic energy of the wavepacket’s components \Phi_i or the overall kinetic energy of \Psi.
number_components = None

Number of components \Phi_i the wavepacket |\Psi\rangle has got.

parameters = None

Data structure that contains the Hagedorn parameter sets \Pi_i of each component \Phi_i. The parameter values are initialized to the Harmonic Oscillator Eigenfunctions

potential_energy(potential, summed=False)

Calculate the potential energy \langle\Psi|V|\Psi\rangle of the wavepacket componentwise.

Parameters:
  • potential – The potential energy operator V as function.
  • summed – Wheter to sum up the individual integrals \langle\Phi_i|V_{i,j}|\Phi_j\rangle.
Returns:

The potential energy of the wavepacket’s components \Phi_i or the overall potential energy of \Psi.

project_to_canonical(potential)

Project the Hagedorn wavepacket into the canonical basis.

Parameters:potential – The potential V whose eigenvectors nu_l are used for the transformation.

Note

This function is expensive and destructive! It modifies the coefficients of the self instance.

project_to_eigen(potential)

Project the Hagedorn wavepacket into the eigenbasis of a given potential V.

Parameters:potential – The potential V whose eigenvectors nu_l are used for the transformation.

Note

This function is expensive and destructive! It modifies the coefficients of the self instance.

quadrature = None

An object that can compute brakets via quadrature.

set_basis_size(basis_size, component=None)

Set the size of the basis of a given component or all components.

Parameters:
  • basis_size – An single positive integer or a list of N positive integers.
  • component – The component for which we want to set the basis size. Default is None which means ‘all’.
set_coefficient(component, index, value)

Set a single coefficient c^i_k of the specified component \Phi_i of |\Psi\rangle.

Parameters:
  • component – The index i of the component \Phi_i we want to update.
  • index – The index k of the coefficient c^i_k we want to update.
  • value – The new value of the coefficient c^i_k.
Raises ValueError:
 

For invalid indices i or k.

set_coefficient_vector(vector)

Set the coefficients for all components \Phi_i simultaneously.

Parameters:vector – The coefficients of all components as a single long column vector.

Note

This function does NOT copy the input data! This is for efficiency as this routine is used in the innermost loops.

set_coefficients(values, component=None)

Update the coefficients c of \Psi.

Parameters:
  • values – The new values of the coefficients c^i of \Phi_i.
  • component – The index i of the component we want to update with new coefficients.
Raises ValueError:
 

For invalid indices i.

Note

This function can either set new coefficients for a single component \Phi_i only if the component attribute is set or for all components simultaneously if values is a list of arrays.

set_id(anid)

Manually set an ID for the current wavepacket instance.

set_parameters(parameters, component=None)

Set the Hagedorn parameters \Pi_i of each component \Phi_i of the wavepacket \Psi.

Parameters:
  • parameters – A list or a single set of Hagedorn parameters.
  • component – The index i of the component whose parameters \Pi_i we want to update.
set_quadrature(quadrature)

Set the InhomogeneousQuadrature instance used for evaluating brakets.

Parameters:quadrature – The new InhomogeneousQuadrature instance. May be None to use a dafault one with a quadrature rule of order K+4.
to_fourier_space(assign=True)

Transform the wavepacket to Fourier space.

Parameters:assign – Whether to assign the transformation to this packet or return a cloned packet.

Note

This is the inverse of the method to_real_space().

to_real_space(assign=True)

Transform the wavepacket to real space.

Parameters:assign – Whether to assign the transformation to this packet or return a cloned packet.

Note

This is the inverse of the method to_fourier_space().

Table Of Contents

Previous topic

HagedornWavepacket

Next topic

Quadrature

This Page