qir-alliance / pyqir

PyQIR is a set of APIs for generating, parsing, and evaluating Quantum Intermediate Representation (QIR).
https://qir-alliance.github.io/pyqir
MIT License
54 stars 24 forks source link

Documentation and/or examples using known estimates in PyQIR #268

Closed skushnir123 closed 3 months ago

skushnir123 commented 4 months ago

Is your feature request related to a problem? Please describe. Q* allows quantum programs to specify known estimates used in the Microsoft Resource Estimator. Given that QIR is a valid input to the Microsoft Resource Estimator, I would expect there to be similar functionality provided in QIR through PyQIR.

If this already exists, I think it would be helpful to have more documentation/examples surrounding this. If it doesn't, then I think this would be a vital addition to PyQIR.

idavis commented 4 months ago

Hi @skushnir123, PyQIR is primarily designed for hardware targeted QIR. It can parse arbitrary QIR produced with LLVM14 and older, but generation is limited as it focuses on profile compliant code generation rather than unrestricted LLVM IR/BC.

For resource estimation I'd recommend calculating your code's logical count and leveraging the qsharp Python package's resource estimation (announcement, space-time tradeoffs) APIs.