-
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
Internal global backend _Global
#1440
Merged
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
bdbdc7e
GlobalBackend -> _Global
98d07ff
GlobalBackend -> _Global
b3fcc2a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f8a3cfc
disable not callable error
5b312bf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4697a9f
disable not callable error
e58157b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 583d26b
fix bug
2419d7d
add funcs
e8126a2
Merge branch 'master' into qibo_global
32ed23a
update test funcs
435c5f5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 94cb879
update review
53fa831
Merge branch 'master' into qibo_global
efb22c5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b2f82d5
update test files
c828f67
Merge branch 'master' into qibo_global
8b3a95a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 352015b
fix test
59b0c71
qcnn.py get_backend -> get_backend_name
907bebb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7cd16a4
remove resolve_global
a3c993d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 79ef360
remove resolve_global
b3614a4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 69189f4
remove resolve_global
0f68533
fix test_backends_global
b9b10d7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2dc6797
add reset_global
cf39210
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b7209ad
add reset global
f0a4c4c
Merge branch 'qibo_global' of github.com:qiboteam/qibo into qibo_global
c6391b6
fix error mitigation
23f6054
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a63fbe9
update docs (replace 'GlobalBackend')
a3083d7
Merge branch 'qibo_global' of github.com:qiboteam/qibo into qibo_global
15be594
coverage
6a1c921
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d4670f6
fix test_set_get_transpiler
6b04315
Merge branch 'qibo_global' of github.com:qiboteam/qibo into qibo_global
5c32260
Merge branch 'master' into qibo_global
dcd318a
add clear in conftest.py
3e99140
pytest autouse & default transpiler prototype
535c5a4
hw backend prototype
eba4f5e
hw backend prototype
5613c4c
fix: hw attributes check
b44c13a
fix: temporary _default_transpiler for current transpiler
11548da
feat: create NativeGates from list[str]
fcfb579
Merge branch 'master' into qibo_global
e0292cc
fix: return value of default transpiler
3c29f61
feat: test files for _Global._default_transpiler
3eeff46
fix: unused import/vars
a4ee205
fix: else after return
be12cf9
fix: improve star/line/grid connectivity helper functions
84dc20c
fix: remove Nativegates.from_gate(str)
bdb31b5
fix: remove _Global._backend usage / deprecate get_backend_name
6fe4205
fix: remove pragma / improve _execute_circuit in error_mitigation.py
9e7cc6b
fix: add pragma
8c02e78
Merge branch 'master' into qibo_global
6c77fde
fix: minor docstring update
e913307
feat: enable initializing NativeGates from list[str]
933f08c
fix: pylint error
08107cd
fix: Flag OR operation in FlagMeta
0990076
fix: Restore previous flag meta implementation
alecandido 5d260e3
fix: add docstring in FlagMeta
3bc74dd
Merge branch 'qibo_global' of github.com:qiboteam/qibo into qibo_global
731b8a1
fix: undef variable
33a9984
fix: type hint update
65bdfee
fix: type hint update for python3.9
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure you can't import this top-level as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, moving all of them to the top causes errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you reconstruct the reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the circular dependency. Would you like to address this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, I'm opening a separate issue for circular dependencies in general.
The part I was interested in was which circular dependency (i.e. reconstructing the circle).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The loop is roughly structured like this: many modules in
qibo.__init__.py
import thebackends
at the top of their files. (Because of_check_backend()
andget_backend()
) If we import the transpiler at the top ofbackends.__init__.py
, it causes a circular import because many transpiler modules rely onqibo.models.Circuit
, which depends on the backend.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed all
from qibo.models import Circuit
inqibo/transpiler
, and it worked. Most of theCircuit
imports were only used for type hints. In the other cases, I movedfrom qibo.models import Circuit
inside the functions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is truly a
qibo-core
-related problem once again, since theCircuit
should be one of the most basic instances, and instead is effectively depending on the backends' machinery through its.execute()
method...Thanks for the investigation, I lifted your comment into #1490, you can resolve this conversation.