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
Currently, QC and QCO do not have native support for classical registers. Their builders do have methods to allocate classical registers, but these only return collections of Bit structures that store some metadata. We should adapt these methods to allocate an MLIR object that can store and retrieve measurement results.
Open questions
Should classical registers be represented as tensor or memref types? For reference, jeff uses tensor types. How are classical registers represented in openqasm/qe-compiler?
Should the same representation be used in QC and QCO? Using the same representation would significantly simplify internal conversions.
Acceptance criteria
QCProgramBuilder::allocClassicalBitRegister() and QCOProgramBuilder::allocClassicalBitRegister() create some sort of MLIR object. It likely makes sense to mimic the behavior of the allocQubitRegister() methods and return a custom structure containing the loaded entries.
The register_name, register_size, and register_index attributes are removed from qc::MeasureOp and qco::MeasureOp.
The conversion of qc::MeasureOps to QIR is improved. The original register information is retained during conversion to the Adaptive Profile. During conversion to the Base Profile, all bits are converted to statically allocated ones. Implement the output recording as suggested in ✨ Add QC to QIR Adaptive Profile Conversion #1710 (comment).
Description
Currently, QC and QCO do not have native support for classical registers. Their builders do have methods to allocate classical registers, but these only return collections of
Bitstructures that store some metadata. We should adapt these methods to allocate an MLIR object that can store and retrieve measurement results.Open questions
tensorormemreftypes? For reference,jeffusestensortypes. How are classical registers represented in openqasm/qe-compiler?Acceptance criteria
QCProgramBuilder::allocClassicalBitRegister()andQCOProgramBuilder::allocClassicalBitRegister()create some sort of MLIR object. It likely makes sense to mimic the behavior of theallocQubitRegister()methods and return a custom structure containing the loaded entries.register_name,register_size, andregister_indexattributes are removed fromqc::MeasureOpandqco::MeasureOp.qc::MeasureOps to QIR is improved. The original register information is retained during conversion to the Adaptive Profile. During conversion to the Base Profile, all bits are converted to statically allocated ones. Implement the output recording as suggested in ✨ Add QC to QIR Adaptive Profile Conversion #1710 (comment).translateQuantumComputationToQC()can translate measurements insideqc::IfElseOperations (see ✨ Translateqc::IfElseOperationto QC #1717 (review) for context).