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

The parser is not importing #229

Closed PariaNaghavi closed 1 year ago

PariaNaghavi commented 1 year ago

Thank you for the new updates to pyqir! I can't wait to unbox the new features. Currently, I am facing an issue with importing the parser. When attempting to use the example the line from pyqir.parser import * raised an error not finding pyqir.parser . I have tried pip installing pyqir on MacOS and Linux systems, but the issue persists on both. It is worth noting that there doesn't seem to be any problem with importing the generator module. To replicate: With pyqir (0.7.0) is installed, try from pyqir.parser import * or please see here Current outcome: ModuleNotFoundError: No module named 'pyqir.parser' ImportError: cannot import name 'parser' from 'pyqir' (/opt/conda/envs/qir-book/lib/python3.9/site-packages/pyqir/init.py) AttributeError: module 'pyqir' has no attribute 'parser' Expected outcome: pyqir.parser imported with from pyqir.parser import * Notes: I would appreciate any suggestions or insights that might help in addressing this issue. Please let me know if there is any additional information or assistance that I can provide to fix this issue. Environment: • OS: MacOS and Linux • PyQIR version: 0.7.0 • Python version: 3.9 Screen Shot 2023-01-17 at 19 40 38

idavis commented 1 year ago

Thank you, @PariaNaghavi , for the detailed information. The 0.7 release features the unification of pyqir-generator and pyqir-parser (there is no longer a parser submodule). We made significant changes to the API including many breaking changes. For more information, please read the upgrade guide.

The current version of the parser tests you are attempting to run shows how the revised API is used.