mahout
mahout copied to clipboard
[Bug] draw() API returns None instead of circuit visualization object
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
- Create a simple circuit with
QuMat(e.g., 1-qubit Hadamard). - Call
viz = qumat.draw(). - Check
vizin 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.