Skip to content
This repository has been archived by the owner on Dec 18, 2021. It is now read-only.

Commit

Permalink
Merge branch 'rm_matvec' of https://github.com/QuantumBFS/YaoArrayReg…
Browse files Browse the repository at this point in the history
…ister.jl into rm_matvec
  • Loading branch information
Roger-luo committed Sep 26, 2020
2 parents 4e80e20 + 5fa1395 commit 4839165
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/instruct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ end # for
(loc, )::Tuple{Int},
theta::Number
) where {T, N}
a, b = cos(theta / 2), -im*sin(theta / 2)
instruct_kernel(state, loc, 1 << (loc - 1), 1 << loc, a, b, b, a)
b, a = sincos(theta / 2)
instruct_kernel(state, loc, 1 << (loc - 1), 1 << loc, a, -im*b, -im*b, a)
return state
end

Expand All @@ -356,7 +356,7 @@ function YaoBase.instruct!(
(loc, )::Tuple{Int},
theta::Number
) where {T, N}
a, b = cos(theta / 2), sin(theta / 2)
b, a = sincos(theta / 2)
instruct_kernel(state, loc, 1 << (loc - 1), 1 << loc, a, -b, b, a)
return state
end
Expand All @@ -367,8 +367,8 @@ function YaoBase.instruct!(
(loc, )::Tuple{Int},
theta::Number
) where {T, N}
a, d = exp(-im * theta / 2), exp(im * theta / 2)
instruct_kernel(state, loc, 1 << (loc - 1), 1 << loc, a, zero(T), zero(T), d)
a = exp(-im * theta / 2)
instruct_kernel(state, loc, 1 << (loc - 1), 1 << loc, a, zero(T), zero(T), a')
return state
end

Expand Down

0 comments on commit 4839165

Please sign in to comment.