-
Notifications
You must be signed in to change notification settings - Fork 86
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
Add custom measurement operations to Q# #1967
base: main
Are you sure you want to change the base?
Conversation
@@ -289,7 +289,7 @@ impl CompletionListBuilder { | |||
} | |||
|
|||
fn push_attributes(&mut self) { | |||
static ATTRIBUTES: [&str; 2] = ["@EntryPoint()", "@Config()"]; | |||
static ATTRIBUTES: [&str; 3] = ["@EntryPoint()", "@Config()", "@Measurement()"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heads up, this code is changing in my PR. When you hit the merge conflict, I suggest just reverting this and searching again for the attribute list instead of trying to resolve it as a merge conflict...
@orpuente-MS Do we really need an explicit |
This PR adds the ability to declare custom measurements in Q#. Here is an example:
The generated QIR will be,
Design Notes
@Measurement()
attribute over a newmeasurement
keyword to avoid putting extra syntax into the language.body intrinsic
or a@SimulatableIntrinsic()
.Qubits
as inputs and haveResults
as outputs.Notes to reviewers
This PR consists of the following steps:
@Measurement()
attribute to the language and piping it down to FIR.#1
attribute indicating an irreversible operation.@Measurement()
attribute to the completions list.Next steps
After this PR is merged we can add the
@Measurement()
attribute to the measurement operations in the standard library and remove the hard coded logic we have for them in the compiler.