Closed ValentinS4t1qbit closed 1 month ago
Hey, I saw this issue on Unitary hacks , I think I can get it done, I will take this issue , Thanks for the how to win seems like a straight forward task if I have more questions will reach out
Thank you for looking into this! We will look forward updates, and provide additional info if needed.
Hopefully, with my PR, This issue has been completed. !! Kindly assign me the issue
Solved by @anushkrishnav in #391
Issue: Bug Report
We wanted to provide a default
draw
method on theCircuit
class in Tangelo for convenience, and decided thatcirq
's would do: when we calldraw()
we implicitly askcirq
to draw it for us (Thankscirq
❤️ )Tangelo circuits can take almost anything as a value for
gate.parameter
, including a string.cirq
is however not happy with that:Can you help us ensure
draw()
works for strings as parameters ?How to win
It turns out
cirq
is happy if we define asympy
symbol. Then we observe that bothdraw
andprint
in Tangelo work just fine:Which means one could ask
draw
to make a copy of the circuit on-the-fly (we don't want the method to modify the object itself) that replaces string values for parameters by equivalent sympy symbols.draw
function and and show us the difference in performance with the old one (which you can keep around and rename: we'll only push the new one into the PR).Validation
draw
andprint
give satisfying results on the circuit abovevalentin.senicourt@sandboxquantum.com
access to a Google Colab notebook whose first cell installs Tangelo from your branch and then runs those draw / print cells with a few clicks and if it looks good, we're good !