Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: The DefMeasureCalibration instructions property returns pyQuil AbstractInstrctions instead of quil Instructions #1799

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

MarquessV
Copy link
Contributor

Description

closes #1798

pyQuil v3 defined the instrs property on DefMeasureCalibration as the only way to get the calibrations contained instructions. The quil counterpart uses an instructions property for this purpose. In pyQuil v4, we inherit from quil base types, but for DefMeasureCalibration, never overrode the instructions property, meaning that when instructions was accessed on DefMeasureCalibration, quil classes were returned. This fix overrides the inherited instruction property and uses the compatibility layer to return pyQuil compatible instructions.

Checklist

  • The PR targets the master branch
  • The above description motivates these changes.
  • The change is atomic and can be described by a single commit (your PR will be squashed on merge).
  • All changes to code are covered via unit tests.
  • Parameters and return values have type hints with PEP 484 syntax.
  • Functions and classes have useful Sphinx-style docstrings.
  • (Bugfix) The associated issue is referenced above using auto-close keywords.

@MarquessV MarquessV requested a review from a team as a code owner August 13, 2024 16:43
Copy link

🐰Bencher

ReportTue, August 13, 2024 at 16:44:35 UTC
Projectpyquil
Branch1798-instructions-property-fix
Testbedci-runner-linux
Click to view all benchmark results
BenchmarkLatencyLatency Results
nanoseconds (ns) | (Δ%)
Latency Upper Boundary
nanoseconds (ns) | (%)
test/benchmarks/test_program.py::test_copy_everything_except_instructions✅ (view plot)10,332,968,519.40 (+0.74%)10,493,400,802.08 (98.47%)
test/benchmarks/test_program.py::test_instructions✅ (view plot)3,915,241,084.40 (-0.41%)4,059,922,179.44 (96.44%)
test/benchmarks/test_program.py::test_iteration✅ (view plot)3,880,498,774.80 (-1.19%)4,048,949,509.63 (95.84%)

Bencher - Continuous Benchmarking
View Public Perf Page
Docs | Repo | Chat | Help

Copy link

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7244 6357 88% 87% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
pyquil/quilbase.py 94% 🟢
TOTAL 94% 🟢

updated for commit: 6120f33 by action🐍

@MarquessV
Copy link
Contributor Author

Merging w/ the implicit approval from #1801

@MarquessV MarquessV merged commit 4afc81b into master Aug 13, 2024
19 of 22 checks passed
@MarquessV MarquessV deleted the 1798-instructions-property-fix branch August 13, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fence instruction incorrectly typed inside measurement calibration
1 participant