Since #1580, the linear-type-tracking helpers in QCOProgramBuilder have become more complex because register information must also be tracked.
As proposed in #1580 (comment), this could be simplified again by returning Qubit structures from QCOProgramBuilder::allocQubit(). The DenseMap<Value, QubitInfo> could then be replaced by a DenseSet<Qubit>.
Similarly, the DenseMap<Value, TensorInfo> could be replaced by a DenseSet<Tensor>. It is likely not wise to track the QubitRegister structure introduced in #1627 because it also contains a SmallVector of (outdated) qubits.
Since #1580, the linear-type-tracking helpers in
QCOProgramBuilderhave become more complex because register information must also be tracked.As proposed in #1580 (comment), this could be simplified again by returning
Qubitstructures fromQCOProgramBuilder::allocQubit(). TheDenseMap<Value, QubitInfo>could then be replaced by aDenseSet<Qubit>.Similarly, the
DenseMap<Value, TensorInfo>could be replaced by aDenseSet<Tensor>. It is likely not wise to track theQubitRegisterstructure introduced in #1627 because it also contains aSmallVectorof (outdated) qubits.