-
Notifications
You must be signed in to change notification settings - Fork 12
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
Overloaded get_compiled_circuit/s
#423
Conversation
@@ -410,7 +410,34 @@ def default_compilation_pass_offline( | |||
passlist.append(FullPeepholeOptimise()) | |||
elif optimisation_level == 3: | |||
passlist.append(RemoveBarriers()) | |||
passlist.append(AutoRebase({OpType.CX, OpType.H, OpType.Rz})) | |||
passlist.append( |
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.
Is this a relevant change, that should be in the changelog, too?
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 don't think we don't need to include this - all I've done is update the set of gates we AutoRebase
to so that it exactly matches what GreedyPauliSimp
accepts. We don't mention this rebase for the GreedyPauliSimp
line of the changelog so I don't think it's worth explicitly pointing out.
:rtype: Circuit | ||
""" | ||
return_circuit = circuit.copy() | ||
if optimisation_level == 3 and circuit.n_gates_of_type(OpType.Barrier) > 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.
Why is this check not in the other function get_compiled_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.
get_compiled_circuits
calls this method so the check is done implicitly
:rtype: Circuit | ||
""" | ||
return_circuit = circuit.copy() | ||
if optimisation_level == 3 and circuit.n_gates_of_type(OpType.Barrier) > 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.
See above
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.
same answer as for AerBackend
The timeout wasn't being passed appropriately in the previous version. This PR overloads the
Backend.get_compiled_circuit
andBackend.get_compiled_circuits
methods to add atimeout
parameter, as withpytket-quantinuum
, making sure users can modify it for using optimisation level 3.Checklist