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

Function shift

QAlg/ArithmeticUnit/ArithmeticUnit.cpp:192–201  ·  view source on GitHub ↗

* @brief Shift the quantum state one bit to the left * @ingroup ArithmeticUnit * @param[in] a qubits * @return QCircuit * @note The result of shift is saved in a. */

Source from the content-addressed store, hash-verified

190* @note The result of shift is saved in a.
191*/
192QCircuit shift(QVec& a)
193{
194 QCircuit circ;
195 auto len = a.size();
196 for (auto i = len - 1; i > 0; i--)
197 {
198 circ << SWAP(a[i], a[i - 1]);
199 }
200 return circ;
201}
202
203QCircuit QMultiplier(QVec& a, QVec& b, QVec& k, QVec& d)
204{

Callers 3

QMultiplierFunction · 0.70
QDividerFunction · 0.70
canonicalizeMethod · 0.50

Calls 2

SWAPClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected