NVIDIA / NVIDIA/cudaqx

More descriptive error handling for API calls

Open
#59 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
117
Forks
74
Avg merge
2d 7h
Merged PRs (30d)
25

Description

There should be better error responses when using cudaq_solvers.create_molecule and any other code that uses API calls to execute code. When executing the following, the user just gets a blanket error that isn't specific about what went wrong on the pyscf call

from cudaq_solvers import create_molecule

xyz = [('H', (0., 0., 0.)), ('H', (1.0, 0., 0.))]
molecule = create_molecule(xyz, 'sto-3sg', 0, 0)
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[34], [line 4](vscode-notebook-cell:?execution_count=34&line=4)
      [1](vscode-notebook-cell:?execution_count=34&line=1) from cudaq_solvers import create_molecule
      [3](vscode-notebook-cell:?execution_count=34&line=3) xyz = [('H', (0., 0., 0.)), ('H', (1.0, 0., 0.))]
----> [4](vscode-notebook-cell:?execution_count=34&line=4) molecule = create_molecule(xyz, 'sto-3sg', 0, 0)

RuntimeError: HTTP POST Error - status code 500: : Internal Server Error

when the problem is just that an invalid basis set ('sto-3sg' rather than 'sto-3g') was passed. Similarly, if the xyz is changed such that it is syntactically correct but not what pyscf expects then the error will be the same blanket internal server error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the cudaq_solvers.create_molecule entry point and trace the API calls used to execute code. Reproduce the invalid basis-set and malformed-xyz examples, then make the resulting errors identify the underlying PySCF problem rather than only reporting HTTP 500; the issue names no files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.