Skip to content

Commit a8297e8

Browse files
committed
modify
1 parent 2345a31 commit a8297e8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/controldynamics.jl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ end
1919

2020
function unitary(seq::Sequence, β::Real=0, z0::Vector{<:Real}=[0,0,1])
2121
U0=unitary(seq.idle,β,z0)
22-
Un=[unitary(g,β,z0) for g in seq.gates]
22+
Up=[unitary(g,β,z0) for g in seq.gates]
23+
Un=[unitary(g,β,-z0)' for g in seq.gates]
24+
2325
V=σ_i
2426
for i in seq.order
25-
U= i==0 ? U0 : (sign(i)>0 ? Un[abs(i)] : Un[abs(i)]')
27+
U= i==0 ? U0 : (sign(i)>0 ? Up[abs(i)] : Un[abs(i)])
2628
V=U*V
2729
end
2830
return V
@@ -41,7 +43,7 @@ function deploy(ψ::Union{Vector{ComplexF64},Matrix{ComplexF64}}, seq::Sequence,
4143
dt=seq.idle.t/n
4244
U0=unitary(Idle(dt),β,z0)
4345
Up=map(g->unitary(g,β,z0), seq.gates)
44-
Un=map(g->unitary(g,β,-z0), seq.gates)
46+
Un=map(g->unitary(g,β,-z0)', seq.gates)
4547

4648
t_cycle= cycleslice(seq,n)
4749
N=length(t_cycle)
@@ -60,7 +62,7 @@ function deploy(ψ::Union{Vector{ComplexF64},Matrix{ComplexF64}}, seq::Sequence,
6062
ψ_arr[p] = ψ
6163
end
6264
else
63-
U= sign(i)>0 ? Up[abs(i)] : Un[abs(i)]'
65+
U= sign(i)>0 ? Up[abs(i)] : Un[abs(i)]
6466
ψ=evolve(ψ, U)
6567
p+=1
6668
ψ_arr[p] = ψ

0 commit comments

Comments
 (0)