mahout icon indicating copy to clipboard operation
mahout copied to clipboard

[Bug] draw() API returns None instead of circuit visualization object

Open shiavm006 opened this issue 1 month ago • 2 comments

QuMat.draw() says it returns a circuit visualization, but all backends just print the circuit and return None. So viz = qumat.draw() always gives you None.

Steps to Reproduce

  1. Create a simple circuit with QuMat (e.g., 1-qubit Hadamard).
  2. Call viz = qumat.draw().
  3. Check viz in Python.

Expected Behavior

draw() should either return something you can use (string/object) or clearly say it only prints and returns nothing.

Actual Behavior

The circuit is printed to stdout, and viz is always None.

viz = qumat.draw() circuit is printed here print(viz) None### Environment

  • OS: Any
  • Python Version: 3.10+
  • Mahout/Qumat Version: main
  • Backends: Qiskit, Cirq, Amazon Braket

Additional Context

Right now the docstring and the actual behavior don’t match, which is confusing if you try to use the return value.

shiavm006 avatar Dec 04 '25 11:12 shiavm006