Skip to content

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

@shiavm006

Description

@shiavm006

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.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions