qutip_qip.decompose

Unitary decomposition. (experimental)

Functions

decompose_one_qubit_gate(input_gate, method)

An input 1-qubit gate is expressed as a product of rotation matrices \(\textrm{R}_i\) and \(\textrm{R}_j\) or as a product of rotation matrices \(\textrm{R}_i\) and \(\textrm{R}_j\) and a Pauli \(\sigma_k\).

qutip_qip.decompose.decompose_one_qubit_gate(input_gate, method)[source]

An input 1-qubit gate is expressed as a product of rotation matrices \(\textrm{R}_i\) and \(\textrm{R}_j\) or as a product of rotation matrices \(\textrm{R}_i\) and \(\textrm{R}_j\) and a Pauli \(\sigma_k\).

Here, \(i \neq j\) and \(i, j, k \in {x, y, z}\).

Based on Lemma 4.1 and Lemma 4.3 of https://arxiv.org/abs/quant-ph/9503016v1 respectively.

\[\begin{split}U = \begin{bmatrix} a & b \\ -b^* & a^* \\ \end{bmatrix} = \textrm{R}_i(\alpha) \textrm{R}_j(\theta) \textrm{R}_i(\beta) = \textrm{A} \sigma_k \textrm{B} \sigma_k \textrm{C}\end{split}\]

Here,

  • \(\textrm{A} = \textrm{R}_i(\alpha) \textrm{R}_j\left(\frac{\theta}{2} \right)\)

  • \(\textrm{B} = \textrm{R}_j \left(\frac{-\theta}{2} \right)\textrm{R}_i \left(\frac{- \left(\alpha + \beta \right)}{2} \right)\)

  • \(\textrm{C} = \textrm{R}_i \left(\frac{\left(-\alpha + \beta\right)}{2} \right)\)

Parameters
input_gatequtip.Qobj

The matrix to be decomposed.

methodstring

Name of the preferred decomposition method

Method Key

Method

ZYZ

\(\textrm{R}_z(\alpha) \textrm{R}_y(\theta) \textrm{R}_z(\beta)\)

ZXZ

\(\textrm{R}_z(\alpha) \textrm{R}_x(\theta) \textrm{R}_z(\beta)\)

ZYZ_PauliX

\(\textrm{A} \sigma_k \textrm{B} \sigma_k \textrm{C}\) \(\forall k =x, i =z, j=y\)

Note

This function is under construction. As more combinations are added, above table will be updated with their respective keys.

Returns
tuple

The gates in the decomposition are returned as a tuple of Gate objects.

When the input gate is decomposed to product of rotation matrices - tuple will contain 4 elements per each \(1 \times 1\) qubit gate - \(\textrm{R}_i(\alpha)\), \(\textrm{R}_j(\theta)\) , \(\textrm{R}_i(\beta)\), and some global phase gate.

When the input gate is decomposed to product of rotation matrices and Pauli - tuple will contain 6 elements per each \(1 \times 1\) qubit gate - 2 gates forming \(\textrm{A}\), 2 gates forming \(\textrm{B}\), 1 gates forming \(\textrm{C}\), and some global phase gate.