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

Method CR

Core/QuantumCircuit/QGate.cpp:1417–1426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1415}
1416
1417QGate QPanda::CR(Qubit* control_qubit, Qubit* targit_qubit, double theta)
1418{
1419 string name = "CPHASE";
1420 if (control_qubit == targit_qubit)
1421 {
1422 QCERR(" target bit is the same as the control bit");
1423 throw invalid_argument(" target bit is the same as the control bit");
1424 }
1425 return _gs_pGateNodeFactory->getGateNode(name, { control_qubit, targit_qubit }, theta);
1426}
1427
1428QCircuit QPanda::CR(const QVec& targitBits_first, const QVec& targitBits_second, double theta)
1429{

Callers 5

test_layer1Method · 0.45
test_layer1Method · 0.45
test_is_swappableMethod · 0.45
test_get_matrixMethod · 0.45

Calls 4

get_qubit_by_phyaddrFunction · 0.85
QCircuitClass · 0.50
getGateNodeMethod · 0.45
sizeMethod · 0.45

Tested by 4

test_layer1Method · 0.36
test_layer1Method · 0.36
test_is_swappableMethod · 0.36
test_get_matrixMethod · 0.36