Skip to content

Commit

Permalink
add check for appending two wasm files with differen uid
Browse files Browse the repository at this point in the history
  • Loading branch information
cqc-melf committed Nov 22, 2024
1 parent d9e6dac commit a27a7d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tket/src/Circuit/macro_manipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@ void Circuit::append_with_map(const Circuit& c2, const unit_map_t& qm) {
Circuit copy = c2;
copy.rename_units(qm);

if ((_number_of_wasm_wires > 0) && (copy._number_of_wasm_wires > 0)) {
if (copy.get_wasm_file_uid() != get_wasm_file_uid()) {
throw Unsupported(
"Cannot append circuits with different wasm uids: " +
get_wasm_file_uid() + " and " + copy.get_wasm_file_uid());
}
}

copy.add_wasm_register(_number_of_wasm_wires);
add_wasm_register(copy._number_of_wasm_wires);

Expand Down

0 comments on commit a27a7d8

Please sign in to comment.