[Bug] Reusing a parameter name on two gates fails on Qiskit only (name conflict adding parameter)

Open Beginner friendly
#1,509 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@Imad2702 is already working on this.

Since Oct 16, 2026.

  • #1532 by @Imad2702 — open

Assessment

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

Research direction

Start in qumat/qiskit_backend.py around lines 201 to 219, where the rotation-gate methods create a new qiskit.circuit.Parameter on every call, and compare it with how the Cirq and Braket backends handle the same parameter name. Reproduce with two apply_rx_gate calls using the same name and the Qiskit backend. Done when that sequence runs on all three backends and a cross-backend test binds one value and checks the counts or state vector.

Written by the indexing model from the issue text.

Description

bug enhancement good-first-issue qumat
What

Using the same parameter name on two gates works on Cirq and Braket but fails on Qiskit:

from qumat import QuMat

qc = QuMat({"backend_name": "qiskit", "backend_options": {"simulator_type": "aer_simulator", "shots": 100}})
qc.create_empty_circuit(2)
qc.apply_rx_gate(0, "t")
qc.apply_rx_gate(1, "t")
# qiskit:        CircuitError: "name conflict adding parameter 't'"
# cirq:          ok  [Counter({3: 100})]
# amazon_braket: ok  Counter({'11': 100})

Actual result: qiskit.circuit.exceptions.CircuitError: name conflict adding parameter 't'. The Qiskit backend creates a new qiskit.circuit.Parameter(name) on every gate call (qumat/qiskit_backend.py, around lines 201 to 219), and Qiskit treats two Parameter objects with the same name as a conflict.

Expected result: a parameter name refers to one symbolic parameter wherever it is used, on all three backends. Sharing an angle across gates is the normal case in variational circuits (for example a layer of Rx(theta) on every qubit).

How: cache one Parameter per name in the Qiskit backend (for example a dict on the backend state) and reuse it. Add a cross-backend test that applies the same parameter name to two gates, binds a value, and checks the counts or state vector on all three backends.

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.