1
$\begingroup$

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?

Mark Spinelli's user avatar
Mark Spinelli
16.3k3 gold badges28 silver badges88 bronze badges
askedJun 17, 2024 at 20:08
karen's user avatar
$\endgroup$

1 Answer1

3
$\begingroup$

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$):

enter image description here

To multiply by 3 specifically it's just controlled increments:

enter image description here

answeredJun 17, 2024 at 21:24
Craig Gidney's user avatar
$\endgroup$
2
  • $\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$CommentedJun 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$CommentedJun 19, 2024 at 16:46

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.