The Density Matrix Renormalization Group (DMRG) method

The block decimation idea

Let us try a simple idea, using the recursion scheme described above. At every step in the recursion, we add one spin on the right, and our basis dimension grows by a factor $2$. At some point during this recursion, the matrix will be too large to deal with. So let us fix a maximum number of states that we want to keep, $m$. At certain point during the process, the basis dimension will become larger than $m$. It is here that we start applying the truncation rule: diagonalize the Hamiltonian matrix exactly, and keep only the $m$ states with *lowest* eigenvalues(see Fig. [fig:nrg]).

As the system grows, the basis of the left block changes as we rotate to the new basis of eigenstates of the Hamiltonian. This is done by using a unitary transformation $U$. This matrix $U$ is nothing else but the matrix with the eigenstates ordered in columns. Therefore, adding a spin to the block now involves two steps: (i) we need to build the ‘tilde’ operators as before, and (ii) rotate the Hamiltonian matrix and the tilde operators to the new basis.

Let us assume that our old block before adding a site has a basis $\{|\alpha_{i-1}\rangle\}$, of dimension $D_{i-1}$, and the site has a basis $\{|s_{i}\rangle\}$ of dimension $d$. The new block basis $\{|\alpha_{i-1},s_{i}\rangle\}$ has dimension $d\times D_{i-1}$, such that we can easily diagonalize it to obtain all the eigenvalues and corresponding eigenvectors $\{|\alpha_{i+1}\rangle\}$. We build the matrix $U$ as the $D_{i-1} \times D_{i}$ unitary matrix with the $D_{i}=m$ eigenvectors with largest eigenvalues in the columns: $$U_{\alpha_{i-1}s_i,\alpha_i} = \langle \alpha_{i-1}s_i|\alpha_i\rangle.$$ Before the rotation, the operators had matrix elements: $$\tilde{O}_{\alpha_{i-1}s_i,\alpha'_{i-1}s'_i} = \langle \alpha_{i-1}s_i |\hat{O}|\alpha'_{i-1}s'_i\rangle.$$ We can now rotate all the tilde operators to the new basis as: $$\begin{aligned} \tilde{O}_{\alpha_i,\alpha'_i} & = & \langle \alpha_i |\hat{O}|\alpha'_i\rangle = \sum_{\alpha_{i-1},s_i} \sum_{\alpha'_{i-1}s'_i} \langle \alpha_i|\alpha_{i-1}s\rangle\langle \alpha_{i-1} s_i|\hat{O}|\alpha'_{i-1}s'_i\rangle\langle \alpha'_{i-1}s'|\alpha_i\rangle \nonumber \\ & = & \sum_{\alpha_{i-1},s_i} \sum_{\alpha'_{i-1}s'_i} (U^\dagger)_{\alpha_i,\alpha_{i-1}s_i} \tilde{O}_{\alpha_i \alpha'_i} U_{\alpha'_{i-1}s'_i,\alpha'_i}\end{aligned}$$ where the new matrices will have dimensions $m \times m$. we can now use these matrices to continue to block-growing process by adding another site. This can be repeated until the energy per site converges, or until we reach a desired system size.

It may seem that this new basis would be a natural choice is we assume that the physics of the problem is described by different manifolds with different energy scales. If we keep the lowest energy states and we get rid of the high energy states we can expect to get the low energy physics right. This in fact is the case in problems such as the Kondo and Anderson impurity problems@hewson. However, in strongly correlated, many-body problems such as the Heisenberg chain, this scheme performs poorly.

The density matrix truncation: the kernel of the DMRG

The problem was solved by Steve White by using what he called the ‘density matrix truncation’. He realized (without knowing at the time) that instead of getting rid of high energy states, one has to redistribute the ‘entanglement’ and minimize the loss of information. However, the way he formulated the problem did not incorporate the idea of entanglement, a concept that entered the picture much later after quantum information ideas were used to understand why and when the DMRG actually works. Before introducing these ideas, we shall describe the original formulation of the density matrix truncation@dmrg.

In order to introduce this new concept, we are going to use a new scheme: We are going to use two blocks instead of one, a left block, and a right block, as shown in Fig.[fig:two_blocks]. We are going to grow both blocks simultaneously using the same procedure outlined previously: at every step we add one site at the right of the left block, and one site to the left of the right block. The ground state can then be written as: $$|\Psi\rangle = \sum_{i,j} \Psi_{ij} |i\rangle |j\rangle, $$ where the sum runs over all the states of the left block $|i\rangle$ and right block $|j\rangle$, with the corresponding coefficients $\Psi_{ij}$.

Now the idea is as follows: once we reach the desired basis dimension $m$, we shall rotate the left block to a new basis $|i\rangle \rightarrow |\alpha\rangle$. We want to pick these states $|\alpha\rangle$ in such a way that when we truncate the basis, the “distance” between the original ground state $|\Psi\rangle$, and the new, truncated, variational approximation $|\tilde{\Psi}\rangle$, is minimized: $$S=\left||\Psi\rangle - |\tilde{\Psi}\rangle \right|^2,$$ where $$|\tilde{\Psi} \rangle = \sum_{\alpha=1}^m\sum_{j} \Psi_{\alpha j} |\alpha\rangle|j\rangle.$$

We are going to anticipate the solution: pick the basis $|\alpha\rangle$ given by the $m$ eigenvectors of the reduced density matrix of the left block with the $m$ largest eigenvalues. In order to justify this result, we first need to introduce some important concepts.

The reduced density matrix

Imagine that we have a bipartite system, composed by subsystem $A$ and subsystem $B$, as shown in Fig.[fig:partition]. The Hilbert space of the system $A+B$ will be given by the tensor product of the Hilbert spaces of the two subsystems: $H_{A+B}=H_A \otimes H_B$, and will have dimension $D_{A+B} = D_A\times D_B$. Assume that the state of our system is described by a normalized wave-function $|\Psi\rangle$ that has support on $H_{A+B}$. We define the reduced density matrix of subsystem $A$ as $$\hat{\rho}_A = \mathrm{Tr}_B |\Psi\rangle\langle\Psi|.$$ Its corresponding matrix form is $${\rho_A}_{ii'} = \langle i|\hat{\rho}_A|i'\rangle = \sum_j \langle ij|\Psi\rangle\langle \Psi|i'j\rangle = \sum_{j} \Psi_{ij}\Psi^*_{i'j}$$ This operator describes the density matrix of a mixed state, in which the system $A$ is in contact with a bath or environment $B$. This is the price we have to pay for our ignorance of subsystem $B$.

The reduced density matrix has some nice properties:

  • It is Hermitian (or symmetric in case of real matrices). This means that its eigenvalues are real.

  • Its eigenvalues are non-negative.

  • The trace equals to unity: $\mathrm{Tr \rho_A} = 1$.

  • Its eigenvectors $|\alpha\rangle$ and eigenvalues $\omega_\alpha$ form an orthonormal basis.

This means that the reduced density matrix can be re-defined in the new eigenvector basis as: $$\hat{\rho}_A = \sum_\alpha \omega_\alpha |\alpha\rangle\langle\alpha|;$$ with $\omega_\alpha \ge 0$ and $\sum_\alpha {\omega_\alpha} = 1$.

These same considerations are valid for the block $B$.

The Singular Value decomposition (SVD)

Consider an arbitrary matrix $\Psi$ of dimensions $D_A \times D_B$. One can prove that $\Psi$ can de factorized as $$\Psi = UDV^{\dagger},$$ where $U$ is a ($D_A \times D_B$) unitary matrix, $V$ is a $(D_B \times D_B)$ unitary matrix, and $D$ is a $(D_B \times D_B$ diagonal matrix with real non-negative numbers along the diagonal, and zeroes elsewhere. Since $U$ and $V$ are unitary, they satisfy: $$\begin{aligned} UU^\dagger = {1}; \nonumber \\ VV^\dagger = {1}. \nonumber \end{aligned}$$ Their columns are orthonormal vectors, so $U$ and $V$ can be regarded as rotation matrices. The diagonal matrix elements $\lambda_\alpha$ of $D$ are known as the “singular values” of $\Psi$.

The Schmidt decomposition

Let us apply the SVD to our quantum wave-function $|\Psi\rangle$ ([psi]), and for illustration, let us assume that $D_B \le D_A$. The coefficients $\Psi_{ij}$ define a matrix $\Psi$. After a SVD, they can be re-written as: $$\Psi_{ij} = \sum_\alpha^{D_B} U_{i\alpha}\lambda_\alpha(V^{\dagger})_{\alpha j} = \sum_\alpha^{D_B} U_{i\alpha}\lambda_\alpha V^{*}_{\alpha j}.$$ The wave-function can now be expressed as: $$\begin{aligned} |\Psi\rangle & = & \sum_{i}^{D_A} \sum_{j}^{D_B} \sum_\alpha^{D_B} U_{i\alpha}\lambda_\alpha V^*_{\alpha j}|i\rangle|j\rangle \nonumber \\ & = & \sum_\alpha^{D_B} \left(\sum_i^{D_A} U_{i\alpha}|i\rangle\right)\lambda_\alpha\left(\sum_j^{D_B} V^*_{\alpha j}|j\rangle\right) \nonumber \\ & = & \sum_\alpha^{D_B} \lambda_\alpha |\alpha\rangle_A|\alpha\rangle_B, \nonumber \end{aligned}$$ where we have defined the states $|\alpha\rangle_A = \sum_i U_{i\alpha}|i\rangle$ and $|\alpha\rangle_B = \sum_j V^*_{\alpha j}|j\rangle$. Due to the properties of $U$ and $V$, these states define a new orthogonal basis. This final expression is known as the “Schmidt decomposition” of the state $\Psi$, and the bases ${|\alpha\rangle}$ as the “Schmidt bases”..

In general, we have that the state $\Psi$ can be written in the new basis as: $$|\Psi\rangle = \sum_{\alpha}^r \lambda_\alpha |\alpha\rangle_A |\alpha\rangle_B; \,\,\, r=\mathrm{min}(D_A,D_B).$$

In the Schmidt basis, the reduced density matrices for the subsystems $A$ and $B$ are $$\rho_A = \mathrm{Tr}|\Psi\rangle\langle\Psi| = \sum_\alpha \lambda_\alpha^2|\alpha\rangle_{A}\ _A\langle \alpha|,$$ and $$\rho_B = \sum_\alpha \lambda_\alpha^2|\alpha\rangle_{B}\ _B\langle \alpha|$$

At this point, we realize some interesting observations:

  • The eigenvalues of the reduced density matrices are $\omega_\alpha = \lambda_\alpha^2$, the square of the singular values.

  • The two reduced density matrices share the spectrum.

  • The Schmidt bases are the eigenvectors of the reduced density matrices.

Optimizing the truncated wave-function

We here go back to the original problem of optimizing the wave-function in a reduced basis. In order to solve it, we are going to reformulate the question as: Given a matrix $\Psi$, what is the optimal matrix $\tilde{\Psi}$ with fixed rank $m$ that minimizes the Frobenius distance between the two matrices? It turns out, this is a well known problem called the “low ranking approximation”.

If we order the eigenvalues of the reduced density matrix in decreasing order $\omega_1,\omega_2,...\omega_m,...\omega_r$, it is straightforward to see that the Frobenius distance between the two matrices is given by $$S=\left|\Psi - \tilde{\Psi}\right|^2 = \sum_{m+1}^r \omega_i $$ This proves that the optimal basis is given by the eigenvectors of the reduced density matrix with the $m$ largest eigenvalues.

Infinite-size DMRG

The above considerations allow us now to introduce the DMRG algorithm in a very natural way. We are going to present it in the traditional formulation, starting with the infinite-size algorithm, followed by the finite-size scheme.

The main idea behind the infinite-size algorithm consists in growing the left and right blocks by adding one site at a time. As we add sites, the basis of the blocks will grow, until we reach the desired maximum number of states $m$. At this point we need to start applying the density matrix truncation on both blocks. This process is repeated until we reach a desired system-size, or the error in the energy is below a pre-defined tolerance.

[fig:infinite]

The algorithm illustrated in Fig.[fig:infinite] could be outlined as below:

  • Build all the operator matrices for a single-site Hamiltonian, and the operators involved in the interactions between the site an the rest of the system.
  • Start growing the blocks by adding single-sites, as outlined in the exact diagonalization section. We assume that the Hilbert space for the single site has dimension $d$. When the size of the bocks become larger than $d \times m$, we start applying the density matrix truncation as follows:

    1. Using a suitable library routine (Lanczos,Davidson), diagonalize the full Hamiltonian (sometimes called super-Hamiltonian) of the two blocks combined (sometimes refereed to as superblock), to obtain the ground state $$|\Psi\rangle = \sum_{ij}\Psi_{ij}|i\rangle|j\rangle$$.
    2. Calculate the reduced density matrix of the left block, and right blocks. When the system is symmetric under reflections, we only need one of them.
    3. For each of the blocks, diagonalize the density matrix to obtain the full spectrum and eigenvectors.
    4. Truncate the basis by keeping only the $m$ eigenvectors with the largest eigenvalues.
    5. Rotate the Hamiltonian and the operators involved in the interactions between blocks to the new basis.
    6. Add a new site to the left and right blocks, to build new blocks of dimension $d \times m$, and reiterate the diagonalization and truncation steps. Stop when we reach the desired system-size, or the error in the energy is below a pre-defined tolerance.

In the early days of DMRG it was assumed that this scheme would lead to a good approximation of the system properties in the thermodynamic limit. Today we know that he best way to reach the thermodynamic limit is by using the finite-size algorithm on systems of fixed length, and doing a careful finite-size analysis of the results.

Let us now explain some of these steps in more detail.

Adding a single site to the block

[fig:add_site]

Same as we did in the exact diagonalization section, we can add sites to the blocks by performing tensor products of the “tilde” operators on the block, and single-site operators.

Assume that we are in the $i^\mathrm{th}$ iteration of the algorithm, with our left and right blocks having length $i$. Let us label our $D_L$ basis states for the left block $\{|\alpha_{i}\rangle \}$, and our $d$ basis states for the single site that comes to the right $\{|s_{i+1}\rangle \}$ (See Fig.[fig:add_site]). When we add the site to the block, we obtain a new basis for the new combined block as $|\alpha_{i+1}\rangle = |\alpha_i\rangle \otimes |s_{i+1}\rangle$.

Let us assume for illustration purposes that we are dealing once more with the Heisenberg chain. All these ideas can be easily generalized to arbitrary models. Same as we did in the exact diagonalization section, we obtain the new Hamiltonian matrix for the combined block as: $$H_{L,i+1} = H_{L,i} \otimes {1}_2 + \tilde{S}^z_{L,i} \otimes S^z + \frac{1}{2} \left( \tilde{S}^+_{L,i} \otimes S^- + \tilde{S}^-_{L,i} \otimes S^+ \right).$$ In this expression, the “tilde” operators are in the $|\alpha_i\rangle$ basis, while the others are defined in the single-site basis.

A similar expression applies to the right block, which is obtained from the single site at position $i+2$, with basis $\{|s_{i+2}\rangle\}$ and dimension $d$, and the right block with basis $\{|\beta_{i+3}\rangle\}$ and dimension $D_R$: $$H_{R,i+2} = {1}_2 \otimes H_{R,i+3} + S^z \otimes \tilde{S}^z_{R,i+3} + \frac{1}{2} \left( {S^+} \otimes \tilde{S}^-_{R,i+3} + {S^-} \otimes \tilde{S}^+_{R,i+3} \right).$$

Building the super-Hamiltonian

We now need to combine the left and right blocks to form the super-Hamiltonian: $$\hat{H}=\hat{H}_{L,i+1}+\hat{H}_{R,i+2} + S^z_{i+1} S^z_{i+2} + \frac{1}{2}\left( S^+_{i+1}S^-_{i+2} + S^-_{i+1}S^+_{i+2} \right)$$ where $\hat{H}_{L(R)}$ where obtained above, and only involve terms in the left (right) block. The single sites at positions $i+1$ and $i+2$ were absorbed by the left and right blocks, respectively, so in order to build the interactions, we have to rotate the corresponding operators to the new basis of the blocks. This is again done in the same spirit of the “tilde” transformation: $$\begin{aligned} H & = & H_{L,i+1} \otimes {1}_{D_R\times2} + {1}_{D_L \times 2} \otimes H_{R,i+2} \nonumber \\ & + & {1}_{D_L} \otimes S^z \otimes S^z \otimes {1}_{D_R} \nonumber \\ & + & \frac{1}{2} {1}_{D_L} \otimes S^+ \otimes S^- \otimes {1}_{D_R} \nonumber \\ & + & \frac{1}{2} {1}_{D_L} \otimes S^- \otimes S^+ \otimes {1}_{D_R} \nonumber\end{aligned}$$ or: $$\begin{aligned} H & = & H_{L,i+1} \otimes {1}_{D_R\times2} + {1}_{D_L \times 2} \otimes H_{R,i+2} \nonumber \\ & + & \tilde{S}^z_{L,i+1} \otimes \tilde{S}^z_{R,i+2} \nonumber \\ & + & \frac{1}{2} \tilde{S}^+_{L,i+1} \otimes \tilde{S}^-_{R,i+2} \nonumber \\ & + & \frac{1}{2} \tilde{S}^-_{L,i+1} \otimes \tilde{S}^+_{R,i+2} \nonumber \end{aligned}$$

Density matrix truncation and the rotation to the new basis

The truncation process is similar to the one use in numerical renormalization group, but instead of using the matrix of eigenvectors of the Hamiltonian, we use the eigenvectors $\{|\alpha\rangle\},\{|\beta\rangle\}$ of the left and right reduced density matrix. Therefore, the new basis states for the left and right block are related to the states in the previous step as: $$\begin{aligned} |\alpha_{i+1}\rangle & = & \sum_{s_{i+1},\alpha_i}\langle \alpha_i s_{i+1}|\alpha_{i+1} \rangle |\alpha_i s_{i+1} \rangle = \sum_{s_{i+1},\alpha_i} (U_L)_{\alpha_i s_{i+1},\alpha_{i+1}} | \alpha_i s_{i+1} \rangle \nonumber \\ |\beta_{i+2}\rangle & = & \sum_{s_{i+2},\beta_{i+3}}\langle s_{i+2} \beta_{i+3}|\beta_{i+2} \rangle |s_{i+2} \beta_{i+3} \rangle = \sum_{s_{i+2},\beta_{i+3}} (U_R)_{s_{i+2} \beta_{i+3},\beta_{i+2}} | s_{i+2} \beta_{i+3} \rangle\end{aligned}$$ where $$(U_L)_{\alpha_i s_{i+1},\alpha_{i+1}} = \langle \alpha_i s_{i+1}|\alpha_{i+1} \rangle$$ and $$(U_R)_{s_{i+2} \beta_{i+3},\beta_{i+2}} = \langle s_{i+2} \beta_{i+3}|\beta_{i+2} \rangle.$$ If we keep only $m$ states, the matrices $U_{L(R)}$ will have dimensions $D_{L(R)} d\times m$. If the basis had already been truncated in the previous step, then $D_L(R)=m$.

We can now use these transformations to obtain the matrix elements for all the operators in the new truncated basis. For instance, an operator acting on a site inside the left block will be transformed as: $$\begin{aligned} (\tilde{O}_{L,i+1})_{\alpha_{i+1},\alpha'_{i+1}} & = & \langle \alpha_{i+1} |\hat{O}|\alpha'_{i+1}\rangle \nonumber \\ & = & \sum_{\alpha_i,s_{i+1}} \sum_{\alpha'_i,s'_{i+1}} \langle \alpha_{i+1}|\alpha_i s_{i+1}\rangle\langle \alpha_i s_{i+1}|\hat{O}|\alpha'_i s'_{i+1}\rangle\langle \alpha'_i s'_{i+1}|\alpha'_{i+1}\rangle \nonumber \\ & = & \sum_{\alpha_i s_{i+1}}\sum_{\alpha'_i s'_{i+1}} (U_L^\dagger)_{\alpha_{i+1},\alpha_is_{i+1}} (\tilde{O_{L,i}})_{\alpha_i s_{i+1},\alpha'_i s'_{i+1}} (U_L)_{\alpha'_is'_{i+1},\alpha'_{i+1}},\end{aligned}$$ and a similar expression can be obtained for operators in the right block.

The Finite-size DMRG

[fig:finite]

As we mentioned before, the proper way to reach the thermodynamic limit with DMRG is by studying finite systems and performing a finite-size analysis. In order to study finite system, a generalization of the above ideas needs to be applied. The finite-size DMRG (illustrated in Fig.[fig:finite]) can be summarized as follows:

  • Run the infinite-size algorithm until the desired system size is reached. During this process, store all the left and right blocks, with their corresponding operators and basis transformations. This step is typically referred to as the ``warmup''.
  • Once the desired system size is reached we start performing ``DMRG sweeps'', from right-to-left, and left-to-right to optimize the bases and improve accuracy. A left-to-right sweep is described as follows:

    1. Add a site to the left block using the same idea of the infinite-size DMRG. Since the total size of the system needs to be kept fixed, we need to ``shrink'' the right block. This is done by using the smaller right block from the infinite-size step, or from the previous right-to-left sweep.
    2. Using a suitable library routine (Lanczos,Davidson), diagonalize the super Hamiltonian (sometimes called super-Hamiltonian) of the two blocks combined, same as for the infinite-size DMRG.
    3. Calculate the reduced density matrix of the left block.
    4. Diagonalize the density matrix to obtain the full spectrum and eigenvectors.
    5. Truncate the basis by keeping only the $m$ eigenvectors with the largest eigenvalues.
    6. Rotate the Hamiltonian and the operators of the left block involved in the interactions between blocks to the new basis.
    7. Iterate until reaching the far right end of the system, with a right block containing a single site. This completes the left-to-right sweep.
  • Perform a right-to-left sweep, by growing the right block one site at a time, and using the left block from the previous left-to-right sweep.

  • Re-iterate the sweeping. Stop when the change in the energy is below a pre-defined tolerance. One typically stops at a point when both blocks have the same size, the ``symmetric configuration''.

This sweeping process works in a similar fashion as a self-consistent loop, where we iteratively improve the solution. In fact, the DMRG can be formulated as a variational method, in which the variational parameters are continuously improved to minimize an energy functional. Intuitively a way to see it is by imagining a “demon” probing the environment around the block for the optimal states to improve the basis to represent the ground-state. These states are “absorbed” inside the block by the density matrix and its eigenvectors.

As described above, the shrinking block is replaced by the block from the previous sweep in the opposite direction. This means that all the information about the block and its operators needs to be stored, either in memory, or dumped on disk or stored in memory.


In [10]:
def psi_dot_psi(psi1, psi2):
    x = 0.
    for i in range(psi1.shape[0]):
        for j in range(psi2.shape[1]):
            x += psi1[i,j]*psi2[i,j]
    return x
            
def lanczos(m, seed, maxiter, tol, use_seed = False, force_maxiter = False):
    x1 = seed
    x2 = seed
    gs = seed
    a = np.zeros(100)
    b = np.zeros(100)
    z = np.zeros((100,100))
    lvectors = []
    control_max = maxiter;
    e0 = 9999

    if(maxiter == -1):
        force_maxiter = False

    if(control_max == 0):
        gs = 1
        maxiter = 1
        return(e0,gs)
    
    x1[:,:] = 0
    x2[:,:] = 0
    gs[:,:] = 0
    a[:] = 0.0
    b[:] = 0.0
    if(use_seed):
        x1 = seed
    else:
        for i in range(x1.shape[0]):
            for j in range(x1.shape[1]):
                x1[i,j] = (2*np.random.random()-1.)

#    x1[:,:] = 1
    b[0] = psi_dot_psi(x1,x1)
    b[0] = np.sqrt(b[0])
    x1 = x1 / b[0]
    x2[:] = 0
    b[0] = 1.

    e0 = 9999
    nmax = min(99, maxiter)

    for iter in range(1,nmax+1):
        eini = e0
        if(b[iter - 1] != 0.):
            aux = x1
            x1 = -b[iter-1] * x2
            x2 = aux / b[iter-1]

        aux = m.product(x2)

        x1 = x1 + aux
        a[iter] = psi_dot_psi(x1,x2)
        x1 = x1 - x2*a[iter]

        b[iter] = psi_dot_psi(x1,x1)
        b[iter] = np.sqrt(b[iter])
        lvectors.append(x2)                                                  
#        print "Iter =",iter,a[iter],b[iter]
        z.resize((iter,iter))
        z[:,:] = 0
        for i in range(0,iter-1):
            z[i,i+1] = b[i+1]
            z[i+1,i] = b[i+1]
            z[i,i] = a[i+1]
        z[iter-1,iter-1]=a[iter]
        d, v = np.linalg.eig(z)

        col = 0
        n = 0
        e0 = 9999
        for e in d:
            if(e < e0):
                e0 = e
                col = n
            n+=1
        e0 = d[col]
        
       
        print "Iter = ",iter," Ener = ",e0
        if((force_maxiter and iter >= control_max) or (iter >= gs.shape[0]*gs.shape[1] or iter == 99 or abs(b[iter]) < tol) or \
            ((not force_maxiter) and abs(eini-e0) <= tol)):
            # converged
            gs[:,:] = 0.
            for n in range(0,iter):
                gs += v[n,col]*lvectors[n]

            print "E0 = ", e0
            maxiter = iter
            return(e0,gs) # We return with ground states energy

    return(e0,gs)

In [15]:
import numpy as np

class Position:
    LEFT, RIGHT = range(2)

class DMRGSystem(object): 

    def __init__(self, _nsites):

        #Single site operators
        self.nsites = _nsites
        self.nstates = 2
        self.dim_l = 0      # dimension of the left block
        self.dim_r = 0      # dimension of the right block
        self.left_size = 0  # number of sites in the left block
        self.right_size = 0 # number of sites in the right block

        self.sz0 = np.zeros(shape=(2,2)) # single site Sz
        self.splus0 = np.zeros(shape=(2,2)) # single site S+
        self.sz0[0,0]         = -0.5
        self.sz0[1,1]         =  0.5
        self.splus0[1,0]      =  1.0

        #Useful structures to store the matrices

        self.HL = []     # left block Hamiltonian
        self.HR = []     # right block Hamiltonian
        self.szL = []    # left block Sz
        self.szR = []    # right block Sz
        self.splusL = [] # left block S+
        self.splusR = [] # right block S+

        zero_matrix = np.zeros(shape=(2,2))
        for i in range(nsites):
            self.HL.append(zero_matrix)
            self.HR.append(zero_matrix)
            self.szL.append(self.sz0)
            self.szR.append(self.sz0)
            self.splusL.append(self.splus0)
            self.splusR.append(self.splus0)

        self.psi = np.zeros(shape=(2,2)) # g.s. wave function
        self.rho = np.zeros(shape=(2,2)) # density matrix

        self.energy = 0.
        self.error = 0.

#######################################


    def BuildBlockLeft(self, iter):
        self.left_size = iter
        self.dim_l = self.HL[self.left_size-1].shape[0]
        I_left = np.eye(self.dim_l)
        I2 = np.eye(2)
        # enlarge left block:
        self.HL[self.left_size] = np.kron(self.HL[self.left_size-1],I2) + \
                         np.kron(self.szL[self.left_size-1],self.sz0) + \
                         0.5*np.kron(self.splusL[self.left_size-1],self.splus0.transpose()) + \
                         0.5*np.kron(self.splusL[self.left_size-1].transpose(),self.splus0)
        self.splusL[self.left_size] = np.kron(I_left,self.splus0)
        self.szL[self.left_size] = np.kron(I_left,self.sz0)

    def BuildBlockRight(self, iter):
        self.right_size = iter
        self.dim_r = self.HR[self.right_size-1].shape[0]
        I_right= np.eye(self.dim_r)
        I2 = np.eye(2)
        # enlarge right block:
        self.HR[self.right_size] = np.kron(I2,self.HR[self.right_size-1]) + \
                         np.kron(self.sz0,self.szR[self.right_size-1]) + \
                         0.5* np.kron(self.splus0.transpose(),self.splusR[self.right_size-1]) + \
                         0.5* np.kron(self.splus0,self.splusR[self.right_size-1].transpose())
        self.splusR[self.right_size] = np.kron(self.splus0,I_right)
        self.szR[self.right_size] = np.kron(self.sz0,I_right)

    
    def GroundState(self):
        self.dim_l = self.HL[self.left_size].shape[0]
        self.dim_r = self.HR[self.right_size].shape[0]
        self.psi.resize((self.dim_l,self.dim_r))
        maxiter = self.dim_l*self.dim_r
        (self.energy, self.psi) = lanczos(self, self.psi, maxiter, 1.e-7)


    def DensityMatrix(self, position):
        # Calculate density matrix
        if(position == Position.LEFT):
            self.rho = np.dot(self.psi,self.psi.transpose())
        else: 
            self.rho = np.dot(self.psi.transpose(),self.psi)

               
    def Truncate(self, position, m):
        # diagonalize rho
        rho_eig, rho_evec = np.linalg.eigh(self.rho)
        self.nstates = m
        rho_evec = np.real(rho_evec)
        rho_eig = np.real(rho_eig)

        # calculate the truncation error for a given number of states m
        # Reorder eigenvectors and trucate
        index = np.argsort(rho_eig)
        for e in index:
            print "RHO EIGENVALUE ", rho_eig[e]
        error = 0.
        if (m < rho_eig.shape[0]):
            for i in range(index.shape[0]-m):
                error += rho_eig[index[i]]
        print "Truncation error = ", error

        aux = np.copy(rho_evec)
        if (self.rho.shape[0] > m):
            aux.resize((aux.shape[0],m))
            n = 0
            for i in range(index.shape[0]-1,index.shape[0]-1-m,-1):
                aux[:,n]=rho_evec[:,index[i]]
                n += 1
        rho_evec = aux       

#        rho_evec = np.eye(self.rho.shape[0])

        # perform transformation:
        U = rho_evec.transpose()
        if(position == Position.LEFT):
            aux2 = np.dot(self.HL[self.left_size],rho_evec)
            self.HL[self.left_size] = np.dot(U,aux2)
            aux2 = np.dot(self.splusL[self.left_size],rho_evec)
            self.splusL[self.left_size] = np.dot(U,aux2)
            aux2 = np.dot(self.szL[self.left_size],rho_evec)
            self.szL[self.left_size] = np.dot(U,aux2)
        else:
            aux2 = np.dot(self.HR[self.right_size],rho_evec)
            self.HR[self.right_size] = np.dot(U,aux2)
            aux2 = np.dot(self.splusR[self.right_size],rho_evec)
            self.splusR[self.right_size] = np.dot(U,aux2)
            aux2 = np.dot(self.szR[self.right_size],rho_evec)
            self.szR[self.right_size] = np.dot(U,aux2)
               
    def product(self, psi):
        npsi = np.dot(self.HL[self.left_size],psi)
        npsi += np.dot(psi,self.HR[self.right_size].transpose())

        # Sz.Sz
        tmat = np.dot(psi,self.szR[self.right_size].transpose())
        npsi += np.dot(self.szL[self.left_size],tmat)
        # S+.S-
        tmat = np.dot(psi,self.splusR[self.right_size])*0.5
        npsi += np.dot(self.splusL[self.left_size],tmat)
        # S-.S+
        tmat = np.dot(psi,self.splusR[self.right_size].transpose())*0.5
        npsi += np.dot(self.splusL[self.left_size].transpose(),tmat)

        return npsi

In [16]:
nsites = 10
n_states_to_keep = 10
n_sweeps = 4
S = DMRGSystem(nsites)
###############################################################################
for iter in range(1,nsites/2): # do infinite size dmrg for warmup
    print "WARMUP ITERATION ", iter, S.dim_l, S.dim_r
    # Create HL and HR by adding the single sites to the two blocks
    S.BuildBlockLeft(iter)
    S.BuildBlockRight(iter)
    # find smallest eigenvalue and eigenvector
    S.GroundState()
    # Calculate density matrix
    S.DensityMatrix(Position.LEFT)
    # Truncate
    S.Truncate(Position.LEFT,n_states_to_keep)
    # Reflect
    S.DensityMatrix(Position.RIGHT)
    S.Truncate(Position.RIGHT,n_states_to_keep)
    
first_iter = nsites/2
for sweep in range(1,n_sweeps):
    for iter in range(first_iter, nsites-3):
        print "LEFT-TO-RIGHT ITERATION ", iter, S.dim_l, S.dim_r
        # Create HL and HR by adding the single sites to the two blocks
        S.BuildBlockLeft(iter)
        S.BuildBlockRight(nsites-iter-2)
        # find smallest eigenvalue and eigenvector
        S.GroundState()
        # Calculate density matrix
        S.DensityMatrix(Position.LEFT)
        # Truncate
        S.Truncate(Position.LEFT,n_states_to_keep)
    first_iter = 1;
    for iter in range(first_iter, nsites-3):
        print "RIGHT-TO-LEFT ITERATION ", iter, S.dim_l, S.dim_r
        # Create HL and HR by adding the single sites to the two blocks
        S.BuildBlockRight(iter);
        S.BuildBlockLeft(nsites-iter-2)
        # find smallest eigenvalue and eigenvector
        S.GroundState();
        # Calculate density matrix
        S.DensityMatrix(Position.RIGHT)
        # Truncate
        S.Truncate(Position.RIGHT,n_states_to_keep)


WARMUP ITERATION  1 0 0
Iter =  1  Ener =  0.461465177848
Iter =  2  Ener =  -0.723470145128
Iter =  3  Ener =  -0.955796185995
Iter =  4  Ener =  -1.09440427122
Iter =  5  Ener =  -1.60690967069
Iter =  6  Ener =  -1.61602540378
E0 =  -1.61602540378
RHO EIGENVALUE  0.0223290993693
RHO EIGENVALUE  0.0223290993693
RHO EIGENVALUE  0.0223290993693
RHO EIGENVALUE  0.933012701892
Truncation error =  0.0
RHO EIGENVALUE  0.0223290993693
RHO EIGENVALUE  0.0223290993693
RHO EIGENVALUE  0.0223290993693
RHO EIGENVALUE  0.933012701892
Truncation error =  0.0
WARMUP ITERATION  2 4 4
Iter =  1  Ener =  -0.0168553717681
Iter =  2  Ener =  -1.09899996345
Iter =  3  Ener =  -1.69165575266
Iter =  4  Ener =  -2.11182285272
Iter =  5  Ener =  -2.2704178049
Iter =  6  Ener =  -2.41535627015
Iter =  7  Ener =  -2.47627242237
Iter =  8  Ener =  -2.49131421353
Iter =  9  Ener =  -2.49342510535
Iter =  10  Ener =  -2.49357085847
Iter =  11  Ener =  -2.49357678533
Iter =  12  Ener =  -2.49357711846
Iter =  13  Ener =  -2.49357713303
E0 =  -2.49357713303
RHO EIGENVALUE  8.76360039152e-05
RHO EIGENVALUE  8.7639150371e-05
RHO EIGENVALUE  8.76539724154e-05
RHO EIGENVALUE  8.76706477776e-05
RHO EIGENVALUE  0.00103360228664
RHO EIGENVALUE  0.00103402590633
RHO EIGENVALUE  0.498790137297
RHO EIGENVALUE  0.498791634735
Truncation error =  0.0
RHO EIGENVALUE  8.76360039152e-05
RHO EIGENVALUE  8.7639150371e-05
RHO EIGENVALUE  8.76539724154e-05
RHO EIGENVALUE  8.76706477776e-05
RHO EIGENVALUE  0.00103360228664
RHO EIGENVALUE  0.00103402590633
RHO EIGENVALUE  0.498790137297
RHO EIGENVALUE  0.498791634735
Truncation error =  0.0
WARMUP ITERATION  3 8 8
Iter =  1  Ener =  -0.0424576156819
Iter =  2  Ener =  -1.55304343806
Iter =  3  Ener =  -2.45853106926
Iter =  4  Ener =  -2.8050844371
Iter =  5  Ener =  -2.94173438403
Iter =  6  Ener =  -2.98215252289
Iter =  7  Ener =  -3.00732505654
Iter =  8  Ener =  -3.07020894528
Iter =  9  Ener =  -3.23114608439
Iter =  10  Ener =  -3.34057465541
Iter =  11  Ener =  -3.36962137673
Iter =  12  Ener =  -3.37412344975
Iter =  13  Ener =  -3.37480262498
Iter =  14  Ener =  -3.37491947172
Iter =  15  Ener =  -3.37493110069
Iter =  16  Ener =  -3.37493233631
Iter =  17  Ener =  -3.37493254439
Iter =  18  Ener =  -3.37493259144
E0 =  -3.37493259144
RHO EIGENVALUE  2.76989491512e-08
RHO EIGENVALUE  2.95707168834e-08
RHO EIGENVALUE  3.00826592207e-08
RHO EIGENVALUE  3.09608758091e-08
RHO EIGENVALUE  3.21592195365e-08
RHO EIGENVALUE  1.86872445746e-07
RHO EIGENVALUE  1.9017028816e-07
RHO EIGENVALUE  1.92762119685e-07
RHO EIGENVALUE  4.14172008423e-06
RHO EIGENVALUE  1.64241513425e-05
RHO EIGENVALUE  1.64601927258e-05
RHO EIGENVALUE  1.64908772633e-05
RHO EIGENVALUE  0.0355088438246
RHO EIGENVALUE  0.0355123855625
RHO EIGENVALUE  0.0355144932391
RHO EIGENVALUE  0.893410040155
Truncation error =  3.37344866347e-07
RHO EIGENVALUE  2.76989491874e-08
RHO EIGENVALUE  2.95707169506e-08
RHO EIGENVALUE  3.00826592702e-08
RHO EIGENVALUE  3.0960875847e-08
RHO EIGENVALUE  3.21592195741e-08
RHO EIGENVALUE  1.86872445785e-07
RHO EIGENVALUE  1.90170288209e-07
RHO EIGENVALUE  1.92762119689e-07
RHO EIGENVALUE  4.14172008423e-06
RHO EIGENVALUE  1.64241513425e-05
RHO EIGENVALUE  1.64601927258e-05
RHO EIGENVALUE  1.64908772633e-05
RHO EIGENVALUE  0.0355088438246
RHO EIGENVALUE  0.0355123855625
RHO EIGENVALUE  0.0355144932391
RHO EIGENVALUE  0.893410040155
Truncation error =  3.37344866614e-07
WARMUP ITERATION  4 16 16
Iter =  1  Ener =  -0.672221865349
Iter =  2  Ener =  -2.015188323
Iter =  3  Ener =  -2.9351194045
Iter =  4  Ener =  -3.52170600601
Iter =  5  Ener =  -3.81855209186
Iter =  6  Ener =  -3.93210644247
Iter =  7  Ener =  -3.98738969545
Iter =  8  Ener =  -4.04568053989
Iter =  9  Ener =  -4.13962248169
Iter =  10  Ener =  -4.20765042167
Iter =  11  Ener =  -4.24269605555
Iter =  12  Ener =  -4.25456039584
Iter =  13  Ener =  -4.25733481573
Iter =  14  Ener =  -4.25789790504
Iter =  15  Ener =  -4.2580043783
Iter =  16  Ener =  -4.25802539979
Iter =  17  Ener =  -4.25802853876
Iter =  18  Ener =  -4.25802881481
Iter =  19  Ener =  -4.25802885374
E0 =  -4.25802885374
RHO EIGENVALUE  2.93637757538e-12
RHO EIGENVALUE  4.55100392465e-11
RHO EIGENVALUE  6.2389593961e-11
RHO EIGENVALUE  1.10333930788e-10
RHO EIGENVALUE  2.4306007194e-09
RHO EIGENVALUE  2.71042677015e-09
RHO EIGENVALUE  2.87656716333e-08
RHO EIGENVALUE  3.34199444045e-08
RHO EIGENVALUE  3.67333361513e-08
RHO EIGENVALUE  3.76328282891e-08
RHO EIGENVALUE  3.99442489633e-07
RHO EIGENVALUE  4.04763414744e-07
RHO EIGENVALUE  0.000272918859686
RHO EIGENVALUE  0.000274065150863
RHO EIGENVALUE  0.000274860422055
RHO EIGENVALUE  0.000275001617731
RHO EIGENVALUE  0.00286712943923
RHO EIGENVALUE  0.00286863113667
RHO EIGENVALUE  0.496551074115
RHO EIGENVALUE  0.496615373139
Truncation error =  1.41913977909e-07
RHO EIGENVALUE  2.936377553e-12
RHO EIGENVALUE  4.55100392596e-11
RHO EIGENVALUE  6.23895940452e-11
RHO EIGENVALUE  1.1033393067e-10
RHO EIGENVALUE  2.43060072162e-09
RHO EIGENVALUE  2.71042676972e-09
RHO EIGENVALUE  2.87656716329e-08
RHO EIGENVALUE  3.34199444028e-08
RHO EIGENVALUE  3.67333361522e-08
RHO EIGENVALUE  3.76328282902e-08
RHO EIGENVALUE  3.99442489665e-07
RHO EIGENVALUE  4.0476341473e-07
RHO EIGENVALUE  0.000272918859686
RHO EIGENVALUE  0.000274065150863
RHO EIGENVALUE  0.000274860422055
RHO EIGENVALUE  0.000275001617731
RHO EIGENVALUE  0.00286712943923
RHO EIGENVALUE  0.00286863113667
RHO EIGENVALUE  0.496551074115
RHO EIGENVALUE  0.496615373139
Truncation error =  1.41913977911e-07
LEFT-TO-RIGHT ITERATION  5 20 20
Iter =  1  Ener =  -1.03082776759
Iter =  2  Ener =  -2.40739234103
Iter =  3  Ener =  -3.25141996115
Iter =  4  Ener =  -3.63036665913
Iter =  5  Ener =  -3.83296088232
Iter =  6  Ener =  -3.90820875384
Iter =  7  Ener =  -3.95660918123
Iter =  8  Ener =  -4.01053211652
Iter =  9  Ener =  -4.08817129471
Iter =  10  Ener =  -4.19883592985
Iter =  11  Ener =  -4.24564044546
Iter =  12  Ener =  -4.25597410611
Iter =  13  Ener =  -4.25771618551
Iter =  14  Ener =  -4.25799476018
Iter =  15  Ener =  -4.25802689693
Iter =  16  Ener =  -4.25803092221
Iter =  17  Ener =  -4.25803137911
Iter =  18  Ener =  -4.25803146489
E0 =  -4.25803146489
RHO EIGENVALUE  -5.94439264521e-18
RHO EIGENVALUE  -4.19838882699e-19
RHO EIGENVALUE  -7.78790721696e-20
RHO EIGENVALUE  1.2313777561e-19
RHO EIGENVALUE  7.19949333274e-08
RHO EIGENVALUE  7.32237828834e-08
RHO EIGENVALUE  7.34220170028e-08
RHO EIGENVALUE  7.53402881884e-08
RHO EIGENVALUE  7.62970845488e-08
RHO EIGENVALUE  4.55659160041e-07
RHO EIGENVALUE  4.61015912248e-07
RHO EIGENVALUE  4.64395997893e-07
RHO EIGENVALUE  9.52524675287e-06
RHO EIGENVALUE  3.4277913015e-05
RHO EIGENVALUE  3.4372619371e-05
RHO EIGENVALUE  3.44283759021e-05
RHO EIGENVALUE  0.0391744074283
RHO EIGENVALUE  0.0391802235469
RHO EIGENVALUE  0.0391894261833
RHO EIGENVALUE  0.882341587337
Truncation error =  8.25937265986e-07
LEFT-TO-RIGHT ITERATION  6 20 16
Iter =  1  Ener =  -1.35984549659
Iter =  2  Ener =  -2.7445168795
Iter =  3  Ener =  -3.49518971253
Iter =  4  Ener =  -3.98995355284
Iter =  5  Ener =  -4.15550513914
Iter =  6  Ener =  -4.20217274046
Iter =  7  Ener =  -4.23237920879
Iter =  8  Ener =  -4.2491875531
Iter =  9  Ener =  -4.25544683658
Iter =  10  Ener =  -4.2574716442
Iter =  11  Ener =  -4.25792402629
Iter =  12  Ener =  -4.25801666845
Iter =  13  Ener =  -4.25802707965
Iter =  14  Ener =  -4.25802821566
Iter =  15  Ener =  -4.25802836135
Iter =  16  Ener =  -4.25802838594
E0 =  -4.25802838594
RHO EIGENVALUE  -2.77341416304e-18
RHO EIGENVALUE  -7.22535710041e-19
RHO EIGENVALUE  -2.31619062046e-19
RHO EIGENVALUE  -3.98675850189e-20
RHO EIGENVALUE  -2.38029128796e-21
RHO EIGENVALUE  4.45984546431e-22
RHO EIGENVALUE  5.71363971012e-21
RHO EIGENVALUE  2.72065519864e-19
RHO EIGENVALUE  6.56248494294e-19
RHO EIGENVALUE  8.1492447247e-19
RHO EIGENVALUE  1.37059666474e-18
RHO EIGENVALUE  1.3491381846e-17
RHO EIGENVALUE  0.000185106052295
RHO EIGENVALUE  0.000185604038377
RHO EIGENVALUE  0.000186052746092
RHO EIGENVALUE  0.000186211393898
RHO EIGENVALUE  0.00202521150407
RHO EIGENVALUE  0.0020266056579
RHO EIGENVALUE  0.497578483671
RHO EIGENVALUE  0.497626724936
Truncation error =  -2.02041870055e-18
RIGHT-TO-LEFT ITERATION  1 20 8
Iter =  1  Ener =  -2.15999912683
Iter =  2  Ener =  -3.16928010454
Iter =  3  Ener =  -3.75772519741
Iter =  4  Ener =  -4.01713603572
Iter =  5  Ener =  -4.09497198981
Iter =  6  Ener =  -4.17998820133
Iter =  7  Ener =  -4.23752396925
Iter =  8  Ener =  -4.25474605345
Iter =  9  Ener =  -4.25757166281
Iter =  10  Ener =  -4.2579624807
Iter =  11  Ener =  -4.25801259647
Iter =  12  Ener =  -4.25802171945
Iter =  13  Ener =  -4.25802544158
Iter =  14  Ener =  -4.25802787657
Iter =  15  Ener =  -4.25802828786
Iter =  16  Ener =  -4.25802837677
E0 =  -4.25802837677
RHO EIGENVALUE  0.0306347949933
RHO EIGENVALUE  0.03063655822
RHO EIGENVALUE  0.0306424346241
RHO EIGENVALUE  0.908086212163
Truncation error =  0.0
RIGHT-TO-LEFT ITERATION  2 20 4
Iter =  1  Ener =  -1.47842067957
Iter =  2  Ener =  -2.55608985077
Iter =  3  Ener =  -3.50987055826
Iter =  4  Ener =  -3.8467591933
Iter =  5  Ener =  -3.97909352153
Iter =  6  Ener =  -4.03769544076
Iter =  7  Ener =  -4.12371481391
Iter =  8  Ener =  -4.22209041147
Iter =  9  Ener =  -4.24904144494
Iter =  10  Ener =  -4.2561054957
Iter =  11  Ener =  -4.25772656018
Iter =  12  Ener =  -4.25798438324
Iter =  13  Ener =  -4.25802342077
Iter =  14  Ener =  -4.25802783448
Iter =  15  Ener =  -4.25802828861
Iter =  16  Ener =  -4.25802835342
E0 =  -4.25802835342
RHO EIGENVALUE  0.000185262237588
RHO EIGENVALUE  0.000185704467029
RHO EIGENVALUE  0.00018617442497
RHO EIGENVALUE  0.000186437118811
RHO EIGENVALUE  0.00202529295544
RHO EIGENVALUE  0.00202746362356
RHO EIGENVALUE  0.497429132548
RHO EIGENVALUE  0.497774532625
Truncation error =  0.0
RIGHT-TO-LEFT ITERATION  3 20 8
Iter =  1  Ener =  -1.04151258221
Iter =  2  Ener =  -2.20319248268
Iter =  3  Ener =  -3.18836294376
Iter =  4  Ener =  -3.73289618548
Iter =  5  Ener =  -3.99853614233
Iter =  6  Ener =  -4.13065155559
Iter =  7  Ener =  -4.19884759646
Iter =  8  Ener =  -4.22930219471
Iter =  9  Ener =  -4.24421000961
Iter =  10  Ener =  -4.2532151756
Iter =  11  Ener =  -4.25697203598
Iter =  12  Ener =  -4.25787896427
Iter =  13  Ener =  -4.25801125772
Iter =  14  Ener =  -4.25802887794
Iter =  15  Ener =  -4.25803114135
Iter =  16  Ener =  -4.25803145175
Iter =  17  Ener =  -4.25803148417
E0 =  -4.25803148417
RHO EIGENVALUE  7.2360810645e-08
RHO EIGENVALUE  7.32862989241e-08
RHO EIGENVALUE  7.35769759567e-08
RHO EIGENVALUE  7.41268298565e-08
RHO EIGENVALUE  7.44509235919e-08
RHO EIGENVALUE  4.5849036282e-07
RHO EIGENVALUE  4.60732923005e-07
RHO EIGENVALUE  4.61645012384e-07
RHO EIGENVALUE  9.47851699885e-06
RHO EIGENVALUE  3.41682990345e-05
RHO EIGENVALUE  3.42858463929e-05
RHO EIGENVALUE  3.43297579377e-05
RHO EIGENVALUE  0.0391641854512
RHO EIGENVALUE  0.0391668292235
RHO EIGENVALUE  0.0391694663292
RHO EIGENVALUE  0.882385507906
Truncation error =  8.26292201794e-07
RIGHT-TO-LEFT ITERATION  4 20 16
Iter =  1  Ener =  -0.905191814984
Iter =  2  Ener =  -2.26154033346
Iter =  3  Ener =  -2.96687675985
Iter =  4  Ener =  -3.38025653604
Iter =  5  Ener =  -3.60518176779
Iter =  6  Ener =  -3.77320194369
Iter =  7  Ener =  -3.91315988575
Iter =  8  Ener =  -4.01119360074
Iter =  9  Ener =  -4.08302910293
Iter =  10  Ener =  -4.14810711977
Iter =  11  Ener =  -4.20894302106
Iter =  12  Ener =  -4.2453530662
Iter =  13  Ener =  -4.25554090424
Iter =  14  Ener =  -4.25753834677
Iter =  15  Ener =  -4.25794183526
Iter =  16  Ener =  -4.25801469974
Iter =  17  Ener =  -4.25802615864
Iter =  18  Ener =  -4.25802818712
Iter =  19  Ener =  -4.25802872337
Iter =  20  Ener =  -4.25802885446
Iter =  21  Ener =  -4.25802887734
E0 =  -4.25802887734
RHO EIGENVALUE  1.32178247256e-13
RHO EIGENVALUE  5.23262486052e-12
RHO EIGENVALUE  3.06733801739e-11
RHO EIGENVALUE  4.69357198063e-11
RHO EIGENVALUE  2.22184546558e-09
RHO EIGENVALUE  2.38910935307e-09
RHO EIGENVALUE  3.19047102273e-08
RHO EIGENVALUE  3.30229064789e-08
RHO EIGENVALUE  3.3809131892e-08
RHO EIGENVALUE  3.66192463311e-08
RHO EIGENVALUE  3.91865805166e-07
RHO EIGENVALUE  4.0215762617e-07
RHO EIGENVALUE  0.000273406285393
RHO EIGENVALUE  0.00027381305685
RHO EIGENVALUE  0.000274182692011
RHO EIGENVALUE  0.000274727259078
RHO EIGENVALUE  0.00286554647946
RHO EIGENVALUE  0.00286680116708
RHO EIGENVALUE  0.496564406512
RHO EIGENVALUE  0.496606182474
Truncation error =  1.40049923651e-07
RIGHT-TO-LEFT ITERATION  5 20 20
Iter =  1  Ener =  -1.06821025454
Iter =  2  Ener =  -2.46890629367
Iter =  3  Ener =  -3.2187439728
Iter =  4  Ener =  -3.71041514859
Iter =  5  Ener =  -4.02414767344
Iter =  6  Ener =  -4.13177242308
Iter =  7  Ener =  -4.18829994263
Iter =  8  Ener =  -4.22393087768
Iter =  9  Ener =  -4.24505564861
Iter =  10  Ener =  -4.25389351924
Iter =  11  Ener =  -4.25688553199
Iter =  12  Ener =  -4.2578232036
Iter =  13  Ener =  -4.25800211928
Iter =  14  Ener =  -4.2580283105
Iter =  15  Ener =  -4.25803116564
Iter =  16  Ener =  -4.25803147746
Iter =  17  Ener =  -4.25803150939
E0 =  -4.25803150939
RHO EIGENVALUE  -5.875209905e-20
RHO EIGENVALUE  1.98517778245e-20
RHO EIGENVALUE  4.34950915993e-20
RHO EIGENVALUE  1.02428211079e-17
RHO EIGENVALUE  7.20716259885e-08
RHO EIGENVALUE  7.29867570409e-08
RHO EIGENVALUE  7.34073914128e-08
RHO EIGENVALUE  7.40636305149e-08
RHO EIGENVALUE  7.49282549216e-08
RHO EIGENVALUE  4.56280645661e-07
RHO EIGENVALUE  4.58115891038e-07
RHO EIGENVALUE  4.60245661444e-07
RHO EIGENVALUE  9.46230614473e-06
RHO EIGENVALUE  3.40966809093e-05
RHO EIGENVALUE  3.41843269141e-05
RHO EIGENVALUE  3.42468426089e-05
RHO EIGENVALUE  0.0391517258741
RHO EIGENVALUE  0.0391576017678
RHO EIGENVALUE  0.0391610010978
RHO EIGENVALUE  0.882415939004
Truncation error =  8.2373830555e-07
RIGHT-TO-LEFT ITERATION  6 16 20
Iter =  1  Ener =  -1.52286175518
Iter =  2  Ener =  -2.60858565499
Iter =  3  Ener =  -3.22155036413
Iter =  4  Ener =  -3.62224926035
Iter =  5  Ener =  -3.86737390427
Iter =  6  Ener =  -4.00241338066
Iter =  7  Ener =  -4.1081546361
Iter =  8  Ener =  -4.17181176155
Iter =  9  Ener =  -4.22299858517
Iter =  10  Ener =  -4.25246291699
Iter =  11  Ener =  -4.25718187749
Iter =  12  Ener =  -4.2579161884
Iter =  13  Ener =  -4.2580127711
Iter =  14  Ener =  -4.25802592467
Iter =  15  Ener =  -4.25802782283
Iter =  16  Ener =  -4.25802827264
Iter =  17  Ener =  -4.25802837576
Iter =  18  Ener =  -4.25802840019
E0 =  -4.25802840019
RHO EIGENVALUE  -1.92680538215e-18
RHO EIGENVALUE  -1.10685588771e-18
RHO EIGENVALUE  -1.46716887957e-19
RHO EIGENVALUE  -1.54235630116e-20
RHO EIGENVALUE  -1.04233113977e-20
RHO EIGENVALUE  8.50690004309e-21
RHO EIGENVALUE  1.45587564509e-20
RHO EIGENVALUE  2.59352151061e-19
RHO EIGENVALUE  1.03454844581e-18
RHO EIGENVALUE  1.4499095042e-18
RHO EIGENVALUE  3.08158356191e-18
RHO EIGENVALUE  5.15421145831e-17
RHO EIGENVALUE  0.000185252303512
RHO EIGENVALUE  0.000185775800554
RHO EIGENVALUE  0.000186008922294
RHO EIGENVALUE  0.000186239452521
RHO EIGENVALUE  0.00202477849971
RHO EIGENVALUE  0.0020265145338
RHO EIGENVALUE  0.49757391539
RHO EIGENVALUE  0.497631515098
Truncation error =  -4.39349274658e-19
LEFT-TO-RIGHT ITERATION  1 8 20
Iter =  1  Ener =  -2.00457682749
Iter =  2  Ener =  -3.12449019076
Iter =  3  Ener =  -3.47567602141
Iter =  4  Ener =  -3.76794747205
Iter =  5  Ener =  -3.99484506333
Iter =  6  Ener =  -4.1052826489
Iter =  7  Ener =  -4.17367771671
Iter =  8  Ener =  -4.22816856915
Iter =  9  Ener =  -4.25215835962
Iter =  10  Ener =  -4.25717548433
Iter =  11  Ener =  -4.25789139776
Iter =  12  Ener =  -4.25800295738
Iter =  13  Ener =  -4.25802110449
Iter =  14  Ener =  -4.25802539864
Iter =  15  Ener =  -4.25802705899
Iter =  16  Ener =  -4.25802816522
Iter =  17  Ener =  -4.2580283939
Iter =  18  Ener =  -4.25802841751
E0 =  -4.25802841751
RHO EIGENVALUE  0.0306273009186
RHO EIGENVALUE  0.0306282223879
RHO EIGENVALUE  0.0306294072801
RHO EIGENVALUE  0.908115069413
Truncation error =  0.0
LEFT-TO-RIGHT ITERATION  2 4 20
Iter =  1  Ener =  -1.41321021538
Iter =  2  Ener =  -2.60001581997
Iter =  3  Ener =  -3.46717097984
Iter =  4  Ener =  -3.93114004521
Iter =  5  Ener =  -4.15264679203
Iter =  6  Ener =  -4.21788499428
Iter =  7  Ener =  -4.24159242444
Iter =  8  Ener =  -4.25066345225
Iter =  9  Ener =  -4.25500097349
Iter =  10  Ener =  -4.25734802008
Iter =  11  Ener =  -4.25790758924
Iter =  12  Ener =  -4.25801381266
Iter =  13  Ener =  -4.25802592312
Iter =  14  Ener =  -4.25802790163
Iter =  15  Ener =  -4.25802832163
Iter =  16  Ener =  -4.25802841248
E0 =  -4.25802841248
RHO EIGENVALUE  0.000184915824839
RHO EIGENVALUE  0.00018569447858
RHO EIGENVALUE  0.000185920136462
RHO EIGENVALUE  0.000186223586615
RHO EIGENVALUE  0.00202437254469
RHO EIGENVALUE  0.00202524264902
RHO EIGENVALUE  0.497585515972
RHO EIGENVALUE  0.497622114808
Truncation error =  0.0
LEFT-TO-RIGHT ITERATION  3 8 20
Iter =  1  Ener =  -1.08577063528
Iter =  2  Ener =  -2.28395384239
Iter =  3  Ener =  -3.24963074707
Iter =  4  Ener =  -3.66239812105
Iter =  5  Ener =  -3.83198568672
Iter =  6  Ener =  -3.88937775688
Iter =  7  Ener =  -3.91432473388
Iter =  8  Ener =  -3.92551361742
Iter =  9  Ener =  -3.92930823658
Iter =  10  Ener =  -3.93152550539
Iter =  11  Ener =  -3.93998072655
Iter =  12  Ener =  -4.16073335678
Iter =  13  Ener =  -4.23735543562
Iter =  14  Ener =  -4.25412397476
Iter =  15  Ener =  -4.25724069498
Iter =  16  Ener =  -4.25787425965
Iter =  17  Ener =  -4.25800198003
Iter =  18  Ener =  -4.25802798921
Iter =  19  Ener =  -4.25803110135
Iter =  20  Ener =  -4.25803145308
Iter =  21  Ener =  -4.25803150063
E0 =  -4.25803150063
RHO EIGENVALUE  7.11005077648e-08
RHO EIGENVALUE  7.20954857632e-08
RHO EIGENVALUE  7.312271879e-08
RHO EIGENVALUE  7.5006414495e-08
RHO EIGENVALUE  7.55312003718e-08
RHO EIGENVALUE  4.55574151712e-07
RHO EIGENVALUE  4.60206978314e-07
RHO EIGENVALUE  4.62163159278e-07
RHO EIGENVALUE  9.46636925546e-06
RHO EIGENVALUE  3.41741494692e-05
RHO EIGENVALUE  3.42371566561e-05
RHO EIGENVALUE  3.43023798054e-05
RHO EIGENVALUE  0.0391494570644
RHO EIGENVALUE  0.03916623482
RHO EIGENVALUE  0.039183804589
RHO EIGENVALUE  0.882386578671
Truncation error =  8.22430478897e-07
LEFT-TO-RIGHT ITERATION  4 16 20
Iter =  1  Ener =  -0.837398680376
Iter =  2  Ener =  -2.30941198482
Iter =  3  Ener =  -3.12551403822
Iter =  4  Ener =  -3.49154732985
Iter =  5  Ener =  -3.76417199178
Iter =  6  Ener =  -4.03864499711
Iter =  7  Ener =  -4.17009785537
Iter =  8  Ener =  -4.21736020061
Iter =  9  Ener =  -4.23666778299
Iter =  10  Ener =  -4.24724014488
Iter =  11  Ener =  -4.254010507
Iter =  12  Ener =  -4.25684154568
Iter =  13  Ener =  -4.25771244472
Iter =  14  Ener =  -4.25795089656
Iter =  15  Ener =  -4.25801096818
Iter =  16  Ener =  -4.25802454399
Iter =  17  Ener =  -4.25802808861
Iter =  18  Ener =  -4.25802877699
Iter =  19  Ener =  -4.25802889523
Iter =  20  Ener =  -4.25802891472
E0 =  -4.25802891472
RHO EIGENVALUE  5.41882777091e-12
RHO EIGENVALUE  2.98174025781e-11
RHO EIGENVALUE  3.909749842e-11
RHO EIGENVALUE  8.06832231754e-11
RHO EIGENVALUE  2.3642343716e-09
RHO EIGENVALUE  2.65157957024e-09
RHO EIGENVALUE  3.10490894714e-08
RHO EIGENVALUE  3.24569062553e-08
RHO EIGENVALUE  3.53780999978e-08
RHO EIGENVALUE  3.68056866806e-08
RHO EIGENVALUE  3.96383722345e-07
RHO EIGENVALUE  3.98730137364e-07
RHO EIGENVALUE  0.000273279880867
RHO EIGENVALUE  0.000273538964662
RHO EIGENVALUE  0.000274364539009
RHO EIGENVALUE  0.00027465781333
RHO EIGENVALUE  0.00286515235288
RHO EIGENVALUE  0.00286589150716
RHO EIGENVALUE  0.496551922663
RHO EIGENVALUE  0.496620256304
Truncation error =  1.40860613299e-07
LEFT-TO-RIGHT ITERATION  5 20 20
Iter =  1  Ener =  -1.11335008815
Iter =  2  Ener =  -2.52548996174
Iter =  3  Ener =  -3.39208214799
Iter =  4  Ener =  -3.88735494341
Iter =  5  Ener =  -4.09812035337
Iter =  6  Ener =  -4.16438409539
Iter =  7  Ener =  -4.20531591446
Iter =  8  Ener =  -4.23791718307
Iter =  9  Ener =  -4.25188339417
Iter =  10  Ener =  -4.25624579568
Iter =  11  Ener =  -4.25758162222
Iter =  12  Ener =  -4.25794655022
Iter =  13  Ener =  -4.25802025434
Iter =  14  Ener =  -4.25802991662
Iter =  15  Ener =  -4.25803132803
Iter =  16  Ener =  -4.25803149893
Iter =  17  Ener =  -4.25803151677
E0 =  -4.25803151677
RHO EIGENVALUE  -1.60996381537e-17
RHO EIGENVALUE  -1.04815668578e-19
RHO EIGENVALUE  -3.4887053664e-21
RHO EIGENVALUE  4.94250655605e-20
RHO EIGENVALUE  7.23121723311e-08
RHO EIGENVALUE  7.26288263217e-08
RHO EIGENVALUE  7.30533221119e-08
RHO EIGENVALUE  7.3487999904e-08
RHO EIGENVALUE  7.42702951773e-08
RHO EIGENVALUE  4.55681286375e-07
RHO EIGENVALUE  4.5794660061e-07
RHO EIGENVALUE  4.62037677013e-07
RHO EIGENVALUE  9.46527752122e-06
RHO EIGENVALUE  3.41787031597e-05
RHO EIGENVALUE  3.42257612889e-05
RHO EIGENVALUE  3.43145684558e-05
RHO EIGENVALUE  0.0391592389891
RHO EIGENVALUE  0.0391662006025
RHO EIGENVALUE  0.0391715109291
RHO EIGENVALUE  0.882389123751
Truncation error =  8.21433902205e-07
LEFT-TO-RIGHT ITERATION  6 20 16
Iter =  1  Ener =  -1.31301139087
Iter =  2  Ener =  -2.38706072628
Iter =  3  Ener =  -3.09371565083
Iter =  4  Ener =  -3.57237849915
Iter =  5  Ener =  -3.91487966346
Iter =  6  Ener =  -4.04835365268
Iter =  7  Ener =  -4.12736273099
Iter =  8  Ener =  -4.19368273742
Iter =  9  Ener =  -4.23444090939
Iter =  10  Ener =  -4.25280437688
Iter =  11  Ener =  -4.25712146947
Iter =  12  Ener =  -4.25787421462
Iter =  13  Ener =  -4.25800746215
Iter =  14  Ener =  -4.25802387702
Iter =  15  Ener =  -4.25802734152
Iter =  16  Ener =  -4.25802822179
Iter =  17  Ener =  -4.25802836059
Iter =  18  Ener =  -4.25802839553
E0 =  -4.25802839553
RHO EIGENVALUE  -1.06434146155e-16
RHO EIGENVALUE  -8.51028090086e-18
RHO EIGENVALUE  -5.35413039202e-18
RHO EIGENVALUE  -8.27632275985e-19
RHO EIGENVALUE  -2.46165118506e-20
RHO EIGENVALUE  -1.97616702308e-20
RHO EIGENVALUE  -4.76411206283e-21
RHO EIGENVALUE  1.00813422798e-20
RHO EIGENVALUE  7.87615049429e-20
RHO EIGENVALUE  1.36038095214e-18
RHO EIGENVALUE  2.81163983779e-18
RHO EIGENVALUE  6.09865789638e-18
RHO EIGENVALUE  0.000185146362108
RHO EIGENVALUE  0.000185843838207
RHO EIGENVALUE  0.000186167651483
RHO EIGENVALUE  0.000186301221144
RHO EIGENVALUE  0.00202465451191
RHO EIGENVALUE  0.00202717969115
RHO EIGENVALUE  0.497593074503
RHO EIGENVALUE  0.497611632221
Truncation error =  -1.19726108218e-16
RIGHT-TO-LEFT ITERATION  1 20 8
Iter =  1  Ener =  -1.9744540405
Iter =  2  Ener =  -3.15277682293
Iter =  3  Ener =  -3.67628061154
Iter =  4  Ener =  -3.87644765493
Iter =  5  Ener =  -3.93978825504
Iter =  6  Ener =  -3.99177912951
Iter =  7  Ener =  -4.12679120342
Iter =  8  Ener =  -4.2316712114
Iter =  9  Ener =  -4.25506901332
Iter =  10  Ener =  -4.25769901712
Iter =  11  Ener =  -4.25796942847
Iter =  12  Ener =  -4.25802096821
Iter =  13  Ener =  -4.258026616
Iter =  14  Ener =  -4.25802786049
Iter =  15  Ener =  -4.25802812559
Iter =  16  Ener =  -4.25802834359
Iter =  17  Ener =  -4.25802842186
E0 =  -4.25802842186
RHO EIGENVALUE  0.0306279337751
RHO EIGENVALUE  0.0306324050931
RHO EIGENVALUE  0.0306352401624
RHO EIGENVALUE  0.908104420969
Truncation error =  0.0
RIGHT-TO-LEFT ITERATION  2 20 4
Iter =  1  Ener =  -1.47359506737
Iter =  2  Ener =  -2.48653027944
Iter =  3  Ener =  -3.13558671057
Iter =  4  Ener =  -3.64076218564
Iter =  5  Ener =  -4.01551353173
Iter =  6  Ener =  -4.1831272418
Iter =  7  Ener =  -4.23980269313
Iter =  8  Ener =  -4.2522915063
Iter =  9  Ener =  -4.25518516822
Iter =  10  Ener =  -4.25676911609
Iter =  11  Ener =  -4.25772013694
Iter =  12  Ener =  -4.25798563998
Iter =  13  Ener =  -4.25802420107
Iter =  14  Ener =  -4.25802798597
Iter =  15  Ener =  -4.2580283696
Iter =  16  Ener =  -4.25802841821
E0 =  -4.25802841821
RHO EIGENVALUE  0.00018536224484
RHO EIGENVALUE  0.000185927083226
RHO EIGENVALUE  0.000186273450392
RHO EIGENVALUE  0.000186488873238
RHO EIGENVALUE  0.00202714121345
RHO EIGENVALUE  0.00202948125454
RHO EIGENVALUE  0.497555774789
RHO EIGENVALUE  0.497643551091
Truncation error =  0.0
RIGHT-TO-LEFT ITERATION  3 20 8
Iter =  1  Ener =  -1.02882581966
Iter =  2  Ener =  -2.44001914288
Iter =  3  Ener =  -3.34223109132
Iter =  4  Ener =  -3.7279050039
Iter =  5  Ener =  -3.87106341408
Iter =  6  Ener =  -3.91839494473
Iter =  7  Ener =  -3.94218846095
Iter =  8  Ener =  -3.97222288242
Iter =  9  Ener =  -4.05886009963
Iter =  10  Ener =  -4.18622351936
Iter =  11  Ener =  -4.24160716744
Iter =  12  Ener =  -4.25571647134
Iter =  13  Ener =  -4.25767515963
Iter =  14  Ener =  -4.25798370417
Iter =  15  Ener =  -4.258024214
Iter =  16  Ener =  -4.25803027177
Iter =  17  Ener =  -4.25803121915
Iter =  18  Ener =  -4.25803146564
Iter =  19  Ener =  -4.25803150822
E0 =  -4.25803150822
RHO EIGENVALUE  7.12262732026e-08
RHO EIGENVALUE  7.25474720111e-08
RHO EIGENVALUE  7.32804758042e-08
RHO EIGENVALUE  7.38048953813e-08
RHO EIGENVALUE  7.44415553592e-08
RHO EIGENVALUE  4.54102360498e-07
RHO EIGENVALUE  4.56457894615e-07
RHO EIGENVALUE  4.6203181751e-07
RHO EIGENVALUE  9.47244906077e-06
RHO EIGENVALUE  3.41278405685e-05
RHO EIGENVALUE  3.41921770096e-05
RHO EIGENVALUE  3.43130212953e-05
RHO EIGENVALUE  0.0391533729189
RHO EIGENVALUE  0.0391596315411
RHO EIGENVALUE  0.0391652013573
RHO EIGENVALUE  0.882407950802
Truncation error =  8.19403032257e-07
RIGHT-TO-LEFT ITERATION  4 20 16
Iter =  1  Ener =  -0.839099353483
Iter =  2  Ener =  -2.09253377816
Iter =  3  Ener =  -2.82795225931
Iter =  4  Ener =  -3.30842200076
Iter =  5  Ener =  -3.55511148851
Iter =  6  Ener =  -3.73200893457
Iter =  7  Ener =  -3.85012053712
Iter =  8  Ener =  -3.93008320076
Iter =  9  Ener =  -3.99137289765
Iter =  10  Ener =  -4.04504567593
Iter =  11  Ener =  -4.13239282355
Iter =  12  Ener =  -4.2206065179
Iter =  13  Ener =  -4.25022384791
Iter =  14  Ener =  -4.25634597264
Iter =  15  Ener =  -4.25764898772
Iter =  16  Ener =  -4.25794465906
Iter =  17  Ener =  -4.25801108123
Iter =  18  Ener =  -4.25802482816
Iter =  19  Ener =  -4.2580280439
Iter =  20  Ener =  -4.25802878496
Iter =  21  Ener =  -4.25802889148
Iter =  22  Ener =  -4.25802890938
E0 =  -4.25802890938
RHO EIGENVALUE  7.09773601125e-12
RHO EIGENVALUE  2.88767349823e-11
RHO EIGENVALUE  3.94931077885e-11
RHO EIGENVALUE  7.74658698276e-11
RHO EIGENVALUE  2.44052726412e-09
RHO EIGENVALUE  2.65934775213e-09
RHO EIGENVALUE  3.16189568932e-08
RHO EIGENVALUE  3.20965589183e-08
RHO EIGENVALUE  3.45736486198e-08
RHO EIGENVALUE  3.59722270181e-08
RHO EIGENVALUE  3.91936306286e-07
RHO EIGENVALUE  4.03178567836e-07
RHO EIGENVALUE  0.000273369534642
RHO EIGENVALUE  0.000273669958104
RHO EIGENVALUE  0.00027418193634
RHO EIGENVALUE  0.00027474271554
RHO EIGENVALUE  0.00286480724065
RHO EIGENVALUE  0.00286637498964
RHO EIGENVALUE  0.496490803347
RHO EIGENVALUE  0.496681115649
Truncation error =  1.39514199914e-07
RIGHT-TO-LEFT ITERATION  5 20 20
Iter =  1  Ener =  -1.031056239
Iter =  2  Ener =  -2.25914741375
Iter =  3  Ener =  -3.1381352287
Iter =  4  Ener =  -3.70882944358
Iter =  5  Ener =  -4.04848877
Iter =  6  Ener =  -4.16899889699
Iter =  7  Ener =  -4.213503067
Iter =  8  Ener =  -4.2378706116
Iter =  9  Ener =  -4.24919791537
Iter =  10  Ener =  -4.25444604321
Iter =  11  Ener =  -4.25716670471
Iter =  12  Ener =  -4.25785581971
Iter =  13  Ener =  -4.2580082739
Iter =  14  Ener =  -4.25802862199
Iter =  15  Ener =  -4.25803110137
Iter =  16  Ener =  -4.25803146023
Iter =  17  Ener =  -4.25803150573
E0 =  -4.25803150573
RHO EIGENVALUE  -1.28547807583e-18
RHO EIGENVALUE  -7.3990645448e-20
RHO EIGENVALUE  1.50750893355e-21
RHO EIGENVALUE  6.28540989703e-20
RHO EIGENVALUE  7.21584479333e-08
RHO EIGENVALUE  7.30413458232e-08
RHO EIGENVALUE  7.37906038265e-08
RHO EIGENVALUE  7.42025876769e-08
RHO EIGENVALUE  7.47119096631e-08
RHO EIGENVALUE  4.58013024318e-07
RHO EIGENVALUE  4.59719967302e-07
RHO EIGENVALUE  4.63752071956e-07
RHO EIGENVALUE  9.44319438388e-06
RHO EIGENVALUE  3.41251298425e-05
RHO EIGENVALUE  3.41425283285e-05
RHO EIGENVALUE  3.41952836468e-05
RHO EIGENVALUE  0.0391521349857
RHO EIGENVALUE  0.0391535274123
RHO EIGENVALUE  0.0391557316311
RHO EIGENVALUE  0.882424950445
Truncation error =  8.25917919239e-07
RIGHT-TO-LEFT ITERATION  6 16 20
Iter =  1  Ener =  -1.37005586617
Iter =  2  Ener =  -2.79561298118
Iter =  3  Ener =  -3.52866486656
Iter =  4  Ener =  -3.8120915378
Iter =  5  Ener =  -3.89722631093
Iter =  6  Ener =  -3.92936101885
Iter =  7  Ener =  -3.95153690617
Iter =  8  Ener =  -4.0121574726
Iter =  9  Ener =  -4.1654874205
Iter =  10  Ener =  -4.23951708037
Iter =  11  Ener =  -4.25522431782
Iter =  12  Ener =  -4.25768355383
Iter =  13  Ener =  -4.2579802573
Iter =  14  Ener =  -4.25801828471
Iter =  15  Ener =  -4.25802641435
Iter =  16  Ener =  -4.25802800618
Iter =  17  Ener =  -4.25802829903
Iter =  18  Ener =  -4.25802836375
E0 =  -4.25802836375
RHO EIGENVALUE  -1.41304905932e-17
RHO EIGENVALUE  -5.45673956566e-18
RHO EIGENVALUE  -1.19213746513e-18
RHO EIGENVALUE  -7.98608788411e-20
RHO EIGENVALUE  -3.27121207314e-20
RHO EIGENVALUE  -3.91163113569e-21
RHO EIGENVALUE  1.4532231866e-20
RHO EIGENVALUE  5.59894754645e-20
RHO EIGENVALUE  1.75876775475e-19
RHO EIGENVALUE  3.35509440265e-19
RHO EIGENVALUE  1.74677823228e-18
RHO EIGENVALUE  4.49095529722e-18
RHO EIGENVALUE  0.000185277373136
RHO EIGENVALUE  0.00018566887471
RHO EIGENVALUE  0.000186041741695
RHO EIGENVALUE  0.000186394735853
RHO EIGENVALUE  0.00202584242904
RHO EIGENVALUE  0.00202763616998
RHO EIGENVALUE  0.497343424634
RHO EIGENVALUE  0.497859714041
Truncation error =  -2.03139443316e-17
LEFT-TO-RIGHT ITERATION  1 8 20
Iter =  1  Ener =  -2.00618189469
Iter =  2  Ener =  -3.19418041263
Iter =  3  Ener =  -3.7774094422
Iter =  4  Ener =  -3.91441329211
Iter =  5  Ener =  -3.96121160603
Iter =  6  Ener =  -4.04494248317
Iter =  7  Ener =  -4.18365081609
Iter =  8  Ener =  -4.24375117246
Iter =  9  Ener =  -4.25628594012
Iter =  10  Ener =  -4.2578813143
Iter =  11  Ener =  -4.25800759874
Iter =  12  Ener =  -4.25802010879
Iter =  13  Ener =  -4.25802444962
Iter =  14  Ener =  -4.25802732362
Iter =  15  Ener =  -4.25802827997
Iter =  16  Ener =  -4.2580283928
Iter =  17  Ener =  -4.25802841064
E0 =  -4.25802841064
RHO EIGENVALUE  0.0306237515295
RHO EIGENVALUE  0.0306299774523
RHO EIGENVALUE  0.0306334628211
RHO EIGENVALUE  0.908112808197
Truncation error =  0.0
LEFT-TO-RIGHT ITERATION  2 4 20
Iter =  1  Ener =  -1.40402890442
Iter =  2  Ener =  -2.60537142062
Iter =  3  Ener =  -3.45781247357
Iter =  4  Ener =  -4.03943716789
Iter =  5  Ener =  -4.18181020279
Iter =  6  Ener =  -4.21785320924
Iter =  7  Ener =  -4.2403589101
Iter =  8  Ener =  -4.25159981855
Iter =  9  Ener =  -4.2558127083
Iter =  10  Ener =  -4.25759096185
Iter =  11  Ener =  -4.25796922893
Iter =  12  Ener =  -4.25801862439
Iter =  13  Ener =  -4.25802733722
Iter =  14  Ener =  -4.25802828634
Iter =  15  Ener =  -4.25802839716
Iter =  16  Ener =  -4.2580284152
E0 =  -4.2580284152
RHO EIGENVALUE  0.000185101717126
RHO EIGENVALUE  0.000185722122505
RHO EIGENVALUE  0.000186056036936
RHO EIGENVALUE  0.000186175690077
RHO EIGENVALUE  0.00202555427282
RHO EIGENVALUE  0.00202625461604
RHO EIGENVALUE  0.497555921032
RHO EIGENVALUE  0.497649214512
Truncation error =  0.0
LEFT-TO-RIGHT ITERATION  3 8 20
Iter =  1  Ener =  -0.964761293464
Iter =  2  Ener =  -2.53979110281
Iter =  3  Ener =  -3.54845305938
Iter =  4  Ener =  -3.89942971478
Iter =  5  Ener =  -3.99797090788
Iter =  6  Ener =  -4.05326239127
Iter =  7  Ener =  -4.12687653753
Iter =  8  Ener =  -4.22170389132
Iter =  9  Ener =  -4.25202088679
Iter =  10  Ener =  -4.25675157727
Iter =  11  Ener =  -4.25769741209
Iter =  12  Ener =  -4.25795102645
Iter =  13  Ener =  -4.25801797026
Iter =  14  Ener =  -4.25802948378
Iter =  15  Ener =  -4.25803122464
Iter =  16  Ener =  -4.25803147984
Iter =  17  Ener =  -4.25803151016
E0 =  -4.25803151016
RHO EIGENVALUE  7.1492581995e-08
RHO EIGENVALUE  7.28160390856e-08
RHO EIGENVALUE  7.31449723262e-08
RHO EIGENVALUE  7.43334287158e-08
RHO EIGENVALUE  7.46649272354e-08
RHO EIGENVALUE  4.58211362112e-07
RHO EIGENVALUE  4.60312719031e-07
RHO EIGENVALUE  4.6230011148e-07
RHO EIGENVALUE  9.4584625639e-06
RHO EIGENVALUE  3.41461632237e-05
RHO EIGENVALUE  3.42163032327e-05
RHO EIGENVALUE  3.42601070622e-05
RHO EIGENVALUE  0.0391562369122
RHO EIGENVALUE  0.0391594098405
RHO EIGENVALUE  0.039163717762
RHO EIGENVALUE  0.882406807173
Truncation error =  8.2466331147e-07
LEFT-TO-RIGHT ITERATION  4 16 20
Iter =  1  Ener =  -0.768300770095
Iter =  2  Ener =  -1.95650111719
Iter =  3  Ener =  -2.71890281972
Iter =  4  Ener =  -3.18760664398
Iter =  5  Ener =  -3.55838184148
Iter =  6  Ener =  -3.80384995075
Iter =  7  Ener =  -3.92264791888
Iter =  8  Ener =  -3.99029027831
Iter =  9  Ener =  -4.05163596569
Iter =  10  Ener =  -4.1339213832
Iter =  11  Ener =  -4.20574297449
Iter =  12  Ener =  -4.24156653113
Iter =  13  Ener =  -4.25381965597
Iter =  14  Ener =  -4.25721035799
Iter =  15  Ener =  -4.25789550787
Iter =  16  Ener =  -4.2580088339
Iter =  17  Ener =  -4.25802633547
Iter =  18  Ener =  -4.25802850565
Iter =  19  Ener =  -4.25802881932
Iter =  20  Ener =  -4.25802888909
E0 =  -4.25802888909
RHO EIGENVALUE  3.51287282632e-12
RHO EIGENVALUE  3.73869316451e-11
RHO EIGENVALUE  6.54486013065e-11
RHO EIGENVALUE  8.57154439456e-11
RHO EIGENVALUE  2.4223997821e-09
RHO EIGENVALUE  2.68252554776e-09
RHO EIGENVALUE  3.22320014356e-08
RHO EIGENVALUE  3.34425968786e-08
RHO EIGENVALUE  3.45959812191e-08
RHO EIGENVALUE  3.60331038995e-08
RHO EIGENVALUE  3.95756587962e-07
RHO EIGENVALUE  3.97463973494e-07
RHO EIGENVALUE  0.00027356616924
RHO EIGENVALUE  0.000274338623052
RHO EIGENVALUE  0.000274581379416
RHO EIGENVALUE  0.000274964875835
RHO EIGENVALUE  0.00286767363079
RHO EIGENVALUE  0.00287019437698
RHO EIGENVALUE  0.49652561338
RHO EIGENVALUE  0.496638132743
Truncation error =  1.41600672612e-07
LEFT-TO-RIGHT ITERATION  5 20 20
Iter =  1  Ener =  -0.975142351742
Iter =  2  Ener =  -2.19757032748
Iter =  3  Ener =  -3.02679450394
Iter =  4  Ener =  -3.57418605534
Iter =  5  Ener =  -3.90685092317
Iter =  6  Ener =  -4.09003999485
Iter =  7  Ener =  -4.17649623135
Iter =  8  Ener =  -4.21621208293
Iter =  9  Ener =  -4.23864828011
Iter =  10  Ener =  -4.25058079853
Iter =  11  Ener =  -4.25588550525
Iter =  12  Ener =  -4.25767191491
Iter =  13  Ener =  -4.25797449841
Iter =  14  Ener =  -4.25802115321
Iter =  15  Ener =  -4.25802910879
Iter =  16  Ener =  -4.25803103167
Iter =  17  Ener =  -4.25803143644
Iter =  18  Ener =  -4.25803150601
E0 =  -4.25803150601
RHO EIGENVALUE  -2.04503295963e-18
RHO EIGENVALUE  -1.16610362815e-19
RHO EIGENVALUE  1.33100584256e-19
RHO EIGENVALUE  2.98367330028e-19
RHO EIGENVALUE  7.08646108021e-08
RHO EIGENVALUE  7.20000192684e-08
RHO EIGENVALUE  7.31423361469e-08
RHO EIGENVALUE  7.44600873639e-08
RHO EIGENVALUE  7.53947769172e-08
RHO EIGENVALUE  4.53550487245e-07
RHO EIGENVALUE  4.5993746323e-07
RHO EIGENVALUE  4.63525486768e-07
RHO EIGENVALUE  9.47997510504e-06
RHO EIGENVALUE  3.41110134332e-05
RHO EIGENVALUE  3.41647650365e-05
RHO EIGENVALUE  3.43112778067e-05
RHO EIGENVALUE  0.0391558779965
RHO EIGENVALUE  0.0391641070163
RHO EIGENVALUE  0.0391698857
RHO EIGENVALUE  0.88239631938
Truncation error =  8.19412317742e-07
LEFT-TO-RIGHT ITERATION  6 20 16
Iter =  1  Ener =  -1.46249446755
Iter =  2  Ener =  -2.55264913785
Iter =  3  Ener =  -3.41994571188
Iter =  4  Ener =  -3.84209545045
Iter =  5  Ener =  -4.06226404346
Iter =  6  Ener =  -4.15681276239
Iter =  7  Ener =  -4.20508813937
Iter =  8  Ener =  -4.23626003491
Iter =  9  Ener =  -4.25143950109
Iter =  10  Ener =  -4.25703249664
Iter =  11  Ener =  -4.25786934481
Iter =  12  Ener =  -4.25799960725
Iter =  13  Ener =  -4.2580223564
Iter =  14  Ener =  -4.25802710424
Iter =  15  Ener =  -4.2580282066
Iter =  16  Ener =  -4.25802838606
Iter =  17  Ener =  -4.25802841124
E0 =  -4.25802841124
RHO EIGENVALUE  -6.10538506859e-17
RHO EIGENVALUE  -3.97994038289e-18
RHO EIGENVALUE  -1.37342340947e-18
RHO EIGENVALUE  -2.2483147354e-19
RHO EIGENVALUE  -5.53879001066e-20
RHO EIGENVALUE  -1.13738770328e-20
RHO EIGENVALUE  -4.46495372454e-21
RHO EIGENVALUE  -7.67057428103e-22
RHO EIGENVALUE  5.1534808019e-20
RHO EIGENVALUE  2.71113200387e-19
RHO EIGENVALUE  6.59457596793e-19
RHO EIGENVALUE  1.28777159474e-18
RHO EIGENVALUE  0.000185228741827
RHO EIGENVALUE  0.000185736319616
RHO EIGENVALUE  0.000186109182298
RHO EIGENVALUE  0.000186193230433
RHO EIGENVALUE  0.00202563758942
RHO EIGENVALUE  0.00202724670848
RHO EIGENVALUE  0.497562312955
RHO EIGENVALUE  0.497641535273
Truncation error =  -6.63813917317e-17
RIGHT-TO-LEFT ITERATION  1 20 8
Iter =  1  Ener =  -1.92212121947
Iter =  2  Ener =  -2.79489029124
Iter =  3  Ener =  -3.3123465457
Iter =  4  Ener =  -3.83867495031
Iter =  5  Ener =  -3.98326535104
Iter =  6  Ener =  -4.0601538773
Iter =  7  Ener =  -4.1746681408
Iter =  8  Ener =  -4.23537542241
Iter =  9  Ener =  -4.25422328103
Iter =  10  Ener =  -4.25756671961
Iter =  11  Ener =  -4.25798199913
Iter =  12  Ener =  -4.25802497134
Iter =  13  Ener =  -4.25802768389
Iter =  14  Ener =  -4.25802808545
Iter =  15  Ener =  -4.25802828983
Iter =  16  Ener =  -4.25802837274
E0 =  -4.25802837274
RHO EIGENVALUE  0.0306009339058
RHO EIGENVALUE  0.0306194552539
RHO EIGENVALUE  0.0306412799572
RHO EIGENVALUE  0.908138330883
Truncation error =  0.0
RIGHT-TO-LEFT ITERATION  2 20 4
Iter =  1  Ener =  -1.33275015899
Iter =  2  Ener =  -2.55619323725
Iter =  3  Ener =  -3.10069575953
Iter =  4  Ener =  -3.44972183078
Iter =  5  Ener =  -3.72815968424
Iter =  6  Ener =  -3.86818600857
Iter =  7  Ener =  -3.92871338992
Iter =  8  Ener =  -3.97597519323
Iter =  9  Ener =  -4.03690252355
Iter =  10  Ener =  -4.16534240165
Iter =  11  Ener =  -4.24121240809
Iter =  12  Ener =  -4.25609863356
Iter =  13  Ener =  -4.25782889177
Iter =  14  Ener =  -4.25800770497
Iter =  15  Ener =  -4.25802605209
Iter =  16  Ener =  -4.25802789252
Iter =  17  Ener =  -4.25802822287
Iter =  18  Ener =  -4.2580283165
E0 =  -4.2580283165
RHO EIGENVALUE  0.000185143623989
RHO EIGENVALUE  0.000185673202304
RHO EIGENVALUE  0.000185992593001
RHO EIGENVALUE  0.000186521374319
RHO EIGENVALUE  0.00202665258691
RHO EIGENVALUE  0.00202983542623
RHO EIGENVALUE  0.497261734023
RHO EIGENVALUE  0.49793844717
Truncation error =  0.0
RIGHT-TO-LEFT ITERATION  3 20 8
Iter =  1  Ener =  -0.95310673237
Iter =  2  Ener =  -2.30387827825
Iter =  3  Ener =  -3.27355975417
Iter =  4  Ener =  -3.79513137044
Iter =  5  Ener =  -4.05861999208
Iter =  6  Ener =  -4.14497006161
Iter =  7  Ener =  -4.18536231319
Iter =  8  Ener =  -4.22871259035
Iter =  9  Ener =  -4.25122208997
Iter =  10  Ener =  -4.25657665111
Iter =  11  Ener =  -4.25767765096
Iter =  12  Ener =  -4.25794255122
Iter =  13  Ener =  -4.25801313273
Iter =  14  Ener =  -4.25802897752
Iter =  15  Ener =  -4.25803114229
Iter =  16  Ener =  -4.25803146901
Iter =  17  Ener =  -4.25803150628
E0 =  -4.25803150628
RHO EIGENVALUE  7.16479191158e-08
RHO EIGENVALUE  7.21003014656e-08
RHO EIGENVALUE  7.24384255307e-08
RHO EIGENVALUE  7.40970543181e-08
RHO EIGENVALUE  7.4167171091e-08
RHO EIGENVALUE  4.55365603035e-07
RHO EIGENVALUE  4.59280945459e-07
RHO EIGENVALUE  4.62983987888e-07
RHO EIGENVALUE  9.46203043804e-06
RHO EIGENVALUE  3.41586978461e-05
RHO EIGENVALUE  3.42054739324e-05
RHO EIGENVALUE  3.42445500487e-05
RHO EIGENVALUE  0.0391478449466
RHO EIGENVALUE  0.0391526289111
RHO EIGENVALUE  0.0391586977857
RHO EIGENVALUE  0.882427015523
Truncation error =  8.19816474556e-07
RIGHT-TO-LEFT ITERATION  4 20 16
Iter =  1  Ener =  -0.795445921687
Iter =  2  Ener =  -2.23910274363
Iter =  3  Ener =  -3.1529989682
Iter =  4  Ener =  -3.7371884752
Iter =  5  Ener =  -4.03268685516
Iter =  6  Ener =  -4.1534306318
Iter =  7  Ener =  -4.20775936531
Iter =  8  Ener =  -4.23166833396
Iter =  9  Ener =  -4.24534173724
Iter =  10  Ener =  -4.25308054371
Iter =  11  Ener =  -4.25646970466
Iter =  12  Ener =  -4.25765756412
Iter =  13  Ener =  -4.25794481229
Iter =  14  Ener =  -4.25800857093
Iter =  15  Ener =  -4.25802433348
Iter =  16  Ener =  -4.25802794503
Iter =  17  Ener =  -4.25802870506
Iter =  18  Ener =  -4.25802887169
Iter =  19  Ener =  -4.25802891159
E0 =  -4.25802891159
RHO EIGENVALUE  1.95330103338e-11
RHO EIGENVALUE  3.36831518538e-11
RHO EIGENVALUE  6.63083749743e-11
RHO EIGENVALUE  8.38751277316e-11
RHO EIGENVALUE  2.14931905983e-09
RHO EIGENVALUE  2.68819893854e-09
RHO EIGENVALUE  2.93468363403e-08
RHO EIGENVALUE  3.39216442654e-08
RHO EIGENVALUE  3.54233656023e-08
RHO EIGENVALUE  3.72140509176e-08
RHO EIGENVALUE  3.91308296268e-07
RHO EIGENVALUE  4.08436375692e-07
RHO EIGENVALUE  0.000272906579987
RHO EIGENVALUE  0.000273996458402
RHO EIGENVALUE  0.00027466006726
RHO EIGENVALUE  0.000274762760591
RHO EIGENVALUE  0.00286599908564
RHO EIGENVALUE  0.00286819104061
RHO EIGENVALUE  0.496563017523
RHO EIGENVALUE  0.496605525793
Truncation error =  1.40946814789e-07
RIGHT-TO-LEFT ITERATION  5 20 20
Iter =  1  Ener =  -1.12217506908
Iter =  2  Ener =  -2.3956824749
Iter =  3  Ener =  -3.12711277966
Iter =  4  Ener =  -3.56578228981
Iter =  5  Ener =  -3.84353581798
Iter =  6  Ener =  -3.93720836374
Iter =  7  Ener =  -3.99310293964
Iter =  8  Ener =  -4.05367446244
Iter =  9  Ener =  -4.1570081779
Iter =  10  Ener =  -4.22796023646
Iter =  11  Ener =  -4.2510773991
Iter =  12  Ener =  -4.2568918522
Iter =  13  Ener =  -4.25779339258
Iter =  14  Ener =  -4.25799007566
Iter =  15  Ener =  -4.25802190367
Iter =  16  Ener =  -4.25802938578
Iter =  17  Ener =  -4.25803113742
Iter =  18  Ener =  -4.25803146509
Iter =  19  Ener =  -4.2580315085
E0 =  -4.2580315085
RHO EIGENVALUE  -2.40164312377e-18
RHO EIGENVALUE  -2.16112997627e-20
RHO EIGENVALUE  -6.61256997768e-21
RHO EIGENVALUE  9.95142705423e-20
RHO EIGENVALUE  7.31251243696e-08
RHO EIGENVALUE  7.41611898897e-08
RHO EIGENVALUE  7.45194051311e-08
RHO EIGENVALUE  7.480363981e-08
RHO EIGENVALUE  7.56835109032e-08
RHO EIGENVALUE  4.57104822962e-07
RHO EIGENVALUE  4.59597722469e-07
RHO EIGENVALUE  4.64841832623e-07
RHO EIGENVALUE  9.44974021141e-06
RHO EIGENVALUE  3.40994360646e-05
RHO EIGENVALUE  3.42645475916e-05
RHO EIGENVALUE  3.42842631702e-05
RHO EIGENVALUE  0.0391596237914
RHO EIGENVALUE  0.0391655168894
RHO EIGENVALUE  0.0391745603737
RHO EIGENVALUE  0.882386447121
Truncation error =  8.29397693063e-07
RIGHT-TO-LEFT ITERATION  6 16 20
Iter =  1  Ener =  -1.45657734249
Iter =  2  Ener =  -2.63041414074
Iter =  3  Ener =  -3.33654457501
Iter =  4  Ener =  -3.67446056243
Iter =  5  Ener =  -3.81953633083
Iter =  6  Ener =  -3.88651626923
Iter =  7  Ener =  -3.91673293114
Iter =  8  Ener =  -3.92736486491
Iter =  9  Ener =  -3.93147077365
Iter =  10  Ener =  -3.95251709122
Iter =  11  Ener =  -4.18302696811
Iter =  12  Ener =  -4.245427654
Iter =  13  Ener =  -4.25588105369
Iter =  14  Ener =  -4.25755285759
Iter =  15  Ener =  -4.25794292985
Iter =  16  Ener =  -4.25801352701
Iter =  17  Ener =  -4.25802393455
Iter =  18  Ener =  -4.25802609257
Iter =  19  Ener =  -4.25802746613
Iter =  20  Ener =  -4.25802821891
Iter =  21  Ener =  -4.25802839585
Iter =  22  Ener =  -4.2580284176
E0 =  -4.2580284176
RHO EIGENVALUE  -5.13370127552e-18
RHO EIGENVALUE  -7.46566422189e-19
RHO EIGENVALUE  -4.40083166632e-19
RHO EIGENVALUE  -8.1189794009e-20
RHO EIGENVALUE  -1.07299626252e-20
RHO EIGENVALUE  -2.19121482723e-21
RHO EIGENVALUE  3.74012610711e-20
RHO EIGENVALUE  1.09764255428e-19
RHO EIGENVALUE  5.29058552692e-19
RHO EIGENVALUE  1.35364228342e-18
RHO EIGENVALUE  2.18197629279e-18
RHO EIGENVALUE  2.98795119678e-17
RHO EIGENVALUE  0.000185116085728
RHO EIGENVALUE  0.000185836411887
RHO EIGENVALUE  0.000186151861082
RHO EIGENVALUE  0.000186299930401
RHO EIGENVALUE  0.00202593716227
RHO EIGENVALUE  0.00202747866275
RHO EIGENVALUE  0.497564724179
RHO EIGENVALUE  0.497638455707
Truncation error =  -4.3845954832e-18

In [ ]:


In [ ]:


In [ ]: