Function applyMatrix2

Source
pub unsafe extern "C" fn applyMatrix2(
    qureg: Qureg,
    targetQubit: c_int,
    u: ComplexMatrix2,
)
Expand description

Apply a general 2-by-2 matrix, which may be non-unitary. The matrix is left-multiplied onto the state, for both state-vectors and density matrices.

Note this differs from the action of unitary() on a density matrix.

This function may leave \p qureg is an unnormalised state.

@see

  • ::ComplexMatrix2
  • unitary()

@ingroup operator @param[in,out] qureg object representing the set of all qubits @param[in] targetQubit qubit to operate \p u upon @param[in] u matrix to apply @throws invalidQuESTInputError()

  • if \p targetQubit is outside [0, \p qureg.numQubitsRepresented) @author Tyson Jones