Skip to content

Commit

Permalink
add docstring for _create_k
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Nov 17, 2024
1 parent 2047420 commit 4055949
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nonclifford.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ function _allthreesumtozero(a,b,c)
true
end

"""Creates a binary vector `k` of the same length as the input vector `b`, with exactly one nonzero element.
The single nonzero element in `k` is positioned at the index of the first nonzero element in `b`. Example:
If `k = BitVector([0, 1, 0, 0, 1])`, then `_create_k(k)` returns `BitVector([0, 1, 0, 0, 0])`."""
function _create_k(b::BitVector)
k = falses(length(b))
pos = findfirst(b)
Expand Down

0 comments on commit 4055949

Please sign in to comment.