rigetti / pyquil

A Python library for quantum programming using Quil.
http://docs.rigetti.com
Apache License 2.0
1.4k stars 342 forks source link

Pyquil 4.9 break expressions #1768

Closed bramathon closed 5 months ago

bramathon commented 5 months ago

Issue Description

Insert a short description of the bug here, along with what you expected the behavior to be.

Thanks for helping us improve pyQuil! 🙂

How to Reproduce

If useful, provide a numbered list of the steps that result in the error.

Otherwise, just fill out the "Code Snippet" and "Error Output" sections below.

Code Snippet

import numpy as np
import pyquil
from pyquil.quilatom import Parameter

a = np.float_(1.0)
x = Parameter("x")
print(f"Pyquil version: {pyquil.__version__}")
a + x

In pyquil 4.7 and 4.8, this works fine.

In pyquil 4.9, however,

Error Output

Pyquil version: 4.9.0
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[5], line 8
      6 x = Parameter("x")
      7 print(f"Pyquil version: {pyquil.__version__}")
----> 8 a + x

TypeError: unsupported operand type(s) for +: 'float' and 'NoneType'
MarquessV commented 5 months ago

@bramathon Thank you for the report. Fixed in 4.9.1