CQCL / tket

Source code for the TKET quantum compiler, Python bindings and utilities
https://docs.quantinuum.com/tket/
Apache License 2.0
257 stars 48 forks source link

`GuidedPauliSimp` errors out when circuit contains CircuitBox and classical bits. #1578

Closed yao-cqc closed 1 month ago

yao-cqc commented 2 months ago
inner_circ_nobit = Circuit(2).H(0).H(1)
full_circ_nobit = Circuit(2)
full_circ_nobit.add_circbox(CircBox(inner_circ_nobit),inner_circ_nobit.qubits)
Out[59]: [CircBox q[0], q[1]; ]
GuidedPauliSimp().apply(full_circ_nobit)
Out[60]: True

inner_circ_withbit = Circuit(2,1).H(0).H(1)
full_circ_withbit = Circuit(2,1)
full_circ_withbit.add_circbox(CircBox(inner_circ_withbit), inner_circ_withbit.qubits + inner_circ_withbit.bits)
Out[63]: [CircBox q[0], q[1], c[0]; ]
GuidedPauliSimp().apply(full_circ_withbit)
Traceback (most recent call last):
  File "/home/andrew/.local/lib/python3.12/site-packages/IPython/core/interactiveshell.py", line 3577, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-64-fa2ebbbbd18c>", line 1, in <module>
    GuidedPauliSimp().apply(full_circ_withbit)
RuntimeError: Subcircuit boundary mismatch to hole