ITensor / ITensor/ITensorNetworks.jl
Simplify `projected_operator_tensors` by using `post_order_dfs_vertices`
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 128
- Forks
- 23
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 7
Description
In #132, the function projected_operator_tensors is introduced to get the tensors that constitute the tree tensor network operator being projected onto a region of the network, which is then used to apply the projected operator as a map to perform algorithms like DMRG.
The ordering of the tensors determines the contraction order in contract, but the code logic for determining the ordering is quite complicated right now. Since the projected TTNO should just be a smaller TTNO on the region of the network (including caps that are the environments/message tensors entering the region), it seems like a simpler way to write it would be to collect the tensors as a TTN with region_operator_ttn = TTN([operator(P)[s] for s in sites(P)]) and then determine the order with post_order_dfs_vertices(region_operator_ttn).
Even better would be to use the function contraction_sequence and detect if the input is a TTN and then use a sequence based on post_order_dfs_vertices, or using a specialized algorithm like ^1, and then that functionality could generalize to other graph structures.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with projected_operator_tensors and the existing ordering logic, then read post_order_dfs_vertices, TTN construction, contract, and contraction_sequence. Compare the proposed region_operator_ttn approach with the current behavior, including environment or message tensors entering the region. Done means the ordering logic is simplified while preserving the projected operator's contraction behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100