quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
457 stars 72 forks source link

Floats in parsed-program prints can't be re-parsed #908

Closed ecpeterson closed 9 months ago

ecpeterson commented 9 months ago

The Quil snippet

DEFGATE SQRTSWAP p q AS PAULI-SUM:
    XX(pi/8) p q
    YY(pi/8) p q
    ZZ(pi/8) p q

...

gets re-printed as

DEFGATE SQRTSWAP p q AS PAULI-SUM:
    XX(1.1780972450961724d0) p q
    YY(0.39269908169872414d0) p q
    ZZ(0.39269908169872414d0) p q

which contains Lisp-y d0 suffixes that the Quil parser can't re-ingest.