You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the new parser (introduced in v4), parameters are no longer converted to symbolic number, e.g., $\pi/2$ is left as 1.5707963267948966 and not parsed back to pi/2.
The old behaviour was convenient, because it would make conversion from other languages (e.g. Cirq) to a Pyquil program and viceversa idempotent (related to Cirq#6714)
cosenal
changed the title
Parameters are not converted back to symbolic numbers
Numbers in parameters not converted back to their symbolic representation
Oct 8, 2024
Pre-Report Checklist
NOTE: I am not sure if the underlying issue is the same as Pyquil converts real gate parameter to complex. #1701 1701
Issue Description
With the new parser (introduced in v4), parameters are no longer converted to symbolic number, e.g.,$\pi/2$ is left as
1.5707963267948966
and not parsed back topi/2
.The old behaviour was convenient, because it would make conversion from other languages (e.g. Cirq) to a Pyquil program and viceversa idempotent (related to Cirq#6714)
How to Reproduce
Code Snippet
Error Output
Until pyquil v3, the output used to be
The parser had this feature of figuring out the representation of pi from a truncated decimal approximation.
Starting from pyquil v4, the number stays as
Perhaps more accurate, but less convenient for the conversions I mentioned above.
Environment Context
Operating System:
Python Version (
python -V
): Python 3.12.7Quilc Version (
quilc --version
): N/RQVM Version (
qvm --version
): N/RPython Environment Details (
pip freeze
orconda list
):The text was updated successfully, but these errors were encountered: