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

Method execute

Core/QuantumMachine/QProgCheck.cpp:12–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10}
11
12void QProgCheck::execute(std::shared_ptr<AbstractQGateNode> cur_node, std::shared_ptr<QNode> parent_node, TraversalConfig &param)
13{
14 bool dagger = cur_node->isDagger() ^ param.m_is_dagger;
15 if (cur_node->getTargetQubitNum() <= 0)
16 {
17 QCERR("Unknown internal error");
18 throw runtime_error("Unknown internal error");
19 }
20
21 QVec control_qubit_vector;
22 cur_node->getControlVector(control_qubit_vector);
23
24 if (param.m_control_qubit_vector.size() > 0)
25 {
26 control_qubit_vector.insert(control_qubit_vector.end(),
27 param.m_control_qubit_vector.begin(), param.m_control_qubit_vector.end());
28 }
29
30 QVec target_qubit;
31 cur_node->getQuBitVector(target_qubit);
32 is_can_optimize_measure(control_qubit_vector, target_qubit, param);
33
34 return ;
35}
36
37void QProgCheck::execute(std::shared_ptr<AbstractQuantumMeasure> cur_node, std::shared_ptr<QNode> parent_node, TraversalConfig &param)
38{

Callers 5

run_with_optimizingMethod · 0.45
runMethod · 0.45
runWithConfigurationMethod · 0.45
runWithConfigurationMethod · 0.45
runMethod · 0.45

Calls 15

getTargetQubitNumMethod · 0.80
getQuBitVectorMethod · 0.80
getQubitAddrMethod · 0.80
getPhysicalQubitPtrMethod · 0.80
getCExprMethod · 0.80
getTrueBranchMethod · 0.80
getFalseBranchMethod · 0.80
getNextIterMethod · 0.80
isDaggerMethod · 0.45
getControlVectorMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected