You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the pytket.Circuit has any classical register, when calling TensorNetwork on it, we get the following error:
Traceback (most recent call last):
File "/home/aborgna/src/check-circ-eq/check_eq.py", line 112, in <module>
run(MAX_QUBITS, results)
File "/home/aborgna/src/check-circ-eq/check_eq.py", line 75, in run
is_eq = test_equivalence(new_circ, old_circ)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aborgna/src/check-circ-eq/check_eq.py", line 30, in test_equivalence
ket_net = TensorNetwork(ket_circ)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/aborgna/src/check-circ-eq/venv/lib/python3.11/site-packages/pytket/extensions/cutensornet/tensor_network_convert.py", line 87, in __init__
self._output_index_to_qubit = {
^
File "/home/aborgna/src/check-circ-eq/venv/lib/python3.11/site-packages/pytket/extensions/cutensornet/tensor_network_convert.py", line 88, in <dictcomp>
oi: qname_to_q[qname] for oi, qname in self._graph.output_names.items()
~~~~~~~~~~^^^^^^^
KeyError: 'c[0]'
This error occurs even if there are no operations acting on the classical registers. The issue seems to be that self._graph.output_names includes all wires, not only quantum ones.
This issue was found by Agustin Borgna.
The text was updated successfully, but these errors were encountered:
My suggestion is that we check for classical registers at the beginning of the conversion and, if we find any, raise a UserError with a message saying something like "Classical registers are not supported. Please remove all classical registers from your circuit."
If the
pytket.Circuit
has any classical register, when callingTensorNetwork
on it, we get the following error:This error occurs even if there are no operations acting on the classical registers. The issue seems to be that
self._graph.output_names
includes all wires, not only quantum ones.This issue was found by Agustin Borgna.
The text was updated successfully, but these errors were encountered: