quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
454 stars 73 forks source link

simplify DAGGER modifiers in operators #800

Closed stylewarning closed 2 years ago

stylewarning commented 2 years ago

This will simplify modifier chains such as:

DAGGER CONTROLLED DAGGER FORKED F(...) ...

by bringing DAGGERs to the front and canceling them out.

This commit also simplifies parameter arithmetic by eliding factors of one.

This also allows programs like

DAGGER DAGGER CPHASE(x) 0 1

to compile.

In order to accomplish this, we re-work where some of the simplification and the like happens.

stylewarning commented 2 years ago

Tests are "passing", but the golden test files are failing. I'll have to think about how I want to deal with this. Options are:

stylewarning commented 2 years ago

from Quil meeting, there is general agreement to move optimization/simplification transforms to compiler-hook, possibly needing to regenerate the golden test files

stylewarning commented 2 years ago

@kilimanjaro @ecpeterson @notmgsk this is ready for review now