rigetti / pyquil

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

feat: Expressions without parameters have improved compatibility with numpy. #1757

Closed MarquessV closed 2 months ago

MarquessV commented 3 months ago

Description

Closes #1682.

This implements the numpy array protocol by leaning on quil-rs expression simplification to get a numpy compatible number from the expression, if possible. If not, we still fallback to the default numpy behavior as to not break existing code.

Checklist

github-actions[bot] commented 3 months ago

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7185 6330 88% 87% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
pyquil/paulis.py 98% 🟢
pyquil/quilatom.py 83% 🟢
TOTAL 91% 🟢

updated for commit: b4b6ac0 by action🐍