matrix_exp#

ivy.matrix_exp(x, /, *, out=None)[source]#

Compute the matrix exponential of a square matrix.

Parameters:
  • a – Square matrix.

  • out (Optional[Array], default: None) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.

Return type:

Array

Returns:

ret – the matrix exponential of the input.

Examples

>>> x = ivy.array([[[1., 0.],
                    [0., 1.]],
                    [[2., 0.],
                    [0., 2.]]])
>>> ivy.matrix_exp(x)
ivy.array([[[2.7183, 1.0000],
            [1.0000, 2.7183]],
            [[7.3891, 1.0000],
            [1.0000, 7.3891]]])
Array.matrix_exp(self, /, *, out=None)[source]#

ivy.Array instance method variant of ivy.kron. This method simply wraps the function, and so the docstring for ivy.matrix_exp also applies to this method with minimal changes.

Return type:

Array

Examples

>>> x = ivy.array([[[1., 0.],
                    [0., 1.]],
                    [[2., 0.],
                    [0., 2.]]])
>>> ivy.matrix_exp(x)
ivy.array([[[2.7183, 1.0000],
            [1.0000, 2.7183]],
            [[7.3891, 1.0000],
            [1.0000, 7.3891]]])
Container.matrix_exp(self, /, *, key_chains=None, to_apply=True, out=None)[source]#

ivy.Container instance method variant of ivy.diagflat. This method simply wraps the function, and so the docstring for ivy.diagflat also applies to this method with minimal changes.

Return type:

Container

Examples

>>> x = ivy.array([[[1., 0.],
                    [0., 1.]],
                    [[2., 0.],
                    [0., 2.]]])
>>> ivy.matrix_exp(x)
ivy.array([[[2.7183, 1.0000],
            [1.0000, 2.7183]],
            [[7.3891, 1.0000],
            [1.0000, 7.3891]]])