torch.Tensor.Tensor.matrix_exp
Tensor.matrix_exp(): Tensor<DynamicShape, D, Dev>Computes the matrix exponential e^A using the matrix exponential series.
Returns the exponential of a square matrix, defined as the matrix power series: e^A = I + A + A²/2! + A³/3! + ... Useful for solving matrix differential equations dX/dt = AX and computing matrix square roots.
Use Cases:
- Solving continuous-time linear differential equations
- Computing matrix square roots and logarithms
- Rotation matrices and group exponentials
Returns
Tensor<DynamicShape, D, Dev>– Matrix exponential e^A of same shape as inputExamples
// Solve dX/dt = AX with initial condition X(0) = I
const A = torch.tensor([[0, 1], [-1, 0]]); // Rotation generator
const expA = A.matrix_exp(); // e^A rotates by 1 radianSee Also
- PyTorch torch.matrix_exp() (or tensor.matrix_exp())
- matrix_power - Matrix raised to integer power