Skip to content

Tessero\Sparse\Linalg\LaplacianNd

← All classes

AI assistant

Build this with Claude Code, Cursor or Copilot

Copy a Tessero-tuned prompt for Tessero\Sparse\Linalg\LaplacianNd, grounded in 12 real API signatures , into your IDE's AI. No chatbot, just exact context.

__construct
__construct(array $gridShape, string $boundaryConditions = 'neumann')
shape
shape(): array
ndim
ndim(): int
boundaryConditions
boundaryConditions(): string
gridShape
gridShape(): array
toarray
toarray(): array

Dense array of the Laplacian (Kronecker sum of 1-D Laplacians). Values are exact integers represented as floats.

tosparse
tosparse(): array

Dense array of the sparse representation. The LaplacianNd sparse form is identical to its dense form, so tosparse()->toarray() == toarray().

eigenvalues
eigenvalues(?int $m = null): array

Closed-form eigenvalues in ascending order. If $m is given, the $m largest (least negative) eigenvalues are returned (scipy returns the m smallest in absolute value, i.e. the largest algebraically, still ascending).

matvec
matvec(array $x): array

Matrix-vector product L x via the dense array.

rmatvec
rmatvec(array $y): array

Adjoint == matvec (L is symmetric).

matmat
matmat(array $X): array

Matrix-matrix product L X (X row-major, shape (p, k)).

dot
dot(array $x): array
asLinearOperator
asLinearOperator(): Tessero\Sparse\Linalg\LinearOperator

Return this Laplacian as a generic LinearOperator (wrapping its dense array).