cl-quil currently contains a mix of stuff, ranging from AST definitions to very specific functionality which may only be of interest to the compiler proper. This limits our ability to have tools which i) depend on basic aspects of the quil language, ii) are used in the bowels of the compiler, and iii) are not under the management of the cl-quil system.
Concretely, I'm thinking of the qvm here. We currently don't use it in the compiler, but we might want to, as mentioned by ECP. And contrary to my initial intuition, we do see some performance improvements, at least on tests (e.g. if we use the unitary-qvm as the implementation of make-matrix-from-quil, which gets called a lot in the compressor, then on my machine the TEST-LOGICAL-MATRIX-SANITY test run time goes from about 30 seconds to about 6).
It would be possible to factor out some of the cl-quil code into something like a cl-quil/frontend. This would contain AST & parser stuff, the gate protocol, and the clifford & analysis modules. More or less whatever qvm uses. There'd also be a cl-quil.frontend package that the main cl-quil package uses, and e.g. the qvm or other such tools could use just that.
cl-quil
currently contains a mix of stuff, ranging from AST definitions to very specific functionality which may only be of interest to the compiler proper. This limits our ability to have tools which i) depend on basic aspects of the quil language, ii) are used in the bowels of the compiler, and iii) are not under the management of thecl-quil
system.Concretely, I'm thinking of the
qvm
here. We currently don't use it in the compiler, but we might want to, as mentioned by ECP. And contrary to my initial intuition, we do see some performance improvements, at least on tests (e.g. if we use theunitary-qvm
as the implementation ofmake-matrix-from-quil
, which gets called a lot in the compressor, then on my machine theTEST-LOGICAL-MATRIX-SANITY
test run time goes from about 30 seconds to about 6).It would be possible to factor out some of the
cl-quil
code into something like acl-quil/frontend
. This would contain AST & parser stuff, the gate protocol, and the clifford & analysis modules. More or less whateverqvm
uses. There'd also be acl-quil.frontend
package that the maincl-quil
package uses, and e.g. theqvm
or other such tools could use just that.