MatrixPotential1S

About the MatrixPotential1S class

The WaveBlocks Project

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

Inheritance diagram

Inheritance diagram of MatrixPotential1S

Class documentation

class WaveBlocksND.MatrixPotential1S(expression, variables, **kwargs)[source]

This class represents a scalar potential V(x). The potential is given as an analytic 1 \times 1 matrix expression. Some symbolic calculations with the potential are supported.

calculate_eigenvalues()[source]

Calculate the eigenvalue \lambda_0(x) of the potential V(x). In the scalar case this is just equal to the matrix entry V_{0,0}(x). Note: This function is idempotent and the eigenvalues are memoized for later reuse.

calculate_eigenvectors()[source]

Calculate the eigenvector \nu_0(x) of the potential V(x). In the scalar case this is just the value 1. Note: This function is idempotent and the eigenvectors are memoized for later reuse.

calculate_exponential(factor=1)[source]

Calculate the matrix exponential \exp(\alpha V). In the case of this class the matrix is of size 1 \times 1 thus the exponential simplifies to the scalar exponential function. Note: This function is idempotent.

Parameters:factor – The prefactor \alpha in the exponential.
calculate_hessian()[source]

Calculate the Hessian matrix \nabla^2 V of the potential V(x) with x \in \mathbb{R}^D. For potentials which depend only one variable, this equals the second derivative and D=1. Note that this function is idempotent.

calculate_jacobian()[source]

Calculate the Jacobian matrix \nabla V of the potential V(x) with x \in \mathbb{R}^D. For potentials which depend only one variable, this equals the first derivative and D=1. Note that this function is idempotent.

calculate_jacobian_canonical()[source]

Calculate the Jacobian matrix \nabla V(x) of the potential V(x) with x \in \mathbb{R}^D. For potentials which depend only one variable, this equals the first derivative and D=1. Note that this function is idempotent.

calculate_local_quadratic(diagonal_component=None)[source]

Calculate the local quadratic approximation U(x) of the potential’s eigenvalue \lambda(x). Note that this function is idempotent.

Parameters:diagonal_component – Dummy parameter that has no effect here.
calculate_local_remainder(diagonal_component=None)[source]

Calculate the non-quadratic remainder W(x) = V(x) - U(x) of the quadratic Taylor approximation U(x) of the potential’s eigenvalue \lambda(x). Note that this function is idempotent.

Parameters:diagonal_component – Dummy parameter that has no effect here.
evaluate_at(grid, entry=None, as_matrix=False)[source]

Evaluate the potential V(x) elementwise on a grid \Gamma.

Parameters:
  • grid (A Grid instance. (Numpy arrays are not directly supported yet.)) – The grid containing the nodes \gamma_i we want to evaluate the potential at.
  • entry (A python tuple of two integers.) – The indices (i,j) of the component V_{i,j}(x) we want to evaluate or None to evaluate all entries. This has no effect here as we only have a single entry V_{0,0}.
  • as_matrix – Dummy parameter which has no effect here.
Returns:

A list containing a single numpy ndarray of shape (1,|\Gamma|).

evaluate_eigenvalues_at(grid, entry=None, as_matrix=False)[source]

Evaluate the eigenvalue \lambda_0(x) elementwise on a grid \Gamma.

Parameters:
  • grid (A Grid instance. (Numpy arrays are not directly supported yet.)) – The grid containing the nodes \gamma_i we want to evaluate the eigenvalue at.
  • entry (A python tuple of two integers.) – The indices (i,j) of the component \Lambda_{i,j}(x) we want to evaluate or None to evaluate all entries. If j = i then we evaluate the eigenvalue \lambda_i(x). This has no effect here as we only have a single entry \lambda_0.
  • as_matrix – Dummy parameter which has no effect here.
Returns:

A list containing a single numpy ndarray of shape (N_1, ... ,N_D).

evaluate_eigenvectors_at(grid, entry=None)[source]

Evaluate the eigenvector \nu_0(x) elementwise on a grid \Gamma.

Parameters:
  • grid (A Grid instance. (Numpy arrays are not directly supported yet.)) – The grid containing the nodes \gamma_i we want to evaluate the eigenvector at.
  • entry (A singly python integer.) – The index i of the eigenvector \nu_i(x) we want to evaluate or None to evaluate all eigenvectors. This has no effect here as we only have a single entry \nu_0.
Returns:

A list containing the numpy ndarrays, all of shape (1, |\Gamma|).

evaluate_exponential_at(grid, entry=None)[source]

Evaluate the exponential of the potential matrix V(x) on a grid \Gamma.

Parameters:grid (A Grid instance. (Numpy arrays are not directly supported yet.)) – The grid containing the nodes \gamma_i we want to evaluate the exponential at.
Returns:The numerical approximation of the matrix exponential at the given grid nodes.
evaluate_hessian_at(grid, component=None)[source]

Evaluate the potential’s Hessian \nabla^2 V(x) at some grid nodes \Gamma.

Parameters:
  • grid – The grid nodes \Gamma the Hessian gets evaluated at.
  • component – Dummy parameter that has no effect here.
Returns:

The value of the potential’s Hessian at the given nodes. The result is an ndarray of shape (D,D) is we evaluate at a single grid node or of shape (|\Gamma|,D,D) if we evaluate at multiple nodes simultaneously.

evaluate_jacobian_at(grid, component=None)[source]

Evaluate the potential’s Jacobian \nabla \Lambda(x) at some grid nodes \Gamma.

Parameters:
  • grid – The grid nodes \Gamma the Jacobian gets evaluated at.
  • component – Dummy parameter that has no effect here.
Returns:

The value of the potential’s Jacobian at the given nodes. The result is an ndarray of shape (D,1) is we evaluate at a single grid node or of shape (D,|\Gamma|) if we evaluate at multiple nodes simultaneously.

evaluate_jacobian_canonical_at(grid, component=None)[source]

Evaluate the potential’s Jacobian \nabla V(x) at some grid nodes \Gamma.

Parameters:
  • grid – The grid nodes \Gamma the Jacobian gets evaluated at.
  • component – Dummy parameter that has no effect here.
Returns:

The value of the potential’s Jacobian at the given nodes. The result is an ndarray of shape (D,1) is we evaluate at a single grid node or of shape (D,|\Gamma|) if we evaluate at multiple nodes simultaneously.

evaluate_local_quadratic_at(grid, diagonal_component=None)[source]

Numerically evaluate the local quadratic approximation U(x) of the potential’s eigenvalue \lambda(x) at the given grid nodes \Gamma. This function is used for the homogeneous case.

Parameters:
  • grid – The grid nodes \Gamma the quadratic approximation gets evaluated at.
  • diagonal_component – Dummy parameter that has no effect here.
Returns:

A list containing the values V(\Gamma), \nabla V(\Gamma) and \nabla^2 V(\Gamma).

evaluate_local_remainder_at(grid, position, diagonal_component=None, entry=None)[source]

Numerically evaluate the non-quadratic remainder W(x) of the quadratic approximation U(x) of the potential’s eigenvalue \lambda(x) at the given nodes \Gamma.

Parameters:
  • grid – The grid nodes \Gamma the remainder W gets evaluated at.
  • position – The point q \in \mathbb{R}^D where the Taylor series is computed.
  • diagonal_component – Dummy parameter that has no effect here.
  • entry – Dummy parameter that has no effect here.
Returns:

A list with a single entry consisting of an ndarray containing the values of W(\Gamma). The array is of shape (1,|\Gamma|).

get_dimension()

Return the dimension D of the potential V(x). The dimension is equal to the number of free variables x_i where x := (x_1, x_2, ..., x_D).

get_number_components()

Return the number N of components the potential V(x) supports. This is equivalent to the number of energy levels \lambda_i(x).