-
Notifications
You must be signed in to change notification settings - Fork 13
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 CliffordCircuitPredicate if we're using the stabilizer simulator #560
base: main
Are you sure you want to change the base?
Add CliffordCircuitPredicate if we're using the stabilizer simulator #560
Conversation
06e4876
to
8114290
Compare
@@ -615,6 +616,8 @@ def required_predicates(self) -> list[Predicate]: | |||
assert self.backend_info is not None | |||
preds.append(MaxNQubitsPredicate(self.backend_info.n_nodes)) | |||
preds.append(MaxNClRegPredicate(cast(int, self.backend_info.n_cl_reg))) | |||
if self.simulator_type == "stabilizer": |
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.
Can we add a test or two showing that this is working?
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.
Will do - I think this makes sense to just be a unit test. Any objections to me adding a new unit test file, given that this doesn't really fit with any of the existing unit test filenames?
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.
There's a related test here which could be extended. (In fact, don't we expect that test to now throw an error from process_circuit()
?)
It's possible to request the stabilizer simulator for non-Clifford circuits at the moment, which doesn't make sense. This commit adds a predicate to make sure that if we request the (non-default) stabilizer simulator, the circuit we submit or compile has to be a Clifford circuit.
333fa91
to
e7d1410
Compare
Added a new unit test that checks we include the CliffordCircuitPredicate only when we're running with a stabilizer simulator type (and not when we have a statevector simulator). Also update test_simulator to expect to fail on compilation, rather than breaking on get_result().
e7d1410
to
1c671f3
Compare
Integration test is currently failing because |
Description
QuantinuumBackend currently doesn't check if a circuit compiled for or run on the stabilizer simulator is a Clifford circuit. This PR fixes that by adding a predicate check in that case.
Checklist