This sample builds on top of the quantum adder, and extends it with a carry bit
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:
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"