[Bug] Cirq backend ignores the initialized simulator and creates its own cirq.Simulator()

Open Beginner friendly
#1,508 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 2 days

@Howardisme is already working on this.

Since Oct 17, 2026.

  • #1516 by @mangeshraut712 — closed without merging
  • #1535 by @Howardisme — open

Assessment

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

Research direction

Start in qumat/cirq_backend.py: compare initialize_backend() with execute_circuit() and get_final_state_vector(), which currently build their own cirq.Simulator() near lines 139 and 211. Check how the Qiskit and Braket backends pass the backend object through. Done means both methods use the simulator returned at initialization, and a new test passes a seeded or mocked simulator and asserts it is the one called.

Written by the indexing model from the issue text.

Description

bug enhancement good-first-issue qumat
What

cirq_backend.initialize_backend() creates and returns a simulator, but execute_circuit() and get_final_state_vector() ignore the backend argument they receive and construct a fresh cirq.Simulator() each time (qumat/cirq_backend.py, around lines 139 and 211).

Actual result: the simulator object chosen at initialization is never the one that runs the circuit. Any simulator configuration (seed, dtype, a different simulator class) is silently lost, and future support for other Cirq simulators (for example DensityMatrixSimulator) cannot work.

Expected result: the backend object returned by initialize_backend() is the one used in execute_circuit() and get_final_state_vector(), matching how the Qiskit and Braket backends behave.

Where: qumat/cirq_backend.py. Add a test that passes a simulator with a fixed seed (or a mock) and asserts it is the one used.

Density-matrix simulation on Cirq (simulator_type="density_matrix") is a natural follow-up once this is fixed.

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.