Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.03k stars 2.32k forks source link

UnitarySynthesis pass escapes basis #5228

Open ajavadia opened 3 years ago

ajavadia commented 3 years ago

UnitarySynthesis(basis_gates) pass is supposed to synthesize unitaries over the given basis. However for 3+-qubit unitaries it can generate circuits that are outside the basis. This can be a problem if this pass is used in optimization after basis translation. I think we either restrict this pass to only treat 1-qubit and 2-qubit unitaries, or modify it to ensure the emitted circuit is within the basis.

singhmeet11 commented 3 years ago

Can I work on this issue ??

singhmeet11 commented 3 years ago

Hi, @ajavadia could you please share your code. I am actually having difficulty understanding how this works and what's the proper arguments that we need to pass to the transpiler passes. I know that UnitarySynthesis is applied upon unitary nodes and gives us gate in return so if I wanna apply it on a circuit I will start by using Collect2qBlocks and then use ConsolidateBlocks to get unitary nodes upon which we can perform the UnitarySynthesis but what arguments( *args and **kwargs ) do we have to supply to all of these. I went through the Documentation but there is only one example and the source code got me all confused. Thanks