-
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
Refactor greedy pauli simp #1611
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 9e9a2fd.
…)`` doesn't work with wasm
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.
Code looks good, just a question on functionality!
tket/test/src/test_GreedyPauli.cpp
Outdated
@@ -74,9 +44,9 @@ SCENARIO("Clifford synthesis") { | |||
} | |||
GIVEN("2Q Simple Clifford") { | |||
Circuit circ(2); | |||
circ.add_op<unsigned>(OpType::Y, {0}); | |||
// circ.add_op<unsigned>(OpType::Y, {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.
Can we add these back in to the tests?
/** | ||
* @brief Conditional Pauli rotation | ||
*/ | ||
class ConditionalPauliRotation : public PauliRotation { |
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.
Do we only have ConditionalPauliRotation
and not ConditionalClifford
? My concern is that if a user provides a conditional Clifford operation, and not a conditional rotation, then each conditional Clifford adds new branching as a series of ConditionalPauliRotation
? Is this how they would be handled currently?
SpPauliStabiliser qpt = cliff_.get_row_product(SpPauliStabiliser(qpm)); | ||
auto [pauli_dense, theta] = dense_pauli(qpt, n_qubits_, angle); | ||
PauliNode_ptr node; | ||
if (conditional) { |
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 Ok. So on conditional = true
, regardless of whether it's a Clifford angle or not, we add it to the circuit as a Pauli Exponential (or potentially one with a Clifford angle), and they get resolved at synthesis. So if it happens to have a Clifford angle, it doesn't matter, we can still use the pre-existing logic, it just turns out eventually it will get synthesised with only Cliffords coincidentially.
That's a really nice solution!
/** | ||
* @brief Black box node for classical Ops | ||
*/ | ||
class ClassicalNode : public PauliNode { |
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.
Would this cover all the ops for pytket-quantinuum
? i.e.:
_ADDITIONAL_GATES = {
OpType.Reset,
OpType.Measure,
OpType.Barrier,
OpType.RangePredicate,
OpType.MultiBit,
OpType.ExplicitPredicate,
OpType.ExplicitModifier,
OpType.SetBits,
OpType.CopyBits,
OpType.ClassicalExpBox,
OpType.WASM,
}
|
||
unsigned ACPairNode::tqe_cost() const { | ||
return static_cast<unsigned>( | ||
1.5 * (n_anti_commute_entries_ - 1) + n_commute_entries_); |
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.
Please could you add a comment explaining the rationale behind this cost
Description
Supports mid-circuit measurements, resets, conditionals and classical gates.
A modified version of the existing Pauli graph is needed for this feature.
Related issues
Please mention any github issues addressed by this PR.
Checklist