Function quest_sys::compactUnitary

source ·
pub unsafe extern "C" fn compactUnitary(
    qureg: Qureg,
    targetQubit: c_int,
    alpha: Complex,
    beta: Complex
)
Expand description

Apply a single-qubit unitary parameterised by two given complex scalars. Given valid complex numbers \f$\alpha\f$ and \f$\beta\f$, applies the unitary \f[ U = \begin{pmatrix} \alpha & -\beta^* \ \beta & \alpha^* \end{pmatrix} \f] which is general up to a global phase factor. Valid \f$\alpha\f$, \f$\beta\f$ satisfy \f$|\alpha|^2 + |\beta|^2 = 1\f$.

\f[ \begin{tikzpicture}[scale=.5] \node[draw=none] at (-3.5, 0) {target};

\draw (-2,0) – (-1, 0); \draw (1, 0) – (2, 0); \draw (-1,-1)–(-1,1)–(1,1)–(1,-1)–cycle; \node[draw=none] at (0, 0) {U}; \end{tikzpicture} \f]

@see

  • controlledCompactUnitary()
  • unitary()
  • twoQubitUnitary()
  • multiQubitUnitary()

@ingroup unitary @param[in,out] qureg object representing the set of all qubits @param[in] targetQubit qubit to operate on @param[in] alpha complex unitary parameter (row 1, column 1) @param[in] beta complex unitary parameter (row 2, column 1) @throws invalidQuESTInputError()

  • if \p targetQubit is outside [0, \p qureg.numQubitsRepresented)
  • if \p alpha, \p beta don’t satisfy |alpha|^2 + |beta|^2 = 1 @author Ania Brown (state-vector) @author Tyson Jones (density matrix, doc)