You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "shiavm006 (via GitHub)" <gi...@apache.org> on 2025/11/24 10:28:03 UTC

[I] [Docs] API reference uses incorrect method name draw_circuit() instead of draw() [mahout]

shiavm006 opened a new issue, #640:
URL: https://github.com/apache/mahout/issues/640

   ### Description
   The API documentation in `docs/api.md` documents a method named `draw_circuit(self)` that does not exist in the codebase. The actual method name is `draw(self)`. This causes users following the documentation to encounter `AttributeError` when trying to visualize quantum circuits.
   
   ### Steps to Reproduce
   1. Open the API documentation at `docs/api.md` lines 71-75
   2. Follow the documented method to visualize a circuit:
      from qumat import QuMat
      
      backend_config = {
          'backend_name': 'qiskit',
          'backend_options': {'simulator_type': 'aer_simulator', 'shots': 1024}
      }
      qumat = QuMat(backend_config)
      qumat.create_empty_circuit(1)
      qumat.apply_hadamard_gate(0)
      qumat.draw_circuit()  # Following the documentation
      3. Observe the error: `AttributeError: 'QuMat' object has no attribute 'draw_circuit'`
   
   ### Expected Behavior
   The documentation should reference the correct method name `draw(self)` that exists in the codebase at `qumat/qumat.py` line 337.
   
   ### Actual Behavior
   **Current documentation** (`docs/api.md` lines 71-75):
   
   **Proposed fix**: Update `docs/api.md` to document `draw(self)` instead of `draw_circuit(self)`.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mahout.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs] API reference uses incorrect method name draw_circuit() instead of draw() [mahout]

Posted by "rawkintrevo (via GitHub)" <gi...@apache.org>.
rawkintrevo commented on issue #640:
URL: https://github.com/apache/mahout/issues/640#issuecomment-3570753941

   That's probably my bad. Good catch @shiavm006 , only question is should we update the docs to match the code or the code to match the docs? (i.e. should we change the method to `.draw_circuit(` or change the docs to `.draw(` as proposed? @guan404ming )


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs] API reference uses incorrect method name draw_circuit() instead of draw() [mahout]

Posted by "shiavm006 (via GitHub)" <gi...@apache.org>.
shiavm006 commented on issue #640:
URL: https://github.com/apache/mahout/issues/640#issuecomment-3570786024

   I'd say rename the method to `draw_circuit()` to match the docs. Keeping it consistent with the rest of QuMat's naming style makes sense everything else uses descriptive names like `create_empty_circuit()`, `apply_hadamard_gate()`, `execute_circuit()`. Plus the backend implementations already use `draw_circuit()` internally, so it'd align better.
   
   Thoughts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs] API reference uses incorrect method name draw_circuit() instead of draw() [mahout]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 closed issue #640: [Docs] API reference uses incorrect method name draw_circuit() instead of draw()
URL: https://github.com/apache/mahout/issues/640


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs] API reference uses incorrect method name draw_circuit() instead of draw() [mahout]

Posted by "rawkintrevo (via GitHub)" <gi...@apache.org>.
rawkintrevo commented on issue #640:
URL: https://github.com/apache/mahout/issues/640#issuecomment-3571047389

   Sounds good to me. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Docs] API reference uses incorrect method name draw_circuit() instead of draw() [mahout]

Posted by "shiavm006 (via GitHub)" <gi...@apache.org>.
shiavm006 commented on issue #640:
URL: https://github.com/apache/mahout/issues/640#issuecomment-3570004013

   cc @guan404ming @rawkintrevo 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org