PrecisionFiniteDifference#

class cuqi.operator.PrecisionFiniteDifference(num_nodes, bc_type='periodic', order=1)#

Precision operator constructed with a finite difference operator.

Attributes:#

num_nodes: int or tuple

For a 1D operator, num_nodes is a one dimensional tuple or an integer representing the number of discretization nodes in a 1D grid. For a 2D operator, num_nodes is a two dimensional tuple of integers representing the number of discretization nodes in the 2D grid in the x axis and the y axis, respectively.

bc_type: str

The boundary condition type for the finite difference operator.

physical_dim: int

Either 1 or 2 for 1D and 2D operators, respectively.

order: int
The order of the finite difference operator.
Order 0: Identity operator.
Order 1: First order finite difference operator. 1D precision has a banded diagonal structure with [-1, 2, -1].
Order 2: Second order finite difference operator. 1D precision has a banded diagonal structure with [1, -4, 6, -4, 1].
__init__(num_nodes, bc_type='periodic', order=1)#

Methods

__init__(num_nodes[, bc_type, order])

get_matrix()

Attributes