qp.math.convert_to_su2

convert_to_su2(U)[source]

Convert a 2x2 unitary matrix to \(SU(2)\). (batched operation)

Parameters:

U (array[complex]) – A matrix with a batch dimension, presumed to be of shape \(n \times 2 \times 2\) and unitary for any positive integer n.

Returns:

A \(n \times 2 \times 2\) matrix \(V\in SU(2)\) and the corresponding global phase \(\alpha\) such that \(U=Ve^{i\alpha}\).

Return type:

array[complex], float