feat!: Add a Measurement type as the return type for measurement functions#1707
Open
feat!: Add a Measurement type as the return type for measurement functions#1707
Measurement type as the return type for measurement functions#1707Conversation
# Conflicts: # guppylang/src/guppylang/std/qsystem/__init__.py # guppylang/src/guppylang/std/qsystem/functional.py
Collaborator
|
This PR contains breaking changes to the public Python API. Breaking changes summary |
Contributor
|
| Branch | ts/future-measure |
| Testbed | Linux |
Click to view all benchmark results
| Benchmark | hugr_bytes | Benchmark Result bytes x 1e3 (Result Δ%) | Upper Boundary bytes x 1e3 (Limit %) | hugr_nodes | Benchmark Result nodes (Result Δ%) | Upper Boundary nodes (Limit %) |
|---|---|---|---|---|---|---|
| tests/benchmarks/test_big_array.py::test_big_array_compile | 📈 view plot 🚷 view threshold | 158.28 x 1e3(-0.31%)Baseline: 158.77 x 1e3 | 160.36 x 1e3 (98.71%) | 📈 view plot 🚷 view threshold | 6,630.00(-0.17%)Baseline: 6,641.00 | 6,707.41 (98.85%) |
| tests/benchmarks/test_ctrl_flow.py::test_many_ctrl_flow_compile | 📈 view plot 🚷 view threshold | 26.98 x 1e3(-2.00%)Baseline: 27.53 x 1e3 | 27.81 x 1e3 (97.02%) | 📈 view plot 🚷 view threshold | 1,051.00(-2.14%)Baseline: 1,074.00 | 1,084.74 (96.89%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_benchmark_compile | 📈 view plot 🚷 view threshold | 10.08 x 1e3(-7.61%)Baseline: 10.91 x 1e3 | 11.02 x 1e3 (91.48%) | 📈 view plot 🚷 view threshold | 300.00(-2.60%)Baseline: 308.00 | 311.08 (96.44%) |
| tests/benchmarks/test_queue_push_pop.py::test_queue_push_pop_benchmark_compile | 📈 view plot 🚷 view threshold | 13.88 x 1e3(-6.44%)Baseline: 14.84 x 1e3 | 14.99 x 1e3 (92.64%) | 📈 view plot 🚷 view threshold | 423.00(-2.76%)Baseline: 435.00 | 439.35 (96.28%) |
Congrats! CodSpeed is installed 🎉
You will start to see performance impacts in the reports once the benchmarks are run from your default branch.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1485
Requires a breaking tket release with the extension changes in #1558 before this can be merged
BREAKING CHANGE: (guppylang.std.quantum):
measure(andmeasure_arrayby extension) now returnMeasurementinstead ofboolBREAKING CHANGE: (guppylang.std.qsystem/qsystem.functional):
measureandmeasure_reset(and by extension the array versions) now returnMeasurementinstead ofbool(this matches the behaviour oflazy_measure/lazy_measure_and_reset)BREAKING CHANGE: (guppylang_internals):
boolis now lowered toht.Boolagain instead oftket.boolThe
deferred_measurement.ipynbnotebook has been adjusted to explain the motivation for the lazy behaviour instead of contrastingmeasureandlazy_measure