expm_frechet¶
- torch_sim.math.expm_frechet(A, E, method=None, check_finite=True)[source]¶
Frechet derivative of the matrix exponential of A in the direction E.
Optimized for batched 3x3 matrices. Also handles single 3x3 matrices by auto-adding a batch dimension.
- Method notes:
SPSuses scaling-Pade-squaring for the matrix exponential and its Frechet derivative. Seeexpm_frechet_sps().BEuses the block matrix identity exp([[A, E], [0, A]]) = [[exp(A), L_exp(A, E)], [0, exp(A)]]. Seeexpm_frechet_block_enlarge().
- Parameters:
A (Tensor) – (B, 3, 3) or (3, 3) tensor. Matrix of which to take the matrix exponential.
E (Tensor) – (B, 3, 3) or (3, 3) tensor. Matrix direction in which to take the Frechet derivative. Must have same shape as A.
method (str | None) – str, optional. Choice of algorithm. Should be one of - SPS - Scaling-Pade-squaring (default) - BE - Block-enlarge
check_finite (bool) – bool, optional. Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
- Returns:
- A tuple containing:
expm_A: Matrix exponential of A. expm_frechet_AE: Frechet derivative of the matrix exponential of A
in the direction E.
- Return type: