QuTech-Delft / OpenQL

OpenQL: A Portable Quantum Programming Framework for Quantum Accelerators. https://dl.acm.org/doi/10.1145/3474222
https://openql.readthedocs.io
Other
100 stars 44 forks source link

OpenQL Modularity #333

Closed razvnane closed 4 years ago

razvnane commented 4 years ago

This PR adds modularity features to the compiler. Because modularity was a major task, with many related tasks, this PR contains many modifications. These modifications can be seen as belonging to one of the 5 categories of work done to accomplish OpenQL modularity:

1) Decoupling of all the old functionality into clear and well-defined functions, for example, rc_scheduling, mapping, etc.

2) Definition of a new class, Compiler, which thourgh its APIs allows custom configuration of compiler passes to be used. This led to the extension of the API with new functionality offered by for example compiler.add_pass | add_pass_alias | set_pass_option. For more information about these features, please see the project documentation.

3) The old program compile method has been internally rerouted to compile_modular, which instead of using the old monolitic compiler code, it creates a passmanager that subsequently hardcodes the old functionality of the compile method by using the new API internally.

4) test_modularity has been created, which shows a simple example how to use the new interface from python

5) Documentation explaining the newly added Compiler class, its use alongside an example, extension of the compiler passes to list how these can be individually enabled in a compiler, and finally, added the compiler API which lists it method that can be used to create a custom compiler.