-
Notifications
You must be signed in to change notification settings - Fork 48
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
Add kwargs to arguments for Backend.get_compiled_circuit #962
Conversation
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 probably add to changelog, as this is an API change.
pytket/pytket/backends/backend.py
Outdated
@@ -144,7 +143,9 @@ def rebase_pass(self) -> BasePass: | |||
... | |||
|
|||
@abstractmethod | |||
def default_compilation_pass(self, optimisation_level: int = 2) -> BasePass: | |||
def default_compilation_pass( | |||
self, optimisation_level: int = 2, **kwarfs |
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.
self, optimisation_level: int = 2, **kwarfs | |
self, optimisation_level: int = 2, **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.
Now that's an embarrassing one, fixed!
pytket/pytket/backends/backend.py
Outdated
""" | ||
return_circuit = circuit.copy() | ||
self.default_compilation_pass(optimisation_level).apply(return_circuit) | ||
self.default_compilation_pass(optimisation_level, kwargs).apply(return_circuit) |
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.
self.default_compilation_pass(optimisation_level, kwargs).apply(return_circuit) | |
self.default_compilation_pass(optimisation_level, **kwargs).apply(return_circuit) |
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.
done
pytket/pytket/backends/backend.py
Outdated
@@ -213,7 +217,9 @@ def get_compiled_circuits( | |||
:return: Compiled circuits. | |||
:rtype: List[Circuit] | |||
""" | |||
return [self.get_compiled_circuit(c, optimisation_level) for c in circuits] | |||
return [ | |||
self.get_compiled_circuit(c, optimisation_level, kwargs) for c in circuits |
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.
self.get_compiled_circuit(c, optimisation_level, kwargs) for c in circuits | |
self.get_compiled_circuit(c, optimisation_level, **kwargs) for c in circuits |
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.
done
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.
Ah! Is this going to break all the backends?
Yeah, they're all going need to have |
But it does mean that if someone updates pytket their code will stop working, which breaks the 1.x API promise. We could make new |
Good point, I didn't think about people updating That's a good idea - I'll do that now. |
Do you think I should also include |
Rethinking this whole thing... |
No description provided.