Skip to content
Discussion options

You must be logged in to vote

Here is a sample code to obtaining a "good" MPS ordering. We first generate a sample tensor network with 3-regular graph topology, which has one tensor in each edge, and each tensor has rank 2 (this is for demonstration purpose, OMEinsumContractionOrders has not such constraint).

julia> using OMEinsumContractionOrders, Graphs

julia> rg3 = Graphs.random_regular_graph(100, 3; seed=42);  # graph topology

julia> code = OMEinsumContractionOrders.EinCode([[e.src, e.dst] for e in edges(rg3)], Int[]);  # one tensor for each edge

Then we optimize the path decomposition for the sample tensor network:

julia> optcode = optimize_code(code, uniformsize(code, 2), PathSA());

julia> contraction_complexity

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@RaimelMedina
Comment options

@GiggleLiu
Comment options

@RaimelMedina
Comment options

@GiggleLiu
Comment options

@RaimelMedina
Comment options

Answer selected by RaimelMedina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants