Skip to content

dq.expm

expm(x: ArrayLike, *, max_squarings: int = 16) -> Array

Returns the matrix exponential of an array.

The exponential is computed using the scaling-and-squaring approximation method.

Parameters

  • x (array_like of shape (..., n, n)) –

    Square matrix.

  • max_squarings –

    Number of squarings.

Returns

(array of shape (..., n, n)) Matrix exponential of x.

Equivalent JAX syntax

This function is equivalent to jnp.scipy.linalg.expm(x, max_squarings=max_squarings).

Examples

>>> dq.expm(dq.sigmaz())
Array([[2.718+0.j, 0.   +0.j],
       [0.   +0.j, 0.368+0.j]], dtype=complex64)