Skip to content

Commit 7ceb4a3

Browse files
N-site Simple Update (#339)
* Introduce `TrotterMPOs` * Remove `force_3site` * Introduce `TrotterGates` * Improve _get_bond_term; introduce _get_site_term * Allow one-site terms in Hamiltonian for time evolution * Cleanups * Restore force_3site * More cleanups * Fix SU gauge fixing * Generalize gate_to_mpo to any number of sites * Multi-site simple update * Use sequential CTMRG to improve convergence in test * Make `trotterize` more universal * Fix trivial SU gauge fixing * Change Hubbard SU test for MPO gate * Option for second order Trotter * Tweak SU log message and docstrings * Tweak Hubbard MPO-SU test * Minor cleanup * Fix logic in Hubbard MPO-SU test * Merge _su_xbond, _su_ybond * Enable bipartite mode for 2-site MPO gates * Try fixing LAPACKException in tf_ising_finiteT * Add `lattice` field to TrotterGates * Fix SU gauge fixing again * Undo changes to hubbard_model * Update `trotterize` docstrings
1 parent d86143b commit 7ceb4a3

13 files changed

Lines changed: 630 additions & 396 deletions

src/PEPSKit.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ include("algorithms/truncation/fullenv_truncation.jl")
105105
include("algorithms/truncation/bond_truncation.jl")
106106

107107
include("algorithms/time_evolution/trotter_gate.jl")
108-
include("algorithms/time_evolution/trotter_mpo.jl")
109108
include("algorithms/time_evolution/apply_gate.jl")
110109
include("algorithms/time_evolution/apply_mpo.jl")
111110
include("algorithms/time_evolution/time_evolve.jl")

src/algorithms/time_evolution/apply_gate.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
"""
2+
Apply 1-site `gate` on the PEPS or PEPO tensor `a`.
3+
"""
4+
function _apply_sitegate(
5+
a::PEPSTensor, gate::AbstractTensorMap{T, S, 1, 1}; purified::Bool = true
6+
) where {T, S}
7+
@assert purified
8+
return gate * a
9+
end
10+
11+
function _apply_sitegate(
12+
a::PEPOTensor, gate::AbstractTensorMap{T, S, 1, 1}; purified::Bool = true
13+
) where {T, S}
14+
@plansor a′[p1 p2; n e s w] := gate[p1; p] * a[p p2; n e s w]
15+
if !purified
16+
@plansor a′[p1 p2; n e s w] := a′[p1 p; n e s w] * gate[p; p2]
17+
end
18+
return a′
19+
end
20+
121
"""
222
$(SIGNATURES)
323

src/algorithms/time_evolution/apply_mpo.jl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -283,17 +283,6 @@ e.g. Cluster in PEPS with `gate_ax = 1`:
283283
g1 -←-- g2 -←-- g3
284284
↓ ↓ ↓
285285
```
286-
287-
In the cluster, the axes of each tensor use the MPS order
288-
```
289-
PEPS: PEPO:
290-
3 3 4
291-
╱ | ╱
292-
1 -- M -- 5 1 -- M -- 6
293-
╱ | ╱ |
294-
4 2 5 2
295-
M[1 2 3 4; 5] M[1 2 3 4 5; 6]
296-
```
297286
"""
298287
function _apply_gatempo!(
299288
Ms::Vector{T1}, gs::Vector{T2}; gate_ax::Int = 1

src/algorithms/time_evolution/gaugefix_su.jl

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,18 @@ $(TYPEDFIELDS)
1717
maxiter::Int = 100
1818
end
1919

20-
"""
21-
A LocalOperator consisting of identity gates on all nearest neighbor bonds.
22-
"""
2320
function _trivial_gates(elt::Type{<:Number}, lattice::Matrix{S}) where {S <: ElementarySpace}
24-
terms = []
25-
for site1 in CartesianIndices(lattice)
21+
Nr, Nc = size(lattice)
22+
gates = map(Iterators.product(1:2, 1:Nc, 1:Nr)) do (d, c, r)
23+
site1 = CartesianIndex(r, c)
24+
site2 = (d == 1) ? CartesianIndex(r, c + 1) : CartesianIndex(r - 1, c)
2625
r1, c1 = mod1.(Tuple(site1), size(lattice))
27-
for d in (CartesianIndex(1, 0), CartesianIndex(0, 1))
28-
site2 = site1 + d
29-
r2, c2 = mod1.(Tuple(site2), size(lattice))
30-
V1, V2 = lattice[r1, c1], lattice[r2, c2]
31-
h = TensorKit.id(elt, V1 V2)
32-
push!(terms, (site1, site2) => h)
33-
end
26+
r2, c2 = mod1.(Tuple(site2), size(lattice))
27+
V1, V2 = lattice[r1, c1], lattice[r2, c2]
28+
h = TensorKit.id(elt, V1 V2)
29+
return [site1, site2] => h
3430
end
35-
return LocalOperator(lattice, terms...)
31+
return TrotterGates(lattice, vec(gates))
3632
end
3733

3834
"""

0 commit comments

Comments
 (0)