-
Notifications
You must be signed in to change notification settings - Fork 173
QRE Update #3090
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
Merged
Merged
QRE Update #3090
Changes from 62 commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
98edf5f
Add QRE code owners for PR review assignment. (#2853)
msoeken 24f5344
Merge branch 'main' into feature/qre
msoeken 413cba3
Types to define ISAs and ISA requirements (#2856)
msoeken dcc53ed
Enumerate ISAs with transforms and queries (#2894)
msoeken 0fae825
Initial commit; hypergraph module added (#2909)
brad-lackey c0308e9
Data types for traces, transforms, Pareto frontiers (#2907)
msoeken 4c706d4
Magnets: added greedy edge coloring method, and two simple 1d lattice…
brad-lackey 50d9bbc
Magnets: Base classes for Trotter-Suzuki expansions (#2913)
brad-lackey c8b973a
Base class for magnet models (#2914)
brad-lackey 29c03ba
Magnets: more basic geometries (#2919)
brad-lackey ecd7e23
ISA queries, trace queries, and enumeration. (#2916)
msoeken aee65fa
Magnets: changed implementation of edge coloring (#2925)
brad-lackey b3f5198
Magnets: refactored Trotter step classes and added Suzuki and Yoshida…
brad-lackey b026182
New ISA and ISARequirements function (#2923)
msoeken 289a181
Track instruction origin (#2933)
msoeken 80ec786
Refactor trace and result properties (#2952)
msoeken bcc31d0
Brlackey/magnets ising model (#2955)
brad-lackey e19e6a1
Magnets: added utilities (#2965)
brad-lackey 511c953
Various RE models and some API enhancements (#2963)
msoeken 696f0dc
Merge branch 'main' into feature/qre
msoeken 41bf7b5
Magnets: revisions to (hypergraph) coloring (#2972)
brad-lackey 674124f
Minor changes to colorings and term representation; added Heisenberg …
brad-lackey 1040016
More edits to functionality
brad-lackey 739d087
Merge branch 'feature/qre' of github.com:microsoft/qdk into feature/qre
brad-lackey df1f2c2
Fix magnet tests (#3006)
msoeken bdddb70
Resource estimation results table (#2973)
msoeken a7d15c9
Refactor property keys from string to integer and add estimation impr…
msoeken 8b1b520
QIR interop in QRE (#3018)
msoeken 5ce010a
Split Yoked SC model into two codes (#3019)
msoeken 0c86dbb
Use Rust parallelism for estimation with post processing (#3025)
msoeken dcadb5c
Fixes bucketing logic to distribute rotations to match the right dept…
msoeken 317ff6a
Graph-based ISA pruning for resource estimation (#3031)
msoeken 5de8ec1
Magnets: modified Trotter expansion classes and added Cirq output. (#…
brad-lackey 1d5b568
Two small fixes to QRE 3 (#3041)
msoeken cd308a9
Return ISA as a pandas data frame (#3042)
msoeken 8597d0a
Temporary plotting for estimation results (#3043)
msoeken 232df87
Get the name of a known property ID as a string (#3044)
msoeken f1ceab8
Trace properties for logical qubits (#3045)
msoeken 9d87a9c
Expose ISA requirements of a trace (#3046)
msoeken dabfa32
Trace ISA requirements (#3050)
msoeken c22cf5c
Plot multiple estimation tables in single plot (#3054)
msoeken 0b92123
Create QRE traces from cirq circuits (#3060)
msoeken bc9a3c7
Merge branch 'main' into feature/qre
msoeken 358171d
File missing from previous merge.
msoeken 8f08a2b
Reorganize files and spit up large files in QRE (#3069)
msoeken c1bc4fc
Complete and consistent docs for QRE (#3077)
msoeken 556e8a4
Remove matplotlib from tests (#3078)
msoeken cf70736
Adjust pruning logic for graph based search (#3089)
msoeken 04f1e46
Merge branch 'main' into feature/qre
msoeken e5708d1
Fix CODEOWNERS file.
msoeken 1c3b049
Enhance application models.
msoeken 204c3e0
Address or postpone TODOs.
msoeken 9d63b78
OpenQASM application model.
msoeken 7c24ece
Re-export qre from the qdk package as extra dependency.
msoeken 4b1acbf
Convenience functions for custom properties and property columns.
msoeken 32ce932
API and doc improvements.
msoeken ce85591
Fix problem with negative exponents in cirq interop.
msoeken 923a356
Move magnets module into qre.application.
msoeken 017ebfc
Add telemetry events for QRE.
msoeken fc899f9
Cirq interop handles memory/compute qubits.
msoeken 0f31c20
Make RoundBasedFactory not expose lattice surgery instructions into p…
msoeken ef339bb
Clarify memory qubit tracking in Cirq interop.
msoeken 6d801f2
Addressing reviewer comments.
msoeken 74220b9
Missed pandas dependency in all.
msoeken 3aea86f
Remove spurious commented code
brad-lackey c379b59
Instruction IDs and property keys.
msoeken 42666f3
Properties.
msoeken a4f812c
Instruction IDs.
msoeken 9f00d3b
Add diagnostic code to error type.
msoeken 8674a75
qre extras in qsharp package.
msoeken e6474c3
Move magnets to applications module in qsharp and qdk.
msoeken 2f3b526
Merge branch 'main' into feature/qre
msoeken 3eb898b
PyQIR API updates.
msoeken 543f021
Apply suggestion from @billti
billti 2405dba
Merge remote-tracking branch 'origin/main' into feature/qre
billti ecce077
Exclude cirq on Windows ARM64
billti cd3f5c3
More cirq preconditions
billti 8691f67
Merge remote-tracking branch 'origin/main' into feature/qre
billti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| import timeit | ||
| from dataclasses import dataclass, KW_ONLY, field | ||
| from qsharp.qre import linear_function, generic_function | ||
| from qsharp.qre._architecture import _make_instruction | ||
| from qsharp.qre.models import GateBased, SurfaceCode | ||
| from qsharp.qre._enumeration import _enumerate_instances | ||
|
|
||
|
|
||
| def bench_enumerate_instances(): | ||
| # Measure performance of enumerating instances with a large domain | ||
| @dataclass | ||
| class LargeDomain: | ||
| _: KW_ONLY | ||
| param1: int = field(default=0, metadata={"domain": range(1000)}) | ||
| param2: bool | ||
|
|
||
| number = 100 | ||
|
|
||
| duration = timeit.timeit( | ||
| "list(_enumerate_instances(LargeDomain))", | ||
| globals={ | ||
| "_enumerate_instances": _enumerate_instances, | ||
| "LargeDomain": LargeDomain, | ||
| }, | ||
| number=number, | ||
| ) | ||
|
|
||
| print(f"Enumerating instances took {duration / number:.6f} seconds on average.") | ||
|
|
||
|
|
||
| def bench_enumerate_isas(): | ||
| import os | ||
| import sys | ||
|
|
||
| # Add the tests directory to sys.path to import test_qre | ||
| # TODO: Remove this once the models in test_qre are moved to a proper module | ||
| sys.path.append(os.path.join(os.path.dirname(__file__), "../tests/qre/")) | ||
| from conftest import ExampleLogicalFactory, ExampleFactory # type: ignore | ||
|
msoeken marked this conversation as resolved.
Outdated
|
||
|
|
||
| ctx = GateBased(gate_time=50, measurement_time=100).context() | ||
|
|
||
| # Hierarchical factory using from_components | ||
| query = SurfaceCode.q() * ExampleLogicalFactory.q( | ||
| source=SurfaceCode.q() * ExampleFactory.q() | ||
| ) | ||
|
|
||
| number = 100 | ||
| duration = timeit.timeit( | ||
| "list(query.enumerate(ctx))", | ||
| globals={ | ||
| "query": query, | ||
| "ctx": ctx, | ||
| }, | ||
| number=number, | ||
| ) | ||
|
|
||
| print(f"Enumerating ISAs took {duration / number:.6f} seconds on average.") | ||
|
|
||
|
|
||
| def bench_function_evaluation_linear(): | ||
| fl = linear_function(12) | ||
|
|
||
| inst = _make_instruction(42, 0, None, 1, fl, None, 1.0, {}) | ||
| number = 1000 | ||
| duration = timeit.timeit( | ||
| "inst.space(5)", | ||
| globals={ | ||
| "inst": inst, | ||
| }, | ||
| number=number, | ||
| ) | ||
|
|
||
| print( | ||
| f"Evaluating linear function took {duration / number:.6f} seconds on average." | ||
| ) | ||
|
|
||
|
|
||
| def bench_function_evaluation_generic(): | ||
| def func(arity: int) -> int: | ||
| return 12 * arity | ||
|
|
||
| fg = generic_function(func) | ||
|
|
||
| inst = _make_instruction(42, 0, None, 1, fg, None, 1.0, {}) | ||
| number = 1000 | ||
| duration = timeit.timeit( | ||
| "inst.space(5)", | ||
| globals={ | ||
| "inst": inst, | ||
| }, | ||
| number=number, | ||
| ) | ||
|
|
||
| print( | ||
| f"Evaluating linear function took {duration / number:.6f} seconds on average." | ||
| ) | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| bench_enumerate_instances() | ||
| bench_enumerate_isas() | ||
| bench_function_evaluation_linear() | ||
| bench_function_evaluation_generic() | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # Licensed under the MIT License. | ||
|
|
||
| from ._application import Application | ||
| from ._architecture import Architecture, ISAContext | ||
| from ._estimation import estimate | ||
| from ._instruction import ( | ||
| LOGICAL, | ||
| PHYSICAL, | ||
| Encoding, | ||
| ISATransform, | ||
| constraint, | ||
| InstructionSource, | ||
| ) | ||
| from ._isa_enumeration import ISAQuery, ISARefNode, ISA_ROOT | ||
| from ._qre import ( | ||
| ISA, | ||
| InstructionFrontier, | ||
| Constraint, | ||
| ConstraintBound, | ||
| EstimationResult, | ||
| FactoryResult, | ||
| ISARequirements, | ||
| Block, | ||
| Trace, | ||
| block_linear_function, | ||
| constant_function, | ||
| generic_function, | ||
| linear_function, | ||
| instruction_name, | ||
| property_name, | ||
| property_name_to_key, | ||
| ) | ||
| from ._results import ( | ||
| EstimationTable, | ||
| EstimationTableColumn, | ||
| EstimationTableEntry, | ||
| plot_estimates, | ||
| ) | ||
| from ._trace import LatticeSurgery, PSSPC, TraceQuery, TraceTransform | ||
|
|
||
| # Extend Rust Python types with additional Python-side functionality | ||
| from ._instruction import _isa_as_frame, _requirements_as_frame | ||
|
|
||
| ISA.as_frame = _isa_as_frame | ||
| ISARequirements.as_frame = _requirements_as_frame | ||
|
|
||
| __all__ = [ | ||
| "block_linear_function", | ||
| "constant_function", | ||
| "constraint", | ||
| "estimate", | ||
| "linear_function", | ||
| "plot_estimates", | ||
| "Application", | ||
| "Architecture", | ||
| "Block", | ||
| "Constraint", | ||
| "ConstraintBound", | ||
| "Encoding", | ||
| "EstimationResult", | ||
| "EstimationTable", | ||
| "EstimationTableColumn", | ||
| "EstimationTableEntry", | ||
| "FactoryResult", | ||
| "generic_function", | ||
| "instruction_name", | ||
| "InstructionFrontier", | ||
| "InstructionSource", | ||
| "ISA", | ||
| "ISA_ROOT", | ||
| "ISAContext", | ||
| "ISAQuery", | ||
| "ISARefNode", | ||
| "ISARequirements", | ||
| "ISATransform", | ||
| "LatticeSurgery", | ||
| "PSSPC", | ||
| "property_name", | ||
| "property_name_to_key", | ||
| "Trace", | ||
| "TraceQuery", | ||
| "TraceTransform", | ||
| "LOGICAL", | ||
| "PHYSICAL", | ||
| ] |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.