Provides the quantum operatios for a full-adder with the specified input and output indices. Uses the circuit developed by Cheng and Tseng <DOI:10.1049/el:20020949>. Uses CNOT and TOFFOLI gates, with the TOFFOLI gates being broken down into H, T, and CNOT gates. The SUM (qu)bit gets places where the b operand (qu)bit is.
Usage
FullAdder(n=4,cin=0,a=1,b=2,cout=3)
Arguments
n
Number of qubits in input quantum state
cin
index of the carry in (qu)bit
a
Index of the first operand (qu)bit
b
Index of the second operand (qu)bit
cout
Index where the output carry (qu)bit will be placed
Value
A list with elements containing the quantum operations (matrices) for the full adder in each cycle.