I am working on a project where I need to calculate 3x+1 for numbers 0 to infinity. I have an 8GB RAM laptop and I am using Cirq. For small numbers, I was able to perform the multiplication using the Computational basis (half and full adder logic), however, I am facing a memory error with large numbers. I decided to opt for the Quantum Fourier Transform and perform multiplication within the QFT realm. The problem is that I am not finding an algorithm where I can perform the multiplication of large numbers by 3 that I can implement and doesn't require so much memory. I am stuck. What can I do?
1 Answer1
It sounds like you're very confused about quantum computers, but regardlesshere's a decomposition that multiplies a 2s-complement integer by an odd number$K$ (mod$2^n$):
To multiply by 3 specifically it's just controlled increments:
- $\begingroup$thank you for replying. I am actually very confused, this is my first time working on something like this. My aim is to multiply large numbers (tending to infinity) by 3. From what I understood, the code you provided me with does that classically, I want to do it using quantum gates. According to my research, the way to do it is to apply QFT, use phase shift to multiply by 3, then apply IQFT. I don't know how to implement that yet. I feel like there is an easier and less memory-consuming way to multiply by 3, but I haven't found anything like that online.$\endgroup$karen– karen2024-06-19 15:38:18 +00:00CommentedJun 19, 2024 at 15:38
- $\begingroup$@karen A reversible classical circuit, run on a quantum computer, is a perfectly good quantum circuit. The circuit I gave is a classical multiplier, and also a quantum multiplier. And much easier to implement than ones using a Fourier transform such asarxiv.org/abs/2403.18006 .$\endgroup$Craig Gidney– Craig Gidney2024-06-19 16:46:45 +00:00CommentedJun 19, 2024 at 16:46
Explore related questions
See similar questions with these tags.

