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

Function Simon_QProg

Applications/SimonAlgorithm/SimonAlgorithm.cpp:93–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93QProg Simon_QProg(vector<Qubit*> qVec, vector<ClassicalCondition> cVec, vector<int> funvalue)
94{
95 size_t length = cVec.size();
96 auto simon_qprog = CreateEmptyQProg();
97 for (auto i = 0; i < length; i++)
98 {
99 simon_qprog << H(qVec[i]);
100 }
101 simon_qprog << oraclefunc(qVec,funvalue);
102 for (auto i = 0; i < length; i++)
103 {
104 simon_qprog << H(qVec[i]);
105 }
106 for (auto i = 0; i < length; i++)
107 {
108 simon_qprog << Measure(qVec[i],cVec[i]);
109 }
110 return simon_qprog;
111}
112
113int main()
114{

Callers 1

mainFunction · 0.85

Calls 3

HClass · 0.85
oraclefuncFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected