-
Notifications
You must be signed in to change notification settings - Fork 61
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
Import loops #1490
Comments
The loop is roughly structured like this: many modules in Originally posted by @csookim in #1440 (comment) |
Came here from the related discussion from #1440. If I understand correctly, the suggestion is to break the loop where the result = circuit(nshots=1000) because this will always have to invoke a (global) backend. Qibo-core may address the problem. The core circuit will be (and should be) backend independent, however if we want to maintain the same execution interface we will still need a higher level qibo circuit that depends on the global backend. If the transpilers only depend on the core circuit though, the cyclic problem should be solved. But then we are breaking the loop in a different place. |
Yes, the current Indeed, the In principle, we could do the same even without Still, I feel like there may be further loops, e.g. involving the transpiler or the measurements. So, at some point (maybe even after |
During #1440 many
import
required to be scoped within functions in order to avoid circular dependencies.This is only a temporary patch, and just a symptom of bad design.
Part of the solution will come with
qibo-core
backends migration[*], but while waiting for it, reconsidering the internal Qibo structure would be also worth. Even because some loops may survive the backend mechanism replacement (especially those related to the_Global
, which won't be necessarily handled byqibo-core
).[*]: it doesn't mean the backends will be migrated to
qibo-core
, which in fact is attempting to stay backend-free, but rather that the imports will change in any caseThe text was updated successfully, but these errors were encountered: