Explicitly Limiting the Bond Dimension of MPO upon Construction

Hello,

I am wondering in general if we can limit the bond dimension of an MPO upon its construction. I am interested in this because my MPO currently takes up far too much memory to be used efficiently. I suspect the bond dimension of my MPO could be greatly reduced with little cost in accuracy.

Here is my code. I use Opsum to make my MPO. I put in a cutoff paramter, but it is unclear to me how well this is working and I would prefer to limit bond dimension by specifying the number of bonds I would like to keep.

os = OpSum()

    for i in 1:N, j in 1:N
        if t[i,j] == 0
            continue
        end
        ops = Any[]
        push!(ops, t[i,j])
        push!(ops, "Cdag", i, "C", j)

        os .+= Tuple(ops)
    end

    for i in 1:N, j in 1:N, k in 1:N, l in 1:N
        if Γ_mat[idx2B[i,j],idx2B[k,l]] == 0
            continue
        end
        ops = Any[]
        #println(Γ[i,j,k,l])
        push!(ops, Γ_mat[idx2B[i,j],idx2B[k,l]] * (1/4))
    if i == j
        continue  # c†_i c†_i = 0
    elseif k == l
        continue  # c_k c_k = 0
    else
        push!(ops, "Cdag", i, "Cdag", j, "C", l, "C", k)
    end
        os .+= Tuple(ops)
    end

    println("done")
    H = MPO(os, sites; cutoff = 1e-15)

I would also add that a big problem is: in the process of making my MPO, before final compression is initiated, the MPO takes up more ram than I have. I suspect this will not be the case when the MPO is fully built and compressed, and I would like ITensor to compress more aggressively during construction.

You should be able to use MPO(os, sites; cutoff=1e-15, maxdim=100) to fix the maximum bond dimension, but I don’t know if this will actually help. You could also consider using a library I wrote, ITensorMPOConstruction, which is much more capable. It takes a tolerance, but not a maxdim parameter. I suspect if you use that library you’ll have no trouble constructing the MPO outright, and you can perform truncation after the fact. But unless there is some unseen structure to Γ_mat, I suspect truncation won’t help much.

The example looks a lot like the electronic structure Hamiltonian, for which I can construct the MPO for 90 spin-orbitals (N = 180 in the example above) in around an hour on my M1 MacBook Pro with 32GB.

1 Like

Agreed that @corbett5 's library ITensorMPOConstruction is currently the best solution for very large and challenging MPO construction, such as quantum chemistry Hamiltonians. We are working to improve the native ITensor one but it is still under development.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.