Skip to content

Impractical to use Partition with CDType (always needs a QAny) #1799

@Axel-pappalardo

Description

@Axel-pappalardo

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions