Function cloneQureg

Source
pub unsafe extern "C" fn cloneQureg(
    targetQureg: Qureg,
    copyQureg: Qureg,
)
Expand description

Overwrite the amplitudes of \p targetQureg with those from \p copyQureg.

Registers must either both be state-vectors, or both be density matrices, and of equal dimensions. Only the quantum state is cloned, while auxilary info (like recorded QASM) is unchanged. copyQureg is unaffected.

@see

  • createCloneQureg()
  • initPureState()
  • setWeightedQureg()

@ingroup init @param[in, out] targetQureg the qureg to have its quantum state overwritten @param[in] copyQureg the qureg to have its quantum state cloned into targetQureg. @throws invalidQuESTInputError()

  • if \p targetQureg is a state-vector while \p copyQureg is a density matrix (and vice versa)
  • if \p targetQureg and \p copyQureg have different dimensions @author Tyson Jones