Skip to content

Commit

Permalink
add MetaOp::is_equal
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdilkes committed Sep 5, 2023
1 parent 2cbebb8 commit 312b7f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tket/include/tket/Ops/MetaOp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class MetaOp : public Op {
bool is_clifford() const override;

~MetaOp() override;
/**
* Equality check between two MetaOp instances
*/
bool is_equal(const Op &other) const override;

private:
op_signature_t
Expand Down
5 changes: 5 additions & 0 deletions tket/src/Ops/MetaOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ bool MetaOp::is_clifford() const { return true; }

MetaOp::~MetaOp() {}

bool MetaOp::is_equal(const Op& op_other) const {
const MetaOp& other = dynamic_cast<const MetaOp&>(op_other);
return (get_signature() == other.get_signature());
}

} // namespace tket

0 comments on commit 312b7f1

Please sign in to comment.