# How to deterministically add two integers on a quantum computer

I am new to the Quantum Computer world. I understand the basics of Quantum mechanics and I have watched a few lectures on Quantum computers, Quantum gates and played a bit on IBM QC.

As far as I understand every qubit and every QC will output a probabilistic value. For example 1+1 could be

1. 0
2. 1
3. 2

How can we do a deterministic simple computation like 1+1=2 via a quantum computer? and if we can, how can it be faster than a classical computer?

I think you’ve got the basic idea, but a few concepts mixed up.

Every QC will give a probabilistic output only if it is in superposition. If you do not put it into superposition, addition behaves exactly like it would on a classical computer. If you run 1+1 on a QC and do not get 2, this could be due to noise of the quantum computer, rather than anything else coming into play.

Quantum computers provide speed ups in harder problems, but I don’t think it will help you perform simpler circuits such as 1+1 any faster. As many things can be done equally as fast on a classical computer, we use them both side-by-side.

Head over to https://qiskit.org/textbook/preface.html where explanations are simple and easy to learn from.

There are quite a few ways to make an adder on QC. I recommend watching Circuit Sessions with Ali Javadi, demo notebook from the talk
so, a simple explanation, what makes a quantum computer faster than a classical computer in some hard problems, is always quantum resources, like

• superposition(example like Hadamard gate in Deutsch–Jozsa algorithm where $$N$$qubit $$= 2^n$$ classical states),
• entanglement(example like bell state), and
• interference(example like Grover search amplitude amplification)

but may be you want to ask about gate time, but in mind that different types of quantum computers have their own advantages in application scenarios.