Function getAmp

Source
pub unsafe extern "C" fn getAmp(
    qureg: Qureg,
    index: c_longlong,
) -> Complex
Expand description

Get the complex amplitude at a given index in the state vector.

@see

  • getDensityAmp()
  • getRealAmp()
  • getImagAmp()
  • getProbAmp()
  • getNumAmps()
  • getNumQubits()

@ingroup calc @param[in] qureg object representing a set of qubits @param[in] index index in state vector of probability amplitudes @return amplitude at index, returned as a Complex struct (with .real and .imag attributes) @throws invalidQuESTInputError()

  • if \p qureg is a density matrix
  • if \p index is outside [0, \f$2^{N}\f$) where \f$N = \f$ \p qureg.numQubitsRepresented @author Tyson Jones