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

Function oraclefunc

Applications/SimonAlgorithm/SimonAlgorithm.cpp:82–91  ·  view source on GitHub ↗

f(x),x is 2bits variable

Source from the content-addressed store, hash-verified

80
81//f(x),x is 2bits variable
82QCircuit oraclefunc(vector<Qubit*> qVec, vector<int> funvalue)
83{
84 auto length = qVec.size() / 2;
85 auto func = CreateEmptyCircuit();
86 for (auto i = 0; i < 4; i++)
87 {
88 func << controlfunc(qVec, i, funvalue[i]);
89 }
90 return func;
91}
92
93QProg Simon_QProg(vector<Qubit*> qVec, vector<ClassicalCondition> cVec, vector<int> funvalue)
94{

Callers 1

Simon_QProgFunction · 0.85

Calls 2

controlfuncFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected