-
Notifications
You must be signed in to change notification settings - Fork 14
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 optimisation_level
3 using GreedyPauliSimp
#546
Conversation
passlist.extend( | ||
[ | ||
RemoveBarriers(), | ||
AutoRebase({OpType.CX, OpType.Rz, OpType.H}), |
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 more gates that GreedyPauliSimp
can handle so the rebase can run faster. Also easier for the Pauli graph conversion.
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
thread_timeout=timeout, | ||
trials=10, |
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.
When GreedyPauliSimp
returns false, will the user know the cause, so they can, for example, try increasing the timeout?
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.
They won't & I can't think of a good way of sharing this information in the code. Might just have to make it clear in the documentation?
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 see. Can we print out some information in the C++ code? If you think that's possible, we should create an issue for this.
else: | ||
passlist.extend( | ||
[ | ||
RemoveBarriers(), |
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 we also issue a warning if the circuit contains barriers?
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.
good point, added to the new overloaded get_compiled_circuit
method
@@ -655,14 +657,16 @@ def rebase_pass(self) -> BasePass: | |||
allow_swaps=self.compilation_config.allow_implicit_swaps, | |||
) | |||
|
|||
def default_compilation_pass(self, optimisation_level: int = 2) -> BasePass: | |||
def default_compilation_pass( |
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 also document the timeout
parameter
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
@@ -655,14 +657,16 @@ def rebase_pass(self) -> BasePass: | |||
allow_swaps=self.compilation_config.allow_implicit_swaps, | |||
) | |||
|
|||
def default_compilation_pass(self, optimisation_level: int = 2) -> BasePass: | |||
def default_compilation_pass( | |||
self, optimisation_level: int = 2, timeout: int = 300 |
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.
It seems the user cannot set a timeout
when calling get_compiled_circuit
. Any thoughts on this?
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've added get_compiled_circuit
and get_compiled_circuits
to QuantinuumBackend
with a timeout parameter
Adds a new optimisation level "3" that uses
GreedyPauliSimp
targetingzzphase
to optimise circuits. This callsRemoveBarriers
, which is part of the motivation for adding it as a new level of optimisation. This mimics the changes topytket-qiskit
.Checklist