# What is the best way to use loop statements on a quantum computer?

I am interested in solving a time dependent linear partial differential equation of the form $$Ax=b$$ which, in classical computing, would amount to looping over solutions of $$Ax=b$$ where $$b$$ is updated each step.

My question is, is there a quantum analog to the looping procedure that I have described? If not, does that imply that to solve this one would need to write a loop on the classical system which calls the quantum solver each step? In case it is relevant, I am using the IBMQ system.

This question is related to this post.

• isn't this the same question asked in the linked post? – glS Sep 21 at 14:06
• It is certainly similar, but different because the linked question asked if loops are faster on a quantum versus classical computers. I understand that they are not, but I am looking for a solution to the problem that I face (see post). Additionally, I posted a comment to the other post but was told to ask a new question. – thespaceman Sep 21 at 15:51
• so you are asking if there is a quantum algorithm to solve linear equations? (that doesn't look like a partial differential equation the way you wrote it). If so, are you aware of HHL09? The title of the post should be updated to reflect what you are actually asking. As of now, the question in the title looks like essentially a duplicate of the linked post – glS Sep 21 at 16:54
• No, this is not what I am asking. A partial differential equation can be discretized and written in the form $Ax=b$. I am already working with the HHL algorithm to solve simple steady pde's. In the future, I hope to solve unsteady pde's which, on a classical computer, involves looping over the system $Ax=b$ wherein each iteration $b$ is updated from the solution of $x$. I would like to find out if there is some analogue of this iterative process on a quantum computer which would not involve a loop. – thespaceman Sep 21 at 19:22
• that is all information which should be added to the question, to make it clear what exactly you are asking – glS Sep 21 at 20:02