Skip to content

Commit

Permalink
Add back data type
Browse files Browse the repository at this point in the history
  • Loading branch information
sjdilkes committed Sep 5, 2023
1 parent 312b7f1 commit c3bfbdd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
4 changes: 0 additions & 4 deletions tket/include/tket/Ops/MetaOp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ 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
7 changes: 6 additions & 1 deletion tket/src/Ops/BarrierOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ nlohmann::json BarrierOp::serialize() const {

Op_ptr BarrierOp::deserialize(const nlohmann::json& j) {
op_signature_t sig = j.at("signature").get<op_signature_t>();
std::string data = j.at("data").get<std::string>();
std::string data;
try {
data = j.at("data").get<std::string>();
} catch (const nlohmann::json::out_of_range& e) {
data = "";
}
return std::make_shared<BarrierOp>(sig, data);
}

Expand Down
5 changes: 0 additions & 5 deletions tket/src/Ops/MetaOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,4 @@ 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 c3bfbdd

Please sign in to comment.