Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GiggleLiu committed May 26, 2024
1 parent f75ba6e commit d1acd9a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ LinearAlgebra = "1"
LinearOperators = "2"
LuxorGraphPlot = "0.4"
OMEinsum = "0.8"
Yao = "0.9"
julia = "1"

[extras]
Expand Down
4 changes: 2 additions & 2 deletions src/mpo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function code_sandwich(bra::MPS, op::MPO, ket::MPS; optimizer=GreedyMethod())
return optimize_code(DynamicEinCode(ixs, Int[]), size_dict, optimizer)
end

function sandwich(bra::MPS, op::MPO, ket::MPS)
function Yao.sandwich(bra::MPS, op::MPO, ket::MPS)
code = code_sandwich(bra, op, ket)
return code(conj.(bra.tensors)..., op.tensors..., ket.tensors...)[]
end
Expand All @@ -132,4 +132,4 @@ function transverse_ising_mpo(::Type{T}, n::Int, h::Real) where T
tensor1[1, :, :, 2] = tensor2[2, :, :, 3] = tensor2[1, :, :, 2] = tensor3[2, :, :, 1] = Matrix{T}(Z)
tensor1[1, :, :, 3] = tensor2[1, :, :, 3] = tensor3[1, :, :, 1] = Matrix{T}(X) .* h
MPO([tensor1, fill(tensor2, n-2)..., tensor3])
end
end

0 comments on commit d1acd9a

Please sign in to comment.