pub unsafe extern "C" fn applySubDiagonalOp(
qureg: Qureg,
targets: *mut c_int,
numTargets: c_int,
op: SubDiagonalOp,
)Expand description
Left-apply a many-qubit a diagonal matrix upon a specific set of qubits of a quantum register.
This is similar to applyGateSubDiagonalOp(), except that here, the operator \p op is only left multiplied onto density matrices.
Let \f$\hat{D}\f$ denote the operator \p op. Precisely, this function effects \f[ |\psi\rangle \rightarrow \hat{D}{\text{targets}} |\psi\rangle \f] upon state-vectors \f$|\psi\rangle\f$, and \f[ \rho \rightarrow \hat{D}{\text{targets}} ; \rho \f] upon density matrices \f$\rho\f$, imposing no numerical conditions (like unitarity) upon \p op.
To apply \p op as if it were unitary, use applyGateSubDiagonalOp() (or use diagonalUnitary() to explicitly check/enforce unitarity).
To apply a full-Hilbert diagonal operator which must ergo itself be distributed, use applyDiagonalOp()
@see
- createSubDiagonalOp()
- applyGateSubDiagonalOp()
- diagonalUnitary()
- applyDiagonalOp()
@ingroup operator @param[in,out] qureg the ::Qureg instance to operate upon @param[in] targets the list of target qubit indices @param[in] numTargets the length of list \p targets, which must match the dimension of \p op @param[in] op a ::SubDiagonalOp with any complex elements @throws invalidQuESTInputError()
- if \p numTargets does not match the size of \p op
- if \p numTargets is invalid (<0 or larger than \p qureg)
- if \p numTargets contains an invalid qubit index, or a repetition @author Tyson Jones