Partition when "splitting" (partition = True) requires an input of dtype: QAny, thus not working when giving it a classical register (such as CUInt).
When "merging" (partition = False), it outputs a QAny(bitsize) even when given CBit (which should at least raise an error).
It is still possible to use Partition in these cases using Cast, but it messes up qubit count and feels like an unnecessary work around.
Possible solutions would be to add a classical_bits: bool = False argument to Partition which would use a dtype: CAny instead of QAny.
Another possibility is a new Partition method for Classical bits.
Partitionwhen "splitting" (partition = True) requires an input ofdtype: QAny, thus not working when giving it a classical register (such asCUInt).When "merging" (
partition = False), it outputs aQAny(bitsize)even when givenCBit(which should at least raise an error).It is still possible to use
Partitionin these cases usingCast, but it messes up qubit count and feels like an unnecessary work around.Possible solutions would be to add a
classical_bits: bool = Falseargument toPartitionwhich would use adtype: CAnyinstead ofQAny.Another possibility is a new
Partitionmethod for Classical bits.