Any contraction orders available out of the box in itensor?

Hi everyone, I am fairly new to itensor and have been facing issues in solving tensor networks with large numbers of tensors. These networks are defined with individual tensors connected with a index map. I am facing issues in running it for larger system sizes. I had 2 questions:

  1. Are there ways I can play with this order out-of-the-box in iTensor i.e. any way to experiment with different contraction algorithms like greedy, optimal etc? Something similar to TensorNetwork/tensornetwork/contractors/opt_einsum_paths/path_contractors.py at master · google/TensorNetwork · GitHub would be great!
  2. Does changing between defining tensor network as a collection of tensors and index map, differ in performance with using MPS/MPOs?

Specifically, I am trying to solve TNs with different prameterized sizes. For a problem of size n=4, the network is defined as:

x_tensors = [x1, x2, x3, x4] # MPS states
data_indices = [index_map["x1_dim0"], index_map["x2_dim0"], index_map["x3_dim0"], index_map["x4_dim0"]] # MPS state indexes
free_indices = [index_map["R_2_0__dim2"], index_map["R_2_1__dim3"], index_map["R_2_2__dim3"], index_map["R_2_3__dim3"]]  # Output indexes from the last MPO attached on the MPS

# Define the network excluding data tensors
network_base = [
    H__x1_x2__, H__x2_x3__, H__x3_x4__, # Tensors that form the first MPO attached on the MPS
    R_0_0_, R_0_1_, R_0_2_, R_0_3_, # Tensors that form the second MPO
    R_1_0_, R_1_1_, R_1_2_, R_1_3_, # Tensors that form the third MPO
    R_2_0_, R_2_1_, R_2_2_, R_2_3_ # Tensors that form the fourth MPO

]

I take this base network and add the x_tensors into it to create the final tensor network. I am trying to use contract this tensor network. By default I call

        T = contract(network; cutoff=1e-6)

For a larger “n” like 10, this network contraction faces OOM error and is killed by OS. I also tried:

sequence1 = optimal_contraction_sequence(network)
cost = contraction_cost(network; sequence = sequence1)
T = contract(network; sequence = sequence1)

Here code seems to take forever in optimal_contraction_sequence calculation. But I know this network can be reasonable solved with a greedy contraction ordering. Can I easily experiment with different algorithms?

We are working on that in ITensorNetworks.jl, we have a number of contraction sequence optimization backends available including optimal and greedy, you can try it out there but please note the warning in the README.