[Bug] Unknown backend_name leaks ModuleNotFoundError instead of a clear ValueError

Open Beginner friendly
#1,506 5 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@Asterisk-Hunter is already working on this.

Since Oct 28, 2026.

  • #1514 by @mangeshraut712 — closed without merging
  • #1520 by @krishna-dave206 — open
  • #1567 by @Asterisk-Hunter — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Start in QuMat.__init__ in qumat/qumat.py, where the backend module path is built from backend_name and passed to importlib.import_module. Reproduce with an unsupported name such as "pennylane" to see the leaked ModuleNotFoundError. Done when an unknown name raises a ValueError naming it and listing qiskit, cirq and amazon_braket, with a new test in testing/qumat/ covering that path. Two earlier linked PRs were closed without merging, so check why before starting.

Written by the indexing model from the issue text.

Description

bug enhancement good-first-issue qumat
What

QuMat.__init__ builds the backend module path from backend_name and imports it with importlib.import_module. When the name is not one of the supported backends, the ModuleNotFoundError from the import leaks out instead of a clear error:

from qumat import QuMat

QuMat({"backend_name": "pennylane", "backend_options": {}})
# ModuleNotFoundError: No module named 'qumat.pennylane_backend'

Actual result: ModuleNotFoundError pointing at an internal module name.

Expected result: a ValueError that names the unsupported backend and lists the supported ones (qiskit, cirq, amazon_braket), for example:

ValueError: Unsupported backend_name 'pennylane'. Supported backends: amazon_braket, cirq, qiskit

Where: qumat/qumat.py (QuMat.__init__). Add a test in testing/qumat/ for the error path.

Environment
  • OS: macOS 14 / Linux
  • Python version: 3.12
  • Qumat version: 0.6.0 (PyPI) and main at 2d94f8fbd

Part of the Apache Mahout hackathon at Community over Code Glasgow 2026 (Track A, Qumat). Comment here to claim it.

Dominant language
Rust
Stars
2.3k
Forks
1k
Avg merge
2d 20h
Merged PRs (30d)
7

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

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.

More from apache/mahout

All issues in apache/mahout

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.