Best ways to solve arbitary tensor networks?

Hi, I am developing a system that compiles problems to iTensor code in Julia. The generated network is a collection of mps and mpos multiplied together, which have ~100 tensors.
I am currently trying to figure out the best ways to contract this tensor network automatically. A simple run of:
T = contract(network)
This operation is killed by OS. Probably because of OOM issues as a bad contraction order can result in output of size up to 10^{10}. But even without using SVD-based approximations, this problem can be solved with temporaries of just size 10*2^{10} with a better contraction order.
Now I am trying:
sequence1 = optimal_contraction_sequence(network)
cost = contraction_cost(network; sequence = sequence1)
T = contract(network; sequence = sequence1)
But this seems to be taking some time. Previously while using GitHub - google/TensorNetwork: A library for easy and efficient manipulation of tensor networks. library a greedy contraction order worked well for this problem. Are there any alternate ways to explore different contraction orders with iTensor?

Also, without implementing the entire compilation stack again, can someone help me understand if the TN performance would change with iTensor if I stop compiling to arbitrary tensors that are just connected together, to using the MPS and MPOs instead to build the network in iTensor?

It’s interesting to hear this. I believe Matt already answered some of your question on the other thread. For your question about using MPS and MPO structures versus just tensor contractions, I think that could be a promising idea but you would need to implement a lot of it yourself. Meaning that if you identify part of your network as an MPS and part as an MPO, you would need to explicitly identify that case in your code then call the appropriate MPO*MPS contraction routine for that part. We offer various MPO*MPS contraction backends that you could use for that purpose.