nBitAddition: nBitAddition

Description Usage Arguments Value Examples

View source: R/nBitAddition.R

Description

Strings together output from FullAdder function to create multi-(qu)bit addition. It assumes the input operands are laid out as in <DOI:10.1049/el:20020949>. From left to right (top to bottom) the order is C0, a1, b1, C1, a2, b2, C2, .... bn-1, Cn. There must be 3n+1 qubits in order to perform n-(qu)bit addition.

Usage

1

Arguments

n

Length of input (qu)bit strings.

Value

A list containing the quantum circuit (each elemented is one cycle of the circuit) performing n-bit addition.

Examples

1
2
3
4
## Not run: 
 nBitAddition(2)

## End(Not run)

QuantumOps documentation built on Feb. 3, 2020, 5:07 p.m.