-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Transpiler to support advanced functionality #824
Conversation
dag_drawer: add edge labels and better write register indexing
Clarify dagcircuit test
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 new revision removes a lot of the previous coupling and we are ready to move forward. I've left some non-blocking comments but we can merge and polish in the future. Just remember to open issues for tracking the issues you find most important.
qiskit/transpiler/_basepasses.py
Outdated
if isinstance(value, Hashable): | ||
arguments.append((name, type(value), value)) | ||
else: | ||
arguments.append((name, type(value), str(value))) |
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.
Non-blocking but perhaps we should raise and enforce you use hashable parameters. Don't know.
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 think we should allow non-hashable params, at least for now. Chanching str
to repr
in 400be85
qiskit/transpiler/_basepasses.py
Outdated
**kwargs: kwargs to normalize | ||
|
||
Returns: | ||
Tuple: normalized (args, kwargs) |
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.
Non-blocking, can we indicate the type (list
and dict
) of args
and kwargs
?
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.
fixed in d261a96
qiskit/transpiler/_passmanager.py
Outdated
'max_iteration': max_iteration} | ||
|
||
# Default controllers | ||
FlowController.add_flow_controller('condition', ConditionalController) |
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.
Should not be module-level code? It is weird to register and re-register each time there we instantiate a new pass manage.
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.
Fixed in e08e230.
qiskit/transpiler/_passmanager.py
Outdated
super().__init__(passes, options, **partial_controller) | ||
|
||
def __iter__(self): | ||
iteration = 0 |
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.
Non-blocking although I think this is more readable as follows (at least, it avoids the infinite look and make it clear reaching the max_iteration
is something bad):
for iteration in range(self.max_iteration):
for pass_ in self.passes
yield pass_
if not self.do_while():
return
raise TranspileError(...)
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.
Much better. Fixed in 4e7d862
@1ucian0, defore merging, can we squash the 111 commits into 1 and provide a meaningful description for the commit? |
"meaningful description":
|
Merged in #1060 |
Fix #825
Summary
The current transpiler is very basic and does not implement several of the discussed ideas. This PR tries to be an implementation of them. See details in #825