-
Notifications
You must be signed in to change notification settings - Fork 376
Refactor Shor's algorithm #933
Comments
@Cryoris I would like to take on this issue! As proposed, I would replace the generic In terms of making use of |
Sounds great! Thanks for also thinking of the type hints 😉
I think we could make this more efficient if we would not re-construct the circuits in every function call. If you see that circuits are the same and only the qubits they get applied to changes, then you could construct the circuit once and store it.
The extend method will soon be deprecated (see Qiskit/qiskit#4208). If you want to add a circuit to another circuit you can use Also there is a generic If you have any questions, need input or just want to discuss something, let me know! |
Thanks for the help @Cryoris, I like the ability of casting to For a complete solution, I'm trying to cast those functions to gates too (both can leverage I suppose I could store this number using a classical register, if that didn't make things too complicated. |
Hmm in principle there's the I think it would be okay to reconstruct the circuits here, in the end the expensive part is transpiling the circuits, not building them. In future, we could either rewrite the _get_angles function to use the available operations on |
What is the expected enhancement?
Shor's algorithm could use a refactor, it currently uses a lot of old Qiskit logic which could be written in a much more compact manner. For instance the
inverse()
method of circuits and gates and thecontrol()
method of gates could be leveraged. Also things likeU3(pi, 0, pi)
can be placed by the proper gateX
, since there is no performance deterioration anymore for this change (right?).This would be a nice project to start contributing, since one needs to get to know both Shor's algorithm and what circuits can do in current Qiskit.
The text was updated successfully, but these errors were encountered: