TDVP slow significant slowdown after N=5 qubits

Hi, I’m trying to evolve an N-qubit GHZ state undergoing a Lindbladian. My code runs really fast for up to N=5 qubits, but hits a significant wall past this for the TDVP step. I wasn’t expecting this since the Schmidt rank for a GHZ state is 2, and this channel shouldn’t grow the entanglement entropy. Using ITensor.MPS version v0.3.25, and ITensors.jl version v0.9.15 on an M2 Mac.
I have included the relevant code snippet:

BLAS.set_num_threads(1)
ITensors.Strided.set_num_threads(1)
function linevolve(N::Int, t1, t2, p)
    total_sites = 2 * N
    sites_orig = siteinds("Qubit", total_sites)
    gamma = p * (t1 + t2) 
    
    # Lindbladian OpSum
    os = OpSum()
    for j in 1:2:total_sites
        os += 1im*t1, "Z", j;   os += -1im*t1, "Z", j+1
        os += 1im*t2, "X", j;   os += -1im*t2, "X", j+1
        os += gamma, "Z", j, "Z", j+1; os += -gamma, "Id", j, "Id", j+1
    end
    
    L_mpo = combine_sites(MPO(os, sites_orig), sites_orig)
    L_indices = siteinds(L_mpo)
    
    # Prepare initial probe state with strict truncation
    s_temp = siteinds("Qubit", N)
    probe = productMPS(s_temp, fill("0", N))
    gates = [op("H", s_temp[1]); [op("CNOT", s_temp[j], s_temp[j+1]) for j in 1:(N-1)]]
    rho_pure = apply(gates, probe; cutoff=1e-8, maxdim=4)
    
    # Safely build density matrix and convert to superket
    rho_mpo = outer(rho_pure', rho_pure)
    temp_combiners = [combiner(siteinds(rho_mpo)[j]...; tags="Temp,n=$j") for j in 1:N]
    rho_mps = convert_MPO_to_superket(rho_mpo, temp_combiners)
    
    # Swap to the Lindbladian's combined indices
    rho_tensors = map(1:N) do j
        replaceind(rho_mps[j], combinedind(temp_combiners[j]), L_indices[j][1])
    end
    dynamic_sweeps = 4 * N
    
    return tdvp(L_mpo, 1.0, MPS(rho_tensors); 
    nsteps=dynamic_sweeps, 
    maxdim=4,nsite=1,
    cutoff=1e-8, 
    normalize=true,
    updater_kwargs=(; ishermitian=false, tol=1e-5, krylovdim=30, maxiter=100))
end

Any help would be great!

The code is running slowly because you are representing a pure state (pure density matrix) as an MPO. This is happening when you use the function outer. While outer is a convenient function to have for some checks, it may be something we should remove or have it print a warning when users call it, because if the input MPS has a bond dimension \chi then the MPO it outputs will have a bond dimension \chi^2 which can lead to very high costs for later steps.

Depending on the details of the evolution you are trying to study, I would recommend a different approach such as starting with a different initial state or using the “LPDO” ansatz for your density matrix. However, we do not have “black box” algorithms for formats such as LDPO. In general, the algorithms for open systems with tensor networks are still in a somewhat rather exploratory state.

Thanks @miles ! After a closer look, it turns out the combine_sites function I wrote was really inefficient, causing the bottleneck. I was able get this to run on my laptop for several hundred qubits now. But I will keep that in mind next time when using outer.

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