Function 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$.

@htmlonly

@endhtmlonly

@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)