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

Function MAJ

Extensions/QAlg/ArithmeticUnit/ArithmeticUnit.cpp:6–14  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4
5
6QPANDA_BEGIN
7
8QCircuit MAJ(Qubit* a, Qubit* b, Qubit* c)
9{
10 QCircuit circuit;
11 circuit << CNOT(c, b) << CNOT(c, a) << X(c).control({ a, b });
12
13 return circuit;
14}
15
16QCircuit UMA(Qubit* a, Qubit* b, Qubit* c)
17{

Callers 3

addWithCinMethod · 0.70
MAJ2Function · 0.70
QAdderFunction · 0.70

Calls 3

CNOTClass · 0.85
XClass · 0.85
controlMethod · 0.45

Tested by

no test coverage detected