Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

master plot_circuit() #141

Open
Xuhongze opened this issue Mar 22, 2024 · 0 comments
Open

master plot_circuit() #141

Xuhongze opened this issue Mar 22, 2024 · 0 comments

Comments

@Xuhongze
Copy link

pq = QuantumCircuit(4)
theta = [Parameter("theta_%d" % (i), i + 1) for i in range(4)]
for i in range(4):
pq.rx(i, theta[i])
pq.rx(0, 55)
pq.ry(2, 4. * theta[0]+0.8)

pq.draw_circuit()
q[0] --RX(2.000)----RX(55.000)--

q[1] --RX(2.000)----------------

q[2] --RX(2.000)----RY(8.800)---

q[3] --RX(2.000)----------------

pq.plot_circuit()
Traceback (most recent call last):
File "/Users/xhz/miniforge3/envs/quafumaster/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 3577, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
pq.plot_circuit()
File "/Users/xhz/miniforge3/envs/quafumaster/lib/python3.10/site-packages/pyquafu-0.4.0-py3.10-macosx-14.0-arm64.egg/quafu/circuits/quantum_circuit.py", line 472, in plot_circuit
cmp = CircuitPlotManager(self)
File "/Users/xhz/miniforge3/envs/quafumaster/lib/python3.10/site-packages/pyquafu-0.4.0-py3.10-macosx-14.0-arm64.egg/quafu/visualisation/circuitPlot.py", line 144, in init
self._process_ins(gate)
File "/Users/xhz/miniforge3/envs/quafumaster/lib/python3.10/site-packages/pyquafu-0.4.0-py3.10-macosx-14.0-arm64.egg/quafu/visualisation/circuitPlot.py", line 235, in _process_ins
self._proc_su2(name, depth, ins.pos[0], paras)
File "/Users/xhz/miniforge3/envs/quafumaster/lib/python3.10/site-packages/pyquafu-0.4.0-py3.10-macosx-14.0-arm64.egg/quafu/visualisation/circuitPlot.py", line 419, in _proc_su2
para_txt = f"({paras[0]:.3f})" if paras else None
TypeError: unsupported format string passed to Parameter.format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant