void syten::BTT::DMRG::Run::update_rec | ( | Operator::Ptr | optr, |
State::Ptr | pptr, | ||
Ctrs::Ptr | cptr, | ||
Index & | count, | ||
Timer & | timer | ||
) |
Updates a subtree recursively.
The algorithm first descends into the left branch, updating all sites on the way and normalising them to point towards the left branch. While ascending back up, it updates the sites again and root-normalises them. Then the right subtree is updated by the same scheme. When the state is drawn as a tree, the algorithm walks around the edge of the tree and updates each site while passing it.
1 / \ 2 3 / \ / \ 4 5 6 7 / \ / \ | / \ 8 9 A B C D E | | | | | | | F G H I J K L Calling update_rec(1, 1, 1)
then updates the sites in this order: 1, 2, 4, 8, F, 8, 4, 9, G, 9, 4, 2, 5, A, H, A, 5, B, I, B, 5, 2, 1, 3, 6, C, J, C, 6, 3, 7, D, K, D, 7, E, L, E, 7, 3, 1. In particular, note how sites 8, 9, A, B, 6, C, D and E are updated twice (as non-branching nodes), sites F, G, H, I, J, K and L are updated once (since they’re leaves) and all branching nodes (1, 2, 3, 4, 5, 7) are updated thrice.
References logTrace(), syten::Signals::receivedINTR, syten::Signals::receivedTERM, and SYTEN_ASSERT_DEBUG.
Referenced by sweep().