# Is it possible to implement an in-place multiplication quantum circuit?

How can a reversible multiplication quantum circuit be implemented? By "reversible" I mean one that performs a *= b on the inputs a and b of the multiplication. In this case, it is reversible because the inverse operation a /= b exists. I believe the multiplication requires some ancilla bits, but it needs to be able to be reset to |0> by uncomputation after multiplication.

My explanation may have been insufficient, so I will write it in more detail. The multiplier circuit I am trying to build is one that calculates the product for input registers a and b and sets it in register a. Namely,

$$|a\rangle|b\rangle \rightarrow |a\times b\rangle |b\rangle$$

The necessary ancilla bits must be able to be set back to $$|0\rangle$$ by uncomputation.

$$|a\rangle|b\rangle|00\dots0\rangle_a \rightarrow |a\times b\rangle |b\rangle|00\dots0\rangle_a$$

• Thanks for the reference! If I understand correctly, the implementation described in that paper requires a separate register to output the product. The circuit I want to know is a *= b i.e. the product of a * b is set to a (my explanation was lacking, sorry). Is this possible? Jun 1, 2022 at 23:33
Specifically, the $$AND$$ gate can be built using the $$CCNOT$$ (Toffoli) gate. Adding the $$NOT$$ gate, which is already reversible, and we have a (classical) universal set of gates using $$NAND$$.
• Thank you! I added a description to my question, and I can't come up with a good digital circuit for a case like $|a\rangle|b\rangle \rightarrow |a\times b\rangle|b\rangle$ where the product is output to the input register. Jun 3, 2022 at 4:39