Skip to content

Instantly share code, notes, and snippets.

@tanaka-takayoshi
Created December 26, 2018 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanaka-takayoshi/5139cbb403101c5749160ffd6f083fd7 to your computer and use it in GitHub Desktop.
Save tanaka-takayoshi/5139cbb403101c5749160ffd6f083fd7 to your computer and use it in GitHub Desktop.
ApplyToEachCA(CNOT(qs[0], _), qs[1..Length(qs)-1]);
#line 135 "/home/tatanaka/Documents/git/Microsoft/QuantumKatas/Superposition/Tasks.qs"
MicrosoftQuantumCanonApplyToEachCA.Apply((MicrosoftQuantumPrimitiveCNOT.Partial(new Func<Qubit, (Qubit,Qubit)>((_arg1) => (qs[0L], _arg1))), qs?.Slice(new Range(1L, (qs.Length - 1L)))));
#line hidden
for (i in 1 .. Length(qs) - 1) {
CNOT(qs[0], qs[i]);
}
#line 136 "/home/tatanaka/Documents/git/Microsoft/QuantumKatas/Superposition/Tasks.qs"
foreach (var i in new Range(1L, (qs.Length - 1L)))
#line hidden
{
#line 137 "/home/tatanaka/Documents/git/Microsoft/QuantumKatas/Superposition/Tasks.qs"
MicrosoftQuantumPrimitiveCNOT.Apply((qs[0L], qs[i]));
}
#line hidden
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment