WaveFunction

About the WaveFunction class

The WaveBlocks Project

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

Inheritance diagram

Inheritance diagram of WaveFunction

Class documentation

class WaveBlocks.WaveFunction(parameters)

This class represents a vector valued quantum state |\Psi\rangle as used in the vector valued time-dependent Schroedinger equation. The state |\Psi\rangle is composed of \psi_0, \ldots, \psi_{N-1} where \psi_i is a single wavefunction component.

get_nodes()
Returns:The grid nodes \gamma the wave function values belong to.
get_norm(values=None, summed=False, component=None)

Calculate the L^2 norm of the whole vector |\Psi\rangle or some individual components \psi_i. The calculation is done in momentum space.

Parameters:
  • values – Allows to use this function for external data, similar to a static function.
  • summed – Whether to sum up the norms of the individual components.
  • component – The component \psi_i of which the norm is calculated.
Returns:

The L^2 norm of |\Psi\rangle or a list of the L^2 norms of all components \psi_i. (Depending on the optional arguments.)

get_number_components()
Returns:The number of components \psi_i the vector |\Psi\rangle consists of.
get_values()

Return the wave function values for each component of |\Psi\rangle.

Returns:A list with the values of all components \psi_i evaluated on the grid nodes \gamma.
kinetic_energy(kinetic, summed=False)

Calculate the kinetic energy E_{\text{kin}} := \langle\Psi|T|\Psi\rangle of the different components.

Parameters:
  • kinetic – The kinetic energy operator T.
  • summed – Whether to sum up the kinetic energies of the individual components.
Returns:

A list with the kinetic energies of the individual components or the overall kinetic energy of the wavefunction. (Depending on the optional arguments.)

potential_energy(potential, summed=False)

Calculate the potential energy E_{\text{pot}} := \langle\Psi|V|\Psi\rangle of the different components.

Parameters:
  • potential – The potential energy operator V.
  • summed – Whether to sum up the potential energies of the individual components.
Returns:

A list with the potential energies of the individual components or the overall potential energy of the wavefunction. (Depending on the optional arguments.)

set_grid(grid)

Assign a new grid to the wavefunction. All values are regarded to belong to these grid nodes.

Parameters:grid – The grid values as an numeric array.
set_values(values, component=None)

Assign new function values for each component of |\Psi\rangle.

Parameters:values – A list with the new values of all the \psi_i.
Raises ValueError:
 If the list values has the wrong number of entries.

Table Of Contents

Previous topic

TrapezoidalQR

Next topic

MatrixPotential

This Page