Skip to content

Commit

Permalink
use ispow2
Browse files Browse the repository at this point in the history
  • Loading branch information
lpawela committed Jul 24, 2020
1 parent e491915 commit 5a3fc59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ TensorOperations
Convex
SCS
Pkg
Requires
Requires
IsApprox
2 changes: 1 addition & 1 deletion src/gates.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $(SIGNATURES)
Prepares [Hadamard operator](https://en.wikipedia.org/wiki/Hadamard_transform) of dimension `d`.
"""
function hadamard(dim::Int)
if floor(log2(dim))!=log2(dim)
if !ispow2(dim)
throw(ArgumentError("Hadamard dim has to be power of 2"))
end

Expand Down

0 comments on commit 5a3fc59

Please sign in to comment.