# What is the point of building arithmetic circuits in a quantum computer?

My question simply is the following: is there any interests in building arithmetic circuits such as adders or multiplier on a quantum computer?

I'm asking this because it seems that classical computers are way better at doing arithmetic operations, so even if a quantum algorithm needs to do some arithmetics, wouldn't it be better to let a classical computer handle this part and then return the results to the quantum computer so it can then continue to run the algorithm?

Remember that quantum computers contain, as a subset, the classical logic gates. So your assertion that "classical computer are way better at doing arithmetic operations" is not entirely clear. Unless you mean that the current state of the art quantum computers are not as good as classical computers.

That said, I can think of two reasons why we might want to implement simple arithmetic on a quantum computer:

• it might be that the algorithms are more efficient. As I said, classical computation is a subset. So, we have something else as well, and if we're smart, perhaps we can improve the algorithms using that something extra.

• if you want to use the result of the calculation within part of a larger computation. You cannot just farm this out to a classical computer due to linearity. Fine, if the QC is guaranteed to be in a basis state $$|a\rangle|b\rangle|0\rangle$$ then you might think you could prepare $$|a\rangle|b\rangle|a\oplus b\rangle$$ by computing $$a\oplus b$$ and just making the state. But if any of the registers are in a superposition, you would be unable to read all the values, and unable to prepare a suitable superposition. The calculation has to be done within the quantum computer to preserve the linearity of the operation. It might be defined on computational basis states, but must work just as well for superpositions.

Yes, it is practical!

Generally speaking, sometimes you would like to load superposition of states, where the arithmetic operation on them is entangled with each state, aiming to ask some interesting questions about this new variable.

I will add a disclaimer that I referred to examples that use Classiq, and I am a Classiq employee

Quantum arithmetic circuits are useful in implementing "oracles" in various general quantum algorithms. For example, if we want to apply Grover's algorithm to solve a real Traveler's salesman problem, we need to implement the "oracle" inside the quantum circuit. Of course, in this case, we still need the conventional computer to prepare the quantum circuits according to the specific Traveler's salesman problem, including how cities are connected and weights are assigned to roads.

Generally speaking, you're right that you want to do as much of the arithmetic as you can on classical computers. But in a quantum algorithm, many of the values you need to do arithmetic to will be superposed. A classical computer won't be able to operate on them without decohering the superposition.

It's not always easy to tell if you can move arithmetic from a quantum computer to a classical computer. For example, superposition masking can move the computation of a modular multiplicative inverse from the quantum computer to a classical computer but it still requires the quantum computer to do multiplications. Also, it fails to uncompute the input.