Skip to content

Failure in addition of InifiniteMPOHamiltonian #211

@Gertian

Description

@Gertian

Hi,

I'm playing around with the newest update of MPSKit and it seems that I've been able to make an InfiniteMPOHamiltonian for which the addition fails.
(MPSKit, TensorKit and BlockTensorKit are all on the latest master)

A MWE is :

using TensorKit, MPSKit
#the symmetry group
sym = (U1Irrep  U1Irrep  FermionParity)
#some relevant irreps= sym.(0, 0, 0)
ψ1 = sym.(3, 0, 1)  
ψ2 = sym.(4, 5, 1)  
ψ3 = sym.(5, 4, 1)  
ψ4 = sym.(0, 3, 1)  
ψ = [ψ1, ψ2, ψ3, ψ4]
#physical Hilbert spaces
P1 = Vect[sym](∅ => 1, ψ1 => 1) #the physical space is build from the space spanned by the empty and full site.
P2 = Vect[sym](∅ => 1, ψ2 => 1) #the physical space is build from the space spanned by the empty and full site.
P3 = Vect[sym](∅ => 1, ψ3 => 1) #the physical space is build from the space spanned by the empty and full site.
P4 = Vect[sym](∅ => 1, ψ4 => 1) #the physical space is build from the space spanned by the empty and full site.
P = [P1, P2, P3, P4]

#some more relevant irreps
ψ1hop = sym.(3, 0, 1)
ψ2hop = sym.(4, 5, 1)
ψ3hop = sym.(5, 4, 1)
ψ4hop = sym.(0, 3, 1)
ψhop = [ψ1hop, ψ2hop, ψ3hop, ψ4hop]
#and vector spaces
V1 = Vect[sym](ψ1hop => 1, dual(ψ1hop) => 1) 
V2 = Vect[sym](ψ2hop => 1, dual(ψ2hop) => 1) 
V3 = Vect[sym](ψ3hop => 1, dual(ψ3hop) => 1) 
V4 = Vect[sym](ψ4hop => 1, dual(ψ4hop) => 1)
V = [V1, V2, V3, V4]

#Some operators
function K(ϕ, flavour)
    KL = TensorMap(zeros, ComplexF64, P[flavour]  P[flavour]  V[flavour])
    block(KL, ψ[flavour]) .= exp(-im * ϕ)           
    block(KL, ∅        ) .= exp(+im * ϕ)           

    KR = TensorMap(zeros, ComplexF64, V[flavour]  P[flavour]  P[flavour])
    block(KR, ψ[flavour]) .= 1                            
    block(KR,∅         )  .= 1

    @planar Kres[-1 -2; -3 -4] := KL[-1; -3 3] * KR[3 -2; -4]
    return Kres
end

#a lattice 
lattice = PeriodicArray(repeat([P1, P2, P3, P4] ,4)) 
# ... -- 5,6,7,8 -- 9,10,11,12  -- 21,22,23,24 -- ...
#        |          |              |
# ... -- 1,2,3,4 -- 13,14,15,16 -- 17,18,19,20 -- ...
NNN_pos_links = [ (1,9) , (5,13) ]

#the thing that is not working : 
H = sum(InfiniteMPOHamiltonian(lattice, (i + (flavour - 1),j + (flavour - 1))=>K(0., flavour) for (i, j) in NNN_pos_links ) for flavour = 1:4)

#a simpler example is : 
flavour = 1
H_mini = InfiniteMPOHamiltonian(lattice, (i + (flavour - 1),j + (flavour - 1))=>K(0., flavour) for (i, j) in NNN_pos_links )
H_mini  + H_mini #does not work

#It seems like the problem comes from : 
H_mini.W #works fine 
H_mini.A #does not work and this is called on the line where the addition fails. I have no clue what this is supposed to do though...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions