Skip to content

Commit d1acd9a

Browse files
committed
update
1 parent f75ba6e commit d1acd9a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ LinearAlgebra = "1"
1717
LinearOperators = "2"
1818
LuxorGraphPlot = "0.4"
1919
OMEinsum = "0.8"
20+
Yao = "0.9"
2021
julia = "1"
2122

2223
[extras]

src/mpo.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function code_sandwich(bra::MPS, op::MPO, ket::MPS; optimizer=GreedyMethod())
106106
return optimize_code(DynamicEinCode(ixs, Int[]), size_dict, optimizer)
107107
end
108108

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

0 commit comments

Comments
 (0)