# Defining two site local operators as part of a local Hamiltonian

Hi!

I am trying the define a three local Hamiltonian H= \sum_i h_i with h_j= X_j \; CZ_{j-1,j+1} but keep getting an error due to the two local CZ gate at the end. Is there an straightforward way to get around the issue?

using ITensors

N=16
acc=1E-13
bond_dim=50
sites = siteinds("Qubit",N)
psi0 = randomMPS(sites,bond_dim)
ampo = AutoMPO()

for j=2:N-1
# Want to define h_j= X_j CZ_{j-1,j+1}
ampo += -2,"CZ",j-1,j+1,"σx",j;
end

H = MPO(ampo,sites)
sweeps = Sweeps(15)
maxdim!(sweeps,10,20,50,100,200,400,500)
cutoff!(sweeps,acc)
energy,T = dmrg(H,psi0,sweeps,outputlevel=0)
end


Output: ArgumentError: Tuple contains 2 elements, must contain exactly 1 element