From a50cd2cd24a04095532d8b059731bc9631dd77f8 Mon Sep 17 00:00:00 2001 From: Daniel Strano Date: Thu, 23 Feb 2023 09:12:09 -0500 Subject: [PATCH] Check prob_perm() parameter lengths match --- src/qrack_simulator.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qrack_simulator.rs b/src/qrack_simulator.rs index 53a9d57..bb5c169 100644 --- a/src/qrack_simulator.rs +++ b/src/qrack_simulator.rs @@ -2165,6 +2165,9 @@ impl QrackSimulator { // probability that each qubit in "q[i]" has corresponding truth // value in "c[i]", at once + if q.len() != c.len() { + return Err(QrackError{}); + } let mut _q = q.to_vec(); let mut _c = c.to_vec(); let result:f64;