Description:
We present a method based on Mealy machines for constructing reversible circuitry for multiplying integers by arbitrary integer constants. The circuits generate no garbage and use no ancillae. The circuits are quite compact for small constants and are, in the worst case, bounded by O( n 2 ) multi-control Toffoli gates per bit-slice, where n is the number of bits in the constant. These gates will have O( n ) inputs, so the total number of pass-transistors needed to implement the circuit is O( n 3 ) transistors per bit slice, and the quantum cost (which is exponential in the number of inputs to a Toffoli gate) is O(2 n ). For some interesting cases, the cost can be reduced to O( n ) gates per bit-slice, reducing the cost to O( n 2 ) transistors per bit slice. The quantum cost is still O(2 n ), as the remaining gates have O( n ) inputs. We also look at an alternative construction that, at the cost of adding O( n ) ancillae, reduces the cost for arbitrary constants to O( n ) gates, O( n 2 ) transistors, though still with O(2 n ) quantum cost.