goodchemistryco / Tangelo

A python package for exploring end-to-end chemistry workflows on quantum computers and simulators.
https://goodchemistryco.github.io/Tangelo/
Other
99 stars 27 forks source link

Added support for multi-controlled gates on qiskit #390

Closed golanor closed 1 month ago

golanor commented 1 month ago

Added support for multi-controlled gates on qiskit, see #387

golanor commented 1 month ago

Out of curiosity: would considering the CRX, CRY, etc as MCRX, MCRY, ... with a single control qubit be possible ? This would simplify the code, and then we may not even need the crx, cry, crz, gate from Qiskit in the dictionary.

It may be that if a user passes a single integer in the Tangelo gate, the software automatically converts it into a list of 1 element. In that case, the the full list of control qubits can always be passed in the translation.

If I am wrong and this becomes tricky, we can forget about this improvement.

It depends on the end realization - the compilation of the MCR() gates is wasteful compared to the CR() gates. If that doesn't matter then we can probably change it.

Regarding the trailing whitespace - I haven't found where it is happening, or which action fails. Can you please point me to where to find it?

ValentinS4t1qbit commented 1 month ago

It depends on the end realization - the compilation of the MCR() gates is wasteful compared to the CR() gates. If that doesn't matter then we can probably change it.

Then I do not mind leaving them alone, the code is still pretty simple. Thanks for the insight.

Regarding the trailing whitespace - I haven't found where it is happening, or which action fails. Can you please point me to where to find it?

Unexpected: in an unrelated file outside of your PR, I see a whitespace in the printing format. Our linter complains about it. Would you please remove that whitespace ? This way all tests should pass and we're calling this PR done !

../tangelo/algorithms/variational/adapt_vqe_solver.py:322:61: E203 whitespace before ':'

I saw that while checking the list of checks at the bottom of this PR page, and clicking "details". Out of curiosity, are you able to click and access the details of the checks ? It would be troublesome if our users could not see them.

Screenshot 2024-05-29 at 6 26 56 PM

Thank you so much, appreciate your patience on this. Unexpected things happen :)

golanor commented 1 month ago

Unexpected: in an unrelated file outside of your PR, I see a whitespace in the printing format. Our linter complains about it. Would you please remove that whitespace ? This way all tests should pass and we're calling this PR done !

../tangelo/algorithms/variational/adapt_vqe_solver.py:322:61: E203 whitespace before ':'

I saw that while checking the list of checks at the bottom of this PR page, and clicking "details". Out of curiosity, are you able to click and access the details of the checks ? It would be troublesome if our users could not see them.

Thank you so much, appreciate your patience on this. Unexpected things happen :)

I only now realized I can scroll down the checks and see the ones that failed...

Thank you for being so available! I fixed the whitespace issue.