MCPcopy Create free account
hub / github.com/OriginQ/QPanda-2 / FourierADD

Function FourierADD

QAlg/ArithmeticUnit/ArithmeticUnit.cpp:620–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620QCircuit FourierADD(QVec &result, size_t a, size_t b)
621{
622 auto circuit = QCircuit();
623 std::vector<double> angles(b, 0);
624 getAngles(a, b, angles);
625 circuit << QFT(result);
626
627 for (int i = 0; i < result.size(); i++)
628 {
629 circuit << RZ(result[i], angles[b - i - 1]);
630 }
631 circuit << QFT(result).dagger();
632 return circuit;
633}
634
635
636QPANDA_END

Callers 1

test_ADDFunction · 0.50

Calls 6

RZClass · 0.85
getAnglesFunction · 0.70
QCircuitClass · 0.50
QFTFunction · 0.50
sizeMethod · 0.45
daggerMethod · 0.45

Tested by 1

test_ADDFunction · 0.40