Skip to content

Commit

Permalink
Fix ApplyPauliFromBitString error message (#1782)
Browse files Browse the repository at this point in the history
The bits and qubits in this operation are not used as controls, so we
shouldn't refer to them as such.

(I got this error message when working on a kata, and it took me longer
than it should to figure out that it is not coming from any of the
controlled gates.)
  • Loading branch information
tcNickolas authored Jul 24, 2024
1 parent 1122c4a commit 8b3415b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/qs_source/src/std/canon.qs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ namespace Microsoft.Quantum.Canon {
/// ```
operation ApplyPauliFromBitString(pauli : Pauli, bitApply : Bool, bits : Bool[], qubits : Qubit[]) : Unit is Adj + Ctl {
let nBits = Length(bits);
Fact(nBits == Length(qubits), "Number of control bits must be equal to number of control qubits.");
Fact(nBits == Length(qubits), "Number of bits must be equal to number of qubits.");
for i in 0..nBits - 1 {
if bits[i] == bitApply {
ApplyP(pauli, qubits[i]);
Expand Down

0 comments on commit 8b3415b

Please sign in to comment.