QuantestPy / quantestpy

Apache License 2.0
9 stars 3 forks source link

Fix a bug in draw_wire method #202

Closed junnaka51 closed 1 year ago

junnaka51 commented 1 year ago

fix https://github.com/QuantestPy/quantestpy/issues/201

This PR fixes the draw_wire method in QuantestPyCircuitDrawer in such a way that there are no wires between multi-target.

Before


In [1]: from quantestpy import QuantestPyCircuit

In [2]: qc = QuantestPyCircuit(2)
   ...: qc.add_gate({
   ...:     "name": "x",
   ...:     "target_qubit": [0, 1],
   ...:     "control_qubit": [],
   ...:     "control_value": [],
   ...:     "parameter": []
   ...: })

In [3]: qc.draw()
Out[3]: 
0 ─[X]─ 0
    │    
1 ─[X]─ 1

In [4]: 

After

In [3]: qc = QuantestPyCircuit(2)
   ...: qc.add_gate({
   ...:     "name": "x",
   ...:     "target_qubit": [0, 1],
   ...:     "control_qubit": [],
   ...:     "control_value": [],
   ...:     "parameter": []
   ...: })

In [4]: qc.draw()
Out[4]: 
0 ─[X]─ 0

1 ─[X]─ 1

In [5]: