--
RuntimeError Traceback (most recent call last)
Cell In[16], line 1
----> 1 circ.X(0, condition_bits=[a[0]], condition_value=1)
RuntimeError: Unable to cast Python instance of type <class 'list'> to C++ type 'std::__1::vector<unsigned int, std::__1::allocator<unsigned int>>'
Its not at all obvoius from this error what has gone wrong here. This error message should make the fix clearer.
In fact, arguably this shouldn't give an error in pytket as in the current interface we support referencing qubits with Qubits and integers. However not sure how practical overload merging would be.
The following method works fine for adding a condtional-X gate to a
Circuit
.Notice how I am passing the
Qubit
q[0]
into theCircuit.add_gate
method.However if I replace
q[0]
with0
....I get the following
RuntimeError
Its not at all obvoius from this error what has gone wrong here. This error message should make the fix clearer.
In fact, arguably this shouldn't give an error in pytket as in the current interface we support referencing qubits with
Qubit
s and integers. However not sure how practical overload merging would be.