Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Apply #1036 to open systems simulator.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgranade committed Jul 14, 2022
1 parent dd6e9fe commit d11e6a4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ namespace Microsoft.Quantum.Experimental.Decompositions {

internal operation SpreadZ (from : Qubit, to : Qubit[]) : Unit is Adj {
if (Length(to) > 0) {
Controlled Intrinsic.X([to[0]], from);
if (Length(to) > 1) {
let half = Length(to) / 2;
SpreadZ(to[0], to[half + 1 .. Length(to) - 1]);
SpreadZ(from, to[1 .. half]);
}
Controlled Intrinsic.X([to[0]], from);
}
}

Expand Down

0 comments on commit d11e6a4

Please sign in to comment.