MCPcopy Create free account
hub / github.com/QuEST-Kit/QuEST / getDFT

Function getDFT

tests/deprecated/test_utilities.cpp:792–808  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790}
791
792QVector getDFT(QVector in) {
793 REQUIRE( in.size() > 0 );
794
795 size_t dim = in.size();
796 qreal ampFac = 1 / sqrt( dim );
797 qreal phaseFac = 2 * M_PI / dim;
798
799 QVector dftVec = QVector(dim);
800
801 for (size_t x=0; x<dim; x++) {
802 dftVec[x] = 0;
803 for (size_t y=0; y<dim; y++)
804 dftVec[x] += expI(phaseFac * x * y) * in[y];
805 dftVec[x] *= ampFac;
806 }
807 return dftVec;
808}
809
810long long int getValueOfTargets(long long int ind, int* targs, int numTargs) {
811 DEMAND( ind >= 0 );

Callers 1

test_operators.cppFile · 0.85

Calls 3

expIFunction · 0.85
getValueOfTargetsFunction · 0.85
getIndexOfTargetValuesFunction · 0.85

Tested by

no test coverage detected