quantumlib / Qualtran

Qᴜᴀʟᴛʀᴀɴ is a Python library for expressing and analyzing Fault Tolerant Quantum algorithms.
https://qualtran.readthedocs.io/en/latest/
Apache License 2.0
173 stars 40 forks source link

Sharp edges / tutorial feedback #1064

Open fdmalone opened 3 months ago

fdmalone commented 3 months ago

[capturing some observations from tutorial session before I forget]

  1. show_call_graph expects the graph not a bloq, users must call bloq.call_graph which returns the graph and the "sigma" (we often ignore one or the other of these in the code too). Several people were caught out and expected to be able to do show_call_graph(bloq), which returns an unintuitive error related to a missing "is_directed" attribute (xref #1063). We should add a method (or change show_call_graph) to just accept a bloq. Or add to the show_bloq helper method.
  2. Some people were returning bloq classes rather than instances (TGate rather than TGate()) in build_call_graph (which I guess a linter / typechecker would catch) but it resulted in a very odd error message which we should probably try to catch.
  3. A simpler way to wire up bloqs. It would be nice to be able to compose higher level bloqs in a more automatic way (this is very vague) but somewhat related to autopartition I think..
mpharrigan commented 3 months ago

Thanks for writing this up!

Confusion about register ordering / needing to use keyword arguments when bb.add but things returned in register order

mpharrigan commented 1 month ago

(1) is fixed by #1254