Open msoeken opened 3 years ago
@msoeken This is a case of the necessary validation not yet having been implemented, sorry. The idea is that you shouldn't be able to attach a TargetInstruction attribute to an operation that has more than one specialization; you would need to manually write what the compiler would otherwise do; the compiler translates
operation Foo () : Unit is Adj {
body intrinsic;
}
into
@Inline()
operation Foo () : Unit is Adj {
body (...) {
Foo__body();
}
adjoint (...) {
Foo__adj();
}
}
@TargetInstruction("Foo__body")
operation Foo__body() : Unit {
body intrinsic;
}
@TargetInstruction("Foo__adj")
operation Foo__adj() : Unit {
body intrinsic;
}
Thanks for the clarification
Describe the bug
The QIR output does not distinguish between a body and adjoint call.
To Reproduce
Call
botnet build
on the following project:Expected behavior
I expect two LLVM declarations for
@__quantum__qis__instruction__body
and@__quantum__qis__instruction__adj
.Actual behavior
Body and adjoint variants map to the same LLVM declaration
@__quantum__qis__instruction
:System information
OS: macOS 11.2.2
.NET Core Version: 5.0.103