Skip to content

dq.sinm

sinm(x: QArrayLike) -> QArray

Returns the sine of a qarray.

Parameters

  • x (qarray-like of shape (..., n, n)) –

    Square matrix.

Returns

(qarray of shape (..., n, n)) Sine of x.

Note

This function uses jax.scipy.linalg.expm() to compute the sine of a matrix \(A\): $$ \sin(A) = \frac{e^{iA} - e^{-iA}}{2i} $$

Examples

>>> dq.sinm(0.5 * jnp.pi * dq.sigmax())
QArray: shape=(2, 2), dims=(2,), dtype=complex64, layout=dense
[[0.-0.j 1.-0.j]
 [1.-0.j 0.-0.j]]