To simulate an infinite chain, starting with four sites. The first is the Block site, the last the Universe-Block site and the remaining are the added sites, the right one is "added" to the Universe-Block site and the other to the Block site.
The Hilbert space for the single site is 
  
    
      
        
          
            H
          
        
      
    
    
   with the base 
  
    
      
        {
        
          |
        
        S
        ,
        
          S
          
            z
          
        
        ⟩
        }
        ≡
        {
        
          |
        
        1
        ,
        1
        ⟩
        ,
        
          |
        
        1
        ,
        0
        ⟩
        ,
        
          |
        
        1
        ,
        −
        1
        ⟩
        }
      
    
    
  . With this base the spin operators are 
  
    
      
        
          S
          
            x
          
        
      
    
    
  , 
  
    
      
        
          S
          
            y
          
        
      
    
    
   and 
  
    
      
        
          S
          
            z
          
        
      
    
    
   for the single site. For every "block", the two blocks and the two sites, there is its own Hilbert space 
  
    
      
        
          
            
              H
            
          
          
            b
          
        
      
    
    
  , its base 
  
    
      
        {
        
          |
        
        
          w
          
            i
          
        
        ⟩
        }
      
    
    
   (
  
    
      
        i
        :
        1
        …
        dim
        
        (
        
          
            
              H
            
          
          
            b
          
        
        )
      
    
    
  )and its own operators 
  
    
      
        
          O
          
            b
          
        
        :
        
          
            
              H
            
          
          
            b
          
        
        →
        
          
            
              H
            
          
          
            b
          
        
      
    
    
  :
Block: 
  
    
      
        
          
            
              H
            
          
          
            B
          
        
      
    
    
  , 
  
    
      
        {
        
          |
        
        
          u
          
            i
          
        
        ⟩
        }
      
    
    
  , 
  
    
      
        
          H
          
            B
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              x
              
                B
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              y
              
                B
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              z
              
                B
              
            
          
        
      
    
    
  
left-site: 
  
    
      
        
          
            
              H
            
          
          
            l
          
        
      
    
    
  , 
  
    
      
        {
        
          |
        
        
          t
          
            i
          
        
        ⟩
        }
      
    
    
  , 
  
    
      
        
          S
          
            
              x
              
                l
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              y
              
                l
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              z
              
                l
              
            
          
        
      
    
    
  
right-site: 
  
    
      
        
          
            
              H
            
          
          
            r
          
        
      
    
    
  , 
  
    
      
        {
        
          |
        
        
          s
          
            i
          
        
        ⟩
        }
      
    
    
  , 
  
    
      
        
          S
          
            
              x
              
                r
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              y
              
                r
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              z
              
                r
              
            
          
        
      
    
    
  
Universe: 
  
    
      
        
          
            
              H
            
          
          
            U
          
        
      
    
    
  , 
  
    
      
        {
        
          |
        
        
          r
          
            i
          
        
        ⟩
        }
      
    
    
  , 
  
    
      
        
          H
          
            U
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              x
              
                U
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              y
              
                U
              
            
          
        
      
    
    
  , 
  
    
      
        
          S
          
            
              z
              
                U
              
            
          
        
      
    
    
  
At the starting point all four Hilbert spaces are equivalent to 
  
    
      
        
          
            H
          
        
      
    
    
  , all spin operators are equivalent to 
  
    
      
        
          S
          
            x
          
        
      
    
    
  , 
  
    
      
        
          S
          
            y
          
        
      
    
    
   and 
  
    
      
        
          S
          
            z
          
        
      
    
    
   and 
  
    
      
        
          H
          
            B
          
        
        =
        
          H
          
            U
          
        
        =
        0
      
    
    
  . This is always (at every iterations) true only for left and right sites.
The ingredients are the four Block operators and the four Universe-Block operators, which at the first iteration are 
  
    
      
        3
        ×
        3
      
    
    
   matrices, the three left-site spin operators and the three right-site spin operators, which are always 
  
    
      
        3
        ×
        3
      
    
    
   matrices. The Hamiltonian matrix of the superblock (the chain), which at the first iteration has only four sites, is formed by these operators. In the Heisenberg antiferromagnetic S=1 model the Hamiltonian is:
  
    
      
        
          
            H
          
          
            S
            B
          
        
        =
        −
        J
        
          ∑
          
            ⟨
            i
            ,
            j
            ⟩
          
        
        
          
            S
          
          
            
              x
              
                i
              
            
          
        
        
          
            S
          
          
            
              x
              
                j
              
            
          
        
        +
        
          
            S
          
          
            
              y
              
                i
              
            
          
        
        
          
            S
          
          
            
              y
              
                j
              
            
          
        
        +
        
          
            S
          
          
            
              z
              
                i
              
            
          
        
        
          
            S
          
          
            
              z
              
                j
              
            
          
        
      
    
    
  
These operators live in the superblock state space: 
  
    
      
        
          
            
              H
            
          
          
            S
            B
          
        
        =
        
          
            
              H
            
          
          
            B
          
        
        ⊗
        
          
            
              H
            
          
          
            l
          
        
        ⊗
        
          
            
              H
            
          
          
            r
          
        
        ⊗
        
          
            
              H
            
          
          
            U
          
        
      
    
    
  , the base is 
  
    
      
        {
        
          |
        
        f
        ⟩
        =
        
          |
        
        u
        ⟩
        ⊗
        
          |
        
        t
        ⟩
        ⊗
        
          |
        
        s
        ⟩
        ⊗
        
          |
        
        r
        ⟩
        }
      
    
    
  . For example: (convention):
  
    
      
        
          |
        
        1000
        …
        0
        ⟩
        ≡
        
          |
        
        
          f
          
            1
          
        
        ⟩
        =
        
          |
        
        
          u
          
            1
          
        
        ,
        
          t
          
            1
          
        
        ,
        
          s
          
            1
          
        
        ,
        
          r
          
            1
          
        
        ⟩
        ≡
        
          |
        
        100
        ,
        100
        ,
        100
        ,
        100
        ⟩
      
    
    
  
  
    
      
        
          |
        
        0100
        …
        0
        ⟩
        ≡
        
          |
        
        
          f
          
            2
          
        
        ⟩
        =
        
          |
        
        
          u
          
            1
          
        
        ,
        
          t
          
            1
          
        
        ,
        
          s
          
            1
          
        
        ,
        
          r
          
            2
          
        
        ⟩
        ≡
        
          |
        
        100
        ,
        100
        ,
        100
        ,
        010
        ⟩
      
    
    
  
The Hamiltonian in the DMRG form is (we set 
  
    
      
        J
        =
        −
        1
      
    
    
  ):
  
    
      
        
          
            H
          
          
            S
            B
          
        
        =
        
          
            H
          
          
            B
          
        
        +
        
          
            H
          
          
            U
          
        
        +
        
          ∑
          
            ⟨
            i
            ,
            j
            ⟩
          
        
        
          
            S
          
          
            
              x
              
                i
              
            
          
        
        
          
            S
          
          
            
              x
              
                j
              
            
          
        
        +
        
          
            S
          
          
            
              y
              
                i
              
            
          
        
        
          
            S
          
          
            
              y
              
                j
              
            
          
        
        +
        
          
            S
          
          
            
              z
              
                i
              
            
          
        
        
          
            S
          
          
            
              z
              
                j
              
            
          
        
      
    
    
  
The operators are 
  
    
      
        (
        d
        ∗
        3
        ∗
        3
        ∗
        d
        )
        ×
        (
        d
        ∗
        3
        ∗
        3
        ∗
        d
        )
      
    
    
   matrices, 
  
    
      
        d
        =
        dim
        
        (
        
          
            
              H
            
          
          
            B
          
        
        )
        ≡
        dim
        
        (
        
          
            
              H
            
          
          
            U
          
        
        )
      
    
    
  , for example:
  
    
      
        ⟨
        f
        
          |
        
        
          
            H
          
          
            B
          
        
        
          |
        
        
          f
          ′
        
        ⟩
        ≡
        ⟨
        u
        ,
        t
        ,
        s
        ,
        r
        
          |
        
        
          H
          
            B
          
        
        ⊗
        
          I
        
        ⊗
        
          I
        
        ⊗
        
          I
        
        
          |
        
        
          u
          ′
        
        ,
        
          t
          ′
        
        ,
        
          s
          ′
        
        ,
        
          r
          ′
        
        ⟩
      
    
    
  
  
    
      
        
          
            S
          
          
            
              x
              
                B
              
            
          
        
        
          
            S
          
          
            
              x
              
                l
              
            
          
        
        =
        
          S
          
            
              x
              
                B
              
            
          
        
        
          I
        
        ⊗
        
          I
        
        
          S
          
            
              x
              
                l
              
            
          
        
        ⊗
        
          I
        
        
          I
        
        ⊗
        
          I
        
        
          I
        
        =
        
          S
          
            
              x
              
                B
              
            
          
        
        ⊗
        
          S
          
            
              x
              
                l
              
            
          
        
        ⊗
        
          I
        
        ⊗
        
          I
        
      
    
    
  
At this point you must choose the eigenstate of the Hamiltonian for which some observables is calculated, this is the target state . At the beginning you can choose the ground state and use some advanced algorithm to find it, one of these is described in:
The Iterative Calculation of a Few of the Lowest Eigenvalues and Corresponding Eigenvectors of Large Real-Symmetric Matrices, Ernest R. Davidson; Journal of Computational Physics 17, 87-94 (1975)
This step is the most time-consuming part of the algorithm.
If 
  
    
      
        
          |
        
        Ψ
        ⟩
        =
        ∑
        
          Ψ
          
            i
            ,
            j
            ,
            k
            ,
            w
          
        
        
          |
        
        
          u
          
            i
          
        
        ,
        
          t
          
            j
          
        
        ,
        
          s
          
            k
          
        
        ,
        
          r
          
            w
          
        
        ⟩
      
    
    
   is the target state, expectation value of various operators can be measured at this point using 
  
    
      
        
          |
        
        Ψ
        ⟩
      
    
    
  .
Form the reduce density matrix 
  
    
      
        ρ
      
    
    
   for the first two block system, the Block and the left-site. By definition it is the 
  
    
      
        (
        d
        ∗
        3
        )
        ×
        (
        d
        ∗
        3
        )
      
    
    
   matrix: 
  
    
      
        
          ρ
          
            i
            ,
            j
            ;
            
              i
              ′
            
            ,
            
              j
              ′
            
          
        
        ≡
        
          ∑
          
            k
            ,
            w
          
        
        
          Ψ
          
            i
            ,
            j
            ,
            k
            ,
            w
          
        
        
          Ψ
          
            
              i
              ′
            
            ,
            
              j
              ′
            
            ,
            k
            ,
            w
          
        
      
    
    
   Diagonalize 
  
    
      
        ρ
      
    
    
   and form the 
  
    
      
        m
        ×
        (
        d
        ∗
        3
        )
      
    
    
   matrix 
  
    
      
        T
      
    
    
  , which rows are the 
  
    
      
        m
      
    
    
   eigenvectors associated with the 
  
    
      
        m
      
    
    
   largest eigenvalue 
  
    
      
        
          e
          
            α
          
        
      
    
    
   of 
  
    
      
        ρ
      
    
    
  . So 
  
    
      
        T
      
    
    
   is formed by the most significant eigenstates of the reduce density matrix. You choose 
  
    
      
        m
      
    
    
   looking to the parameter 
  
    
      
        
          P
          
            m
          
        
        ≡
        
          ∑
          
            α
            =
            1
          
          
            m
          
        
        
          e
          
            α
          
        
      
    
    
  : 
  
    
      
        1
        −
        
          P
          
            m
          
        
        ≅
        0
      
    
    
  .
Step 4: New, Block and Universe Block, operators
Form the 
  
    
      
        (
        d
        ∗
        3
        )
        ×
        (
        d
        ∗
        3
        )
      
    
    
   matrix representation of operators for the system composite of Block and left-site, and for the system composite of right-site and Universe-Block, for example: 
  
    
      
        
          H
          
            B
            −
            l
          
        
        =
        
          H
          
            B
          
        
        ⊗
        
          I
        
        +
        
          S
          
            
              x
              
                B
              
            
          
        
        ⊗
        
          S
          
            
              x
              
                l
              
            
          
        
        +
        
          S
          
            
              y
              
                B
              
            
          
        
        ⊗
        
          S
          
            
              y
              
                l
              
            
          
        
        +
        
          S
          
            
              z
              
                B
              
            
          
        
        ⊗
        
          S
          
            
              z
              
                l
              
            
          
        
      
    
    
  
  
    
      
        
          S
          
            
              x
              
                B
                −
                l
              
            
          
        
        =
        
          I
        
        ⊗
        
          S
          
            
              x
              
                l
              
            
          
        
      
    
    
  
  
    
      
        
          H
          
            r
            −
            U
          
        
        =
        
          I
        
        ⊗
        
          H
          
            U
          
        
        +
        
          S
          
            
              x
              
                r
              
            
          
        
        ⊗
        
          S
          
            
              x
              
                U
              
            
          
        
        +
        
          S
          
            
              y
              
                r
              
            
          
        
        ⊗
        
          S
          
            
              y
              
                U
              
            
          
        
        +
        
          S
          
            
              z
              
                r
              
            
          
        
        ⊗
        
          S
          
            
              z
              
                U
              
            
          
        
      
    
    
  
  
    
      
        
          S
          
            
              x
              
                r
                −
                U
              
            
          
        
        =
        
          S
          
            
              x
              
                r
              
            
          
        
        ⊗
        
          I
        
      
    
    
  
Now, form the 
  
    
      
        m
        ×
        m
      
    
    
   matrix representations of the new Block and Universe-Block operators, form a new block by changing basis with the transformation 
  
    
      
        T
      
    
    
  , for example:
  
    
      
        
          
            
              
              
                
                  H
                  
                    B
                  
                
                =
                T
                
                  H
                  
                    B
                    −
                    l
                  
                
                
                  T
                  
                    †
                  
                
              
              
                
                  S
                  
                    
                      x
                      
                        B
                      
                    
                  
                
                =
                T
                
                  S
                  
                    
                      x
                      
                        B
                        −
                        l
                      
                    
                  
                
                
                  T
                  
                    †
                  
                
              
            
          
        
      
    
    
  At this point the iteration is ended and the algorithm goes back to step 1. The algorithm stops successfully when the observable converges to some value.