Skip to content

Commit 5c42bc8

Browse files
committed
Cleanup
1 parent 5a4d6e0 commit 5c42bc8

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

Project.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ authors = ["Maarten Van Damme", "Lukas Devos", "Gertian Roose", "Klaas Gunst"]
44
version = "0.4.0"
55

66
[deps]
7-
BlockTensorKit = "5f87ffc2-9cf1-4a46-8172-465d160bd8cd"
87
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
98
MPSKit = "bb1c41ca-d63c-52ed-829e-0820dda26502"
109
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"

src/MPSKitModels.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module MPSKitModels
22

3-
using TensorKit, MPSKit, BlockTensorKit
3+
using TensorKit, MPSKit
44
using MacroTools: @capture, postwalk
5-
using MPSKit: @plansor, _lastspace, _firstspace
5+
using MPSKit: @plansor
66
using TensorOperations
77
using TupleTools
88

src/lattices/latticepoints.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,7 @@ end
6161
Base.:-(i::Int, j::LatticePoint{1}) = LatticePoint(i .- j, j.lattice)
6262

6363
Base.isless(i::L, j::L) where {L<:LatticePoint} = linearize_index(i) < linearize_index(j)
64-
Base.isfinite(::Union{LatticePoint{N,G}, Type{<:LatticePoint{N,G}}}) where {N,G} = isfinite(G)
64+
function Base.isfinite(::Union{LatticePoint{N,G},Type{<:LatticePoint{N,G}}}) where {N,G}
65+
return isfinite(G)
66+
end
6567
latticetype(::Union{LatticePoint{N,G},Type{<:LatticePoint{N,G}}}) where {N,G} = G

src/models/transfermatrices.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function classical_ising(elt::Type{<:Number}=ComplexF64, ::Type{Trivial}=Trivial
3030

3131
@tensor o[-1 -2; -3 -4] := O[1 2; 3 4] * nt[-1; 1] * nt[-2; 2] * nt[-3; 3] * nt[-4; 4]
3232

33-
return InfiniteMPO(TensorMap(o, ℂ^2 *^2, ℂ^2 *^2))
33+
return InfiniteMPO([TensorMap(o, ℂ^2 *^2, ℂ^2 *^2)])
3434
end
3535

3636
function classical_ising(elt::Type{<:Number}, ::Type{Z2Irrep}; beta=log(1 + sqrt(2)) / 2)
@@ -42,7 +42,7 @@ function classical_ising(elt::Type{<:Number}, ::Type{Z2Irrep}; beta=log(1 + sqrt
4242
block(mpo, Irrep[ℤ₂](0)) .= [2x^2 2x*y; 2x*y 2y^2]
4343
block(mpo, Irrep[ℤ₂](1)) .= [2x*y 2x*y; 2x*y 2x*y]
4444

45-
return InfiniteMPO(mpo)
45+
return InfiniteMPO([mpo])
4646
end
4747

4848
#===========================================================================================
@@ -63,23 +63,23 @@ function sixvertex(elt::Type{<:Number}=ComplexF64, ::Type{Trivial}=Trivial; a=1.
6363
0 c b 0
6464
0 b c 0
6565
0 0 0 a]
66-
return InfiniteMPO(permute(TensorMap(d, ℂ^2 ^2, ℂ^2 ^2), ((1, 2), (4, 3))))
66+
return InfiniteMPO([permute(TensorMap(d, ℂ^2 ^2, ℂ^2 ^2), ((1, 2), (4, 3)))])
6767
end
6868
function sixvertex(elt::Type{<:Number}, ::Type{U1Irrep}; a=1.0, b=1.0, c=1.0)
6969
pspace = U1Space(-1 // 2 => 1, 1 // 2 => 1)
7070
mpo = zeros(elt, pspace pspace, pspace pspace)
71-
blocks(mpo, Irrep[U₁](0)) .= [b c; c b]
71+
block(mpo, Irrep[U₁](0)) .= [b c; c b]
7272
block(mpo, Irrep[U₁](1)) .= reshape([a], (1, 1))
7373
block(mpo, Irrep[U₁](-1)) .= reshape([a], (1, 1))
74-
return InfiniteMPO(permute(mpo, ((1, 2), (4, 3))))
74+
return InfiniteMPO([permute(mpo, ((1, 2), (4, 3)))])
7575
end
7676
function sixvertex(elt::Type{<:Number}, ::Type{CU1Irrep}; a=1.0, b=1.0, c=1.0)
7777
pspace = CU1Space(1 // 2 => 1)
7878
mpo = zeros(elt, pspace pspace, pspace pspace)
7979
block(mpo, Irrep[CU₁](0, 0)) .= reshape([b + c], (1, 1))
8080
block(mpo, Irrep[CU₁](0, 1)) .= reshape([-b + c], (1, 1))
8181
block(mpo, Irrep[CU₁](1, 2)) .= reshape([a], (1, 1))
82-
return InfiniteMPO(permute(mpo, ((1, 2), (4, 3))))
82+
return InfiniteMPO([permute(mpo, ((1, 2), (4, 3)))])
8383
end
8484

8585
#===========================================================================================
@@ -95,7 +95,7 @@ function hard_hexagon(elt::Type{<:Number}=ComplexF64)
9595
P = Vect[FibonacciAnyon]( => 1)
9696
O = ones(elt, P P P P)
9797
block(O, FibonacciAnyon(:I)) .*= 0
98-
return InfiniteMPO(O)
98+
return InfiniteMPO([O])
9999
end
100100

101101
#===========================================================================================
@@ -116,5 +116,5 @@ function qstate_clock(elt::Type{<:Number}=ComplexF64, ::Type{Trivial}=Trivial;
116116
(comega(i - j) + comega(j - k) + comega(k - l) + comega(l - i)))
117117
end
118118

119-
return InfiniteMPO(TensorMap(O, ℂ^q *^q, ℂ^q *^q))
119+
return InfiniteMPO([TensorMap(O, ℂ^q *^q, ℂ^q *^q)])
120120
end

test/sixvertex.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ end
1616

1717
@testset "U₁" begin
1818
mpo = @inferred sixvertex(ComplexF64, U1Irrep)
19-
mpo2 = MPOMultiline([mpo.opp mpo.opp; mpo.opp mpo.opp])
19+
mpo2 = repeat(mpo, 2, 2)
2020
vspaces = [U1Space(0 => 20, 1 => 10, -1 => 10, 2 => 5, -2 => 5),
2121
U1Space(1 // 2 => 15, -1 // 2 => 15, 3 // 2 => 5, -3 // 2 => 5)]
22-
ψ = MPSMultiline(repeat(space.(mpo.opp, 2), 2, 2), [vspaces circshift(vspaces, 1)])
22+
ψ = MultilineMPS(repeat(physicalspace(mpo), 2, 2), [vspaces circshift(vspaces, 1)])
2323
ψ, _ = leading_boundary(ψ, mpo2, alg)
2424
F = prod(expectation_value(ψ, mpo2))
2525
@test abs(F)^(1 / 4) F₀ atol = 1e-2
2626
end
2727

2828
@testset "CU₁" begin
2929
mpo = @inferred sixvertex(ComplexF64, CU1Irrep)
30-
mpo2 = MPOMultiline([mpo.opp mpo.opp; mpo.opp mpo.opp])
30+
mpo2 = repeat(mpo, 2, 2)
3131
vspaces = [CU1Space((0, 0) => 10, (0, 1) => 10, (1, 2) => 5, (2, 2) => 5),
3232
CU1Space((1 // 2, 2) => 15, (3 // 2, 2) => 5)]
33-
ψ = MPSMultiline(repeat(space.(mpo.opp, 2), 2, 2), [vspaces circshift(vspaces, 1)])
33+
ψ = MultilineMPS(repeat(physicalspace(mpo), 2, 2), [vspaces circshift(vspaces, 1)])
3434
ψ, _ = leading_boundary(ψ, mpo2, alg)
3535
F = prod(expectation_value(ψ, mpo2))
3636
@test abs(F)^(1 / 4) F₀ atol = 1e-2

0 commit comments

Comments
 (0)