From 2f1d1a1049ea6fbac4a22a671adc7b8e0007cba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Agust=C3=ADn=20Borgna?= <121866228+aborgna-q@users.noreply.github.com> Date: Thu, 2 May 2024 16:04:27 +0100 Subject: [PATCH] fix: Don't convert tket2 measurements into tket1 ops (#331) Throws an error instead of converting the operation into one with different signature. Fixes #330 --- tket2/src/json/op.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tket2/src/json/op.rs b/tket2/src/json/op.rs index 407eaf5a..2ba84f69 100644 --- a/tket2/src/json/op.rs +++ b/tket2/src/json/op.rs @@ -233,7 +233,11 @@ impl TryFrom<&OpType> for JsonOp { Tk2Op::Tdg => JsonOpType::Tdg, Tk2Op::Sdg => JsonOpType::Sdg, Tk2Op::ZZMax => JsonOpType::ZZMax, - Tk2Op::Measure => JsonOpType::Measure, + Tk2Op::Measure => { + unimplemented!( + "Cannot convert TKET2 Measure to TKET1 due to mismatching semantics." + ) + } Tk2Op::RzF64 => JsonOpType::Rz, Tk2Op::RxF64 => JsonOpType::Rx, // TODO: Use a TK2 opaque op once we update the tket-json-rs dependency.