Skip to content

dq.powm

powm(x: ArrayLike, n: int) -> Array

Returns the \(n\)-th matrix power of an array.

Parameters

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

    Square matrix.

  • n –

    Integer exponent.

Returns

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

Equivalent JAX syntax

This function is equivalent to jnp.linalg.matrix_power(x, n).

Examples

>>> dq.powm(dq.sigmax(), 2)
Array([[1.+0.j, 0.+0.j],
       [0.+0.j, 1.+0.j]], dtype=complex64)