{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/on-the-optimal-linear-contraction-order-for","title":"On the Optimal Linear Contraction Order of Tree Tensor Networks, and Beyond","arxiv_id":"2209.12332","date":"2022-09-25","proceeding":null,"authors":["Mihail Stoian","Richard Milbradt","Christian B. Mendl"],"abstract":"The contraction cost of a tensor network depends on the contraction order. However, the optimal contraction ordering problem is known to be NP-hard. We show that the linear contraction ordering problem for tree tensor networks admits a polynomial-time algorithm, by drawing connections to database join ordering. The result relies on the adjacent sequence interchange property of the contraction cost, which enables a global decision of the contraction order based on local comparisons. Based on that, we specify a modified version of the IKKBZ database join ordering algorithm to find the optimal tree tensor network linear contraction order. Finally, we extend our algorithm as a heuristic to general contraction orders and arbitrary tensor network topologies.","url_abs":"https://arxiv.org/abs/2209.12332v5","url_pdf":"https://arxiv.org/pdf/2209.12332v5.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"on-the-optimal-linear-contraction-order-for","repo_url":"https://github.com/stoianmihail/netzwerk","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2209.12332","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2209.12332"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/stoianmihail/netzwerk","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":14},"by_repo_kind":{"official":{"samples":14,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"891555ff681d4053","entry":"fetch_abs_path","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/wrapper.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/wrapper.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"891555ff681d4053"}},{"code_sha256_prefix":"448d0f07e218295b","entry":"general_st","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/spanning_tree.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/spanning_tree.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"448d0f07e218295b"}},{"code_sha256_prefix":"d4c10b96da92e57d","entry":"get_config_from_root","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/versioneer.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/versioneer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d4c10b96da92e57d"}},{"code_sha256_prefix":"655afd2b175f5391","entry":"get_files","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/util.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"655afd2b175f5391"}},{"code_sha256_prefix":"1c5eef2d84b8d817","entry":"min_degree_spanning_tree","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/spanning_tree.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/spanning_tree.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1c5eef2d84b8d817"}},{"code_sha256_prefix":"43bbe34d2353f122","entry":"parse_filename","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/util.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"43bbe34d2353f122"}},{"code_sha256_prefix":"b77562811e12351b","entry":"parse_line","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/util.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/util.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b77562811e12351b"}},{"code_sha256_prefix":"2c7f89a171977b2c","entry":"random_int","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"gen.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2c7f89a171977b2c"}},{"code_sha256_prefix":"32719c8f68566aa3","entry":"random_leg_dim","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"gen.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/gen.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"32719c8f68566aa3"}},{"code_sha256_prefix":"0e877c22a3d08770","entry":"read_file","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/spanning_tree.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/spanning_tree.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0e877c22a3d08770"}},{"code_sha256_prefix":"c55cafde08716f01","entry":"register_vcs_handler","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/_version.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/_version.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c55cafde08716f01"}},{"code_sha256_prefix":"9dc618d67058e3e6","entry":"register_vcs_handler","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/versioneer.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/versioneer.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9dc618d67058e3e6"}},{"code_sha256_prefix":"dbb37355631dabcf","entry":"run_command","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/_version.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/_version.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dbb37355631dabcf"}},{"code_sha256_prefix":"5032e3b81c0fffb3","entry":"versions_from_parentdir","repo":"stoianmihail/netzwerk","repo_kind":"official","path":"src/netzwerk/_version.py","file_url":"https://github.com/stoianmihail/netzwerk/blob/HEAD/src/netzwerk/_version.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5032e3b81c0fffb3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}