shiavm006 opened a new issue, #800:
URL: https://github.com/apache/mahout/issues/800

   ### Description
   When `backend_config` is missing required keys (`backend_name` or 
`backend_options`), the code raises a generic `KeyError` that doesn't clearly 
indicate what's missing or what's required. This makes debugging difficult for 
users who accidentally omit required configuration keys.
   
   The docstring in `QuMat.__init__()` claims it raises `KeyError` for missing 
keys, but the error message is not helpful. Additionally, there's inconsistency 
in how backends handle missing keys - some use `.get()` with defaults (Cirq), 
while others use direct dictionary access (Qiskit, Amazon Braket).
   
   ### Steps to Reproduce
   1. Create a `backend_config` dictionary missing the `backend_name` key:hon
   from qumat import QuMat
   
   config = {"backend_options": {"simulator_type": "aer_simulator", "shots": 
1024}}
   qumat = QuMat(config)2. Or create a config missing `backend_options`:
   config = {"backend_name": "qiskit"}
   qumat = QuMat(config)### Expected Behavior
   Should raise a clear `ValueError` with a helpful message like:
   ### Expected Behavior
   Should raise a clear ValueError with a helpful message
   
   ### Actual Behavior
   Raises a generic `KeyError`:
   
   ### Environment
   - **OS:** e.g., Windows, Linux
   - **Browser/Tool Version:** e.g., Chrome 96, Python 3.8
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to