diff --git a/python/cudaq_bridge.py b/python/cudaq_bridge.py index f4aa676..7197958 100644 --- a/python/cudaq_bridge.py +++ b/python/cudaq_bridge.py @@ -449,6 +449,7 @@ def get_available_targets_standalone() -> Dict: def dispatch_command(command: str, **kwargs) -> Dict: """Main dispatch function for Python bridge commands""" + print(f"DEBUG - Command: {command}, Args: {list(kwargs.keys())}", flush=True) try: if command == "create_kernel": return kernel_manager.create_kernel( @@ -468,8 +469,14 @@ def dispatch_command(command: str, **kwargs) -> Dict: ) elif command == "set_target": + print(f"DEBUG - set_target called with kwargs: {kwargs}", flush=True) + target_name = kwargs.get("target") + if target_name is None: + print(f"ERROR - Missing 'target' parameter. Available params: {list(kwargs.keys())}", flush=True) + return {"error": "Missing required parameter 'target'", "available_params": list(kwargs.keys())} + print(f"DEBUG - Setting target to: {target_name}", flush=True) return executor.set_target( - kwargs["target"], # This will be passed as target_name + target_name, **kwargs.get("configuration", {}) )