MatrixPotential2S

About the MatrixPotential2S class

The WaveBlocks Project

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

Inheritance diagram

Inheritance diagram of MatrixPotential2S

Class documentation

class WaveBlocks.MatrixPotential2S(expression, variables)

This class represents a matrix potential V\left(x\right). The potential is given as an analytical 2 \times 2 matrix expression. Some symbolic calculations with the potential are supported. For example calculation of eigenvalues and exponentials and numerical evaluation. Further, there are methods for splitting the potential into a Taylor expansion and for basis transformations between canonical and eigenbasis.

calculate_eigenvalues()

Calculate the two eigenvalues \lambda_i\left(x\right) of the potential V\left(x\right). We can do this by symbolical calculations. The multiplicities are taken into account.

Note

Note: the eigenvalues are memoized for later reuse.

calculate_eigenvectors()

Calculate the two eigenvectors nu_i\left(x\right) of the potential V\left(x\right). We can do this by symbolical calculations.

Note

The eigenvectors are memoized for later reuse.

calculate_exponential(factor=1)

Calculate the matrix exponential E = \exp\left(\alpha M\right). In this case the matrix is of size 2 \times 2 thus the general exponential can be calculated analytically.

Parameters:factor – A prefactor \alpha in the exponential.
calculate_hessian()

Calculate the hessian matrix for each component V_{i,j} of the potential. For potentials which depend only one variable x, this equals the second derivative.

calculate_jacobian()

Calculate the jacobian matrix for each component V_{i,j} of the potential. For potentials which depend only one variable x, this equals the first derivative.

calculate_local_quadratic(diagonal_component=None)

Calculate the local quadratic approximation matrix U of the potential’s eigenvalues in \Lambda. This function can be used for the homogeneous case and takes into account the leading component \chi. If the parameter \chi is not given, calculate the local quadratic approximation matrix U of all the potential’s eigenvalues in \Lambda. This function is used for the inhomogeneous case.

Parameters:diagonal_component – Specifies the index i of the eigenvalue \lambda_i that gets expanded into a Taylor series u_i.
evaluate_at(nodes, component=None, as_matrix=True)

Evaluate the potential matrix elementwise at some given grid nodes \gamma.

Parameters:
  • nodes – The grid nodes \gamma we want to evaluate the potential at.
  • component – The component V_{i,j} that gets evaluated or ‘None’ to evaluate all.
  • as_matrix – Returns the whole matrix \Lambda instead of only a list with the eigenvalues \lambda_i.
Returns:

A list with the 4 entries evaluated at the nodes.

evaluate_eigenvalues_at(nodes, component=None, as_matrix=False)

Evaluate the eigenvalues \lambda_i\left(x\right) at some grid nodes \gamma.

Parameters:
  • nodes – The grid nodes \gamma we want to evaluate the eigenvalues at.
  • component – The index i of the eigenvalue \lambda_i that gets evaluated.
  • as_matrix – Returns the whole matrix \Lambda instead of only a list with the eigenvalues \lambda_i.
Returns:

A sorted list with 2 entries for the two eigenvalues evaluated at the nodes. Or a single value if a component was specified.

evaluate_eigenvectors_at(nodes)

Evaluate the eigenvectors nu_i\left(x\right) at some grid nodes \gamma.

Parameters:nodes – The grid nodes \gamma we want to evaluate the eigenvectors at.
Returns:A list with the two eigenvectors evaluated at the given nodes.
evaluate_exponential_at(nodes)

Evaluate the exponential of the potential matrix V at some grid nodes \gamma.

Parameters:nodes – The grid nodes \gamma we want to evaluate the exponential at.
Returns:The numerical approximation of the matrix exponential at the given grid nodes.
evaluate_hessian_at(nodes, component=None)

Evaluate the hessian at some grid nodes \gamma for each component V_{i,j} of the potential.

Parameters:
  • nodes – The grid nodes \gamma the hessian gets evaluated at.
  • component – The index tuple \left(i,j\right) that specifies the potential’s entry of which the hessian is evaluated. (Or ‘None’ to evaluate all)
Returns:

Either a list or a single value depending on the optional parameters.

evaluate_jacobian_at(nodes, component=None)

Evaluate the jacobian at some grid nodes \gamma for each component V_{i,j} of the potential.

Parameters:
  • nodes – The grid nodes \gamma the jacobian gets evaluated at.
  • component – The index tuple \left(i,j\right) that specifies the potential’s entry of which the jacobian is evaluated. (Defaults to ‘None’ to evaluate all)
Returns:

Either a list or a single value depending on the optional parameters.

evaluate_local_quadratic_at(nodes, diagonal_component)

Numerically evaluate the local quadratic approximation matrix U of the potential’s eigenvalues in \Lambda at the given grid nodes \gamma.

Parameters:
  • nodes – The grid nodes \gamma we want to evaluate the quadratic approximation at.
  • diagonal_component – Specifies the index i of the eigenvalue \lambda_i that gets expanded into a Taylor series u_i.
Returns:

A list of arrays or a single array containing the values of U_{i,j} at the nodes \gamma.

evaluate_local_remainder_at(position, nodes, diagonal_component=None, component=None)

Numerically evaluate the non-quadratic remainder matrix W of the quadratic approximation matrix U of the potential’s eigenvalues in \Lambda at the given nodes \gamma. This function is used for the homogeneous and the inhomogeneous case and just evaluates the remainder matrix W.

Parameters:
  • position – The point q where the Taylor series is computed.
  • nodes – The grid nodes \gamma we want to evaluate the potential at.
  • component – The component \left(i,j\right) of the remainder matrix W that is evaluated.
Returns:

A list with a single entry consisting of an array containing the values of W at the nodes \gamma.

get_number_components()
Returns:The number N of components the potential supports. This is also the size of the matrix. In the current case it’s 2.
potential = None

The matrix of the potential V\left(x\right).

project_to_canonical(nodes, values, basis=None)

Project a given vector from the potential’s eigenbasis to the canonical basis.

Parameters:
  • nodes – The grid nodes \gamma for the pointwise transformation.
  • values – The list of vectors \varphi_i containing the values we want to transform.
  • basis – A list of basis vectors nu_i. Allows to use this function for external data, similar to a static function.
Returns:

Returned is another list containing the projection of the values into the eigenbasis.

project_to_eigen(nodes, values, basis=None)

Project a given vector from the canonical basis to the eigenbasis of the potential.

Parameters:
  • nodes – The grid nodes \gamma for the pointwise transformation.
  • values – The list of vectors \varphi_i containing the values we want to transform.
  • basis – A list of basisvectors nu_i. Allows to use this function for external data, similar to a static function.
Returns:

Returned is another list containing the projection of the values into the eigenbasis.

x = None

The variable x that represents position space.

Table Of Contents

Previous topic

MatrixPotential1S

Next topic

MatrixPotentialMS

This Page