The Carry and Sum Networks by Vedral et.al

Peter Belkner <pbelkner@snafu.de>

The following figure and it's caption is taken from quant-ph/9511018 (Vedral et.al.: Quantum networks for elementary arithmetic operations).

Basic carry and sum operations for the plain addition network. i) the carry operation (note that the carry operation perturbs the state of the qubit b). ii) the sum operation.

1 .The Carry Network

The Carry Network is a sequence of control-control-not gate, a control-not gate and another control-control-not gate.

void EqcsVedral::carry(EqcsGateArray &a, int b0, int b1, int b2, int b3)
{
    a.push_back(CCNot(b0, b1, b2));
    a.push_back(CNot(b1, b2));
    a.push_back(CCNot(b0, b1, b3));
}
Listing 1: The carry network.

2. The Carry Network in Reversed Order

void EqcsVedral::rcarry(EqcsGateArray &a, int b0, int b1, int b2, int b3)
{
    a.push_back(CCNot(b0, b1, b3));
    a.push_back(CNot(b1, b2));
    a.push_back(CCNot(b0, b1, b2));
}
Listing 2: The carry network in reversed order.

3. The Sum Network

void EqcsVedral::sum(EqcsGateArray &a, int b0, int b1, int b2)
{
    a.push_back(CNot(b0, b1));
    a.push_back(CNot(b0, b2));
}
Listing 3: The sum network.

4. The Sum Network in Reversed Order

void EqcsVedral::rsum(EqcsGateArray &a, int b0, int b1, int b2)
{
    a.push_back(CNot(b0, b2));
    a.push_back(CNot(b0, b1));
}
Listing 4: The sum network in reversed order.


Peter Belkner <pbelkner@snafu.de>