Describe the bug
Not really a bug, but an inconsistency. AssertQubit does not have an Adj functor, but AssertAllZero, which uses AssertQubit, does have one (adjoint self).
To Reproduce
Consider the following operation:
operation ApplyAnd(control1 : Qubit, control2 : Qubit, target : Qubit) : Unit is Adj {
AssertQubit(Zero, target);
CCNOT(control1, control2, target);
}
This does not compile because AssertQubit does not have an Adj functor.
Expected behavior
Operation should compile, and check in the adjoint call to ApplyAnd that target is released in state Zero.
Actual behavior
Operation does not compile, however, I can use the following alternative:
operation ApplyAnd(control1 : Qubit, control2 : Qubit, target : Qubit) : Unit is Adj {
AssertAllZero([target]);
CCNOT(control1, control2, target);
}