|
1 | 1 | """ |
2 | | - get_expham(dt::Number, H::LocalOperator) |
| 2 | + get_expham(H::LocalOperator, dt::Number) |
3 | 3 |
|
4 | 4 | Compute `exp(-dt * op)` for each term `op` in `H`, |
5 | 5 | and combine them into a new LocalOperator. |
6 | 6 | Each `op` in `H` must be a single `TensorMap`. |
7 | 7 | """ |
8 | | -function get_expham(dt::Number, H::LocalOperator) |
| 8 | +function get_expham(H::LocalOperator, dt::Number) |
9 | 9 | return LocalOperator( |
10 | 10 | physicalspace(H), (sites => exp(-dt * op) for (sites, op) in H.terms)... |
11 | 11 | ) |
@@ -181,27 +181,38 @@ Obtain the 3-site gate MPO on the southeast cluster at position `[row, col]` |
181 | 181 | c c+1 |
182 | 182 | ``` |
183 | 183 | """ |
184 | | -function _get_gatempo_se(gate::LocalOperator, row::Int, col::Int) |
185 | | - Nr, Nc = size(gate.lattice) |
| 184 | +function _get_gatempo_se(ham::LocalOperator, dt::Number, row::Int, col::Int) |
| 185 | + Nr, Nc = size(ham) |
186 | 186 | @assert 1 <= row <= Nr && 1 <= col <= Nc |
187 | | - unit = id(space(gate.terms[1].second, 1)) |
188 | | - sites = ( |
| 187 | + sites = [ |
189 | 188 | CartesianIndex(row, col), |
190 | 189 | CartesianIndex(row, col + 1), |
191 | 190 | CartesianIndex(row - 1, col + 1), |
192 | | - ) |
193 | | - nb1x = get_gateterm(gate, (sites[1], sites[2])) |
194 | | - nb1y = get_gateterm(gate, (sites[2], sites[3])) |
195 | | - nb2 = get_gateterm(gate, (sites[1], sites[3])) |
196 | | - op = (1 / 2) * (nb1x ⊗ unit + unit ⊗ nb1y) + permute(nb2 ⊗ unit, ((1, 3, 2), (4, 6, 5))) |
| 191 | + ] |
| 192 | + nb1x = get_gateterm(ham, (sites[1], sites[2])) |
| 193 | + nb1y = get_gateterm(ham, (sites[2], sites[3])) |
| 194 | + nb2 = get_gateterm(ham, (sites[1], sites[3])) |
| 195 | + # identity operator at each site |
| 196 | + units = map(sites) do site |
| 197 | + site_ = CartesianIndex(mod1(site[1], Nr), mod1(site[2], Nc)) |
| 198 | + return id(physicalspace(ham)[site_]) |
| 199 | + end |
| 200 | + # when iterating through ┘, └, ┌, ┐ clusters in the unit cell, |
| 201 | + # NN / NNN bonds are counted 4 / 2 times, respectively. |
| 202 | + @tensor Odt[i' j' k'; i j k] := |
| 203 | + -dt * ( |
| 204 | + (nb1x[i' j'; i j] * units[3][k' k] + units[1][i'; i] * nb1y[j' k'; j k]) / 4 + |
| 205 | + (nb2[i' k'; i k] * units[2][j'; j]) / 2 |
| 206 | + ) |
| 207 | + op = exp(Odt) |
197 | 208 | return gate_to_mpo3(op) |
198 | 209 | end |
199 | 210 |
|
200 | 211 | """ |
201 | 212 | Construct the 3-site gate MPOs on the southeast cluster |
202 | 213 | for 3-site simple update on square lattice. |
203 | 214 | """ |
204 | | -function _get_gatempos_se(gate::LocalOperator) |
205 | | - Nr, Nc = size(gate.lattice) |
206 | | - return collect(_get_gatempo_se(gate, r, c) for r in 1:Nr, c in 1:Nc) |
| 215 | +function _get_gatempos_se(ham::LocalOperator, dt::Number) |
| 216 | + Nr, Nc = size(ham.lattice) |
| 217 | + return collect(_get_gatempo_se(ham, dt, r, c) for r in 1:Nr, c in 1:Nc) |
207 | 218 | end |
0 commit comments