Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 790 Bytes

README.md

File metadata and controls

28 lines (18 loc) · 790 Bytes

Quantum adder with carry

This sample builds on top of the quantum adder, and extends it with a carry bit

Running the sample

To run this application, simply run mvn clean javafx:run

The expected outcome on the console looks like this:

Adding 0 + 0 = 0
Adding 0 + 1 = 1
Adding 1 + 0 = 1
Adding 1 + 1 = 2

On top of that, the quantum circuit for adding 1 + 1 is shown:

quantum carry adder

What it is doing

This sample adds 2 qubits and uses a carry bit in case an overflow occurs

You can learn more about this sample in Chapter 7 of Quantum Computing for Java Developers. It is discussed in 7.5.2: "Quantum arithmetic with a carry bit"