-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
38 fix types in the ast #47
Conversation
d65f685
to
cc98f3d
Compare
9d33eaf
to
aadb230
Compare
5c281bd
to
c4e59db
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been through the code, but mostly to check if there are no weird things or things going wrong. I haven't been able to check/optimize the functionalities. It's quite a big refactor and a really nice one as well! I would still need some time to fully understand how everything links together, but our meeting this morning helped a lot.
The test coverage is now 82%, it would be good if we could increase this (perhaps this could be an issue of its own though).
Thanks Chris for the review, will look asap |
c4e59db
to
007aff4
Compare
I've tried increasing the test coverage a bit, by looking at what was not covered |
Yes, I see, good point. We could exclude the generated files by adding them to the [tool.coverage.run]
branch = true
omit = ["tests/*", "**/.tox/**","opensquirrel/parsing/antlr/*"] |
c9524f4
to
0d0a06d
Compare
- Implement ControlledSemantic to be able to express CNOT as a controlled X, for instance - Separate validation of qubit ranges from type-checking in a separate ANTLR tree visitor - snake_case instead of camelCase for variable names - Add docstrings to parsing classes - The GateLibrary superclass is used to factorize code for gateset-aware classes (e.g. TypeChecker) - Semantic classes are removed, absorbed into Gate subclasses - Move ALL ANTLR parsing classes to parsing folder - this has already been done, but only partially - Gates are specified directly with Python functions and a decorator - Lay the basis of handling of anonymous gates - Writer turned into impl pattern - Rename AST -> IR - Make test_testinterpreter a proper unit test, before it was testing parsing too - Visitor pattern for the SquirrelIR class - Use those visitors in e.g. writer and test_interpreter - Various code fixes - Use inspect to know Python function signatures This makes the gate semantic API nice to use from Python.
0d0a06d
to
0cf85c1
Compare
Changes
controlled X, for instance
ANTLR tree visitor
classes (e.g. TypeChecker)
been done, but only partially
parsing too
This makes the gate semantic API nice to use from Python.