This is an automated email from the ASF dual-hosted git repository.

guanmingchiu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git


The following commit(s) were added to refs/heads/main by this push:
     new 8a84224a4 MAHOUT-603: validate parameters in bind_parameters to 
prevent silent failures (#606)
8a84224a4 is described below

commit 8a84224a4c16c3bac0186ef9883e525f416378be
Author: Shivam Mittal <[email protected]>
AuthorDate: Sat Nov 8 09:20:16 2025 +0530

    MAHOUT-603: validate parameters in bind_parameters to prevent silent 
failures (#606)
---
 qumat/qumat.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/qumat/qumat.py b/qumat/qumat.py
index c63ec6e77..32c7c3fd6 100644
--- a/qumat/qumat.py
+++ b/qumat/qumat.py
@@ -105,8 +105,12 @@ class QuMat:
 
     def bind_parameters(self, parameter_values):
         for param, value in parameter_values.items():
-            if param in self.parameters:
-                self.parameters[param] = value
+            if param not in self.parameters:
+                raise ValueError(
+                    f"parameter '{param}' not found in circuit. "
+                    f"available parameters: {list(self.parameters.keys())}"
+                )
+            self.parameters[param] = value
 
     # placeholder method for use in the testing suite
     def get_final_state_vector(self):

Reply via email to