This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Add RequiresCapability attribute #372
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
d7668ba
Add Capability attribute to Microsoft.Quantum.Core
50c49e5
Merge branch 'main' into samarsha/capability-attribute
bamarsha 80cc910
Merge branch 'main' into samarsha/capability-attribute
bamarsha 0c66575
Merge branch 'main' into samarsha/capability-attribute
bamarsha 6eec594
Override Reset capability
972c382
Use "Named Items" instead of "Input" in doc
2b3c519
Add documentation for capability levels
d2db554
Rename attribute to RequiresCapability
1538eef
Add Reason property
cfe4385
Update capability names
fb0d919
Move attribute to Microsoft.Quantum.Targeting
8e919e6
Format capability names as string literals
bamarsha 7b72c69
Add quotes around FullComputation
75b5286
Merge branch 'main' into samarsha/capability-attribute
bettinaheim 39e4207
Update namespace description
8926b9f
Update copyright header
bamarsha 9f15210
Add note that attribute is compiler-generated
2843c3c
Clarify behavior when attribute is manually added
adbe732
Merge branch 'main' into samarsha/capability-attribute
bettinaheim 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
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,39 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| /// # Summary | ||
| /// This namespace provides functionality for targeting specific quantum processors. | ||
| namespace Microsoft.Quantum.Targeting { | ||
| /// # Summary | ||
| /// Compiler-recognized attribute used to mark a callable with the runtime capabilities it | ||
| /// requires. | ||
| /// | ||
| /// # Named Items | ||
| /// ## Level | ||
| /// The name of the runtime capability level required by the callable. | ||
| /// | ||
| /// ## Reason | ||
| /// A description of why the callable requires this runtime capability. | ||
| /// | ||
| /// # Remarks | ||
| /// This attribute is automatically added to callables by the compiler, unless an instance of | ||
| /// this attribute already exists on the callable. It should not be used except in rare cases | ||
| /// where the compiler does not infer the required capability correctly. | ||
| /// | ||
| /// Below is the list of capability level names, in order of increasing capabilities or | ||
| /// decreasing restrictions: | ||
| /// | ||
| /// ## `"BasicQuantumFunctionality"` | ||
| /// Measurement results cannot be compared for equality. | ||
| /// | ||
| /// ## `"BasicMeasurementFeedback"` | ||
| /// Measurement results can be compared for equality only in if-statement conditional | ||
| /// expressions in operations. The block of an if-statement that depends on a result cannot | ||
| /// contain set statements for mutable variables declared outside the block, or return | ||
| /// statements. | ||
| /// | ||
| /// ## `"FullComputation"` | ||
| /// No runtime restrictions. Any Q# program can be executed. | ||
| @Attribute() | ||
bamarsha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| newtype RequiresCapability = (Level : String, Reason : String); | ||
bettinaheim marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
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.