-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BQSKit is crashing when trying to compile a unitary using a gate set that has only VariableUnitaryGate #286
Comments
I think that the root cause of this crash is the way a layer generator is created from a gate set. When a layer generator isn't given to QSearch (and to LEAP), then it asks the gate set object to generate a layer generator, using the function In our case, there is no single qubit gate, so the above function adds the U3 as a single qubit, which in turn QFactor can't handle. BQSKit shouldn't have added a gate that wasn't part of the original gate set. This behaviour is documented In my case, I can bypass this issue, by directly creating QSearch and providing it with the correct layer generator |
Most gate sets will not include a general single-qudit gate, so we introduce one during compilation stages that focus on multi-qudit gate optimization/transpilation. You are right; in this case and cases like this, we shouldn't be mocking with the gate set. We should check if the gate set contains multi-qudit general gates. If so, we don't need to use the layer generator with single-qudit gates added. |
I have a different perspective. If the user has explicitly provided a gate set, the tool shouldn't change it. The tool can give a warning or an error if the gate set isn't general enough or has other issues. |
In the case that I am referring to, the gate set is modified for specific compilation stages. The later stages reverse the modifications, so the user gate set is always honored. |
OK, then your solution above looks good |
The following code makes BQSkit crash with
pyo3_runtime.PanicException: not implemented
. Probably QFactor is getting a circuit with gates it can't handle.The text was updated successfully, but these errors were encountered: