-
Notifications
You must be signed in to change notification settings - Fork 23
Generic Boundary Matrix Product States Contraction Code #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… into BoundaryMPS
This reverts commit a028422.
mtfishman
reviewed
Jan 10, 2025
mtfishman
reviewed
Jan 10, 2025
mtfishman
reviewed
Jan 10, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds code for doing boundary matrix product state contraction techniques in ITensorNetworks using a 1-site MPS fitting procedure. The result is the ability to do efficient, controlled approximate contractions of 2D and quasi-2D tensor networks.
The
BeliefPropagationCachehas been separated into anAbstractBeliefPropagationCacheand the concrete subtypesBeliefPropagationCacheandBoundaryMPSCachein order to achieve this in a streamlined way.The
bmpsc::BoundaryMPSCacheis anAbstractBeliefPropagationCachewhich wraps abpc::BeliefPropagationCache, an added layer of partitioning around thepartitioned_tensornetworkinBeliefPropagationCacheand themaximum_virtual_dimensionwhich indicates the maximum permissible size of the virtual links between message tensors.The underlying
partitioned_tensornetworkin theBeliefPropagationCacheis assumed to form a grid with only horizontal and vertical edges. Typically vertices are expected to be labeled as integer tuples(column, row)so that edges are of the form(column, row) => (column +- 1, row)or(row, column) => (column, row +-1). Either the rows or the columns can then be partitioned up using thegrouping_functionkwarg for the constructor (default is the columns). As an 'expert mode', Arbitrary vertex names are actually supported provided the user tells the code how to partition them corresponding planar graph up into a line / ring and then how to sort the vertices within each partition so they go in ascending / descending order.The message tensors in the
BeliefProgpationCachewhich live between the row/column partitions carry an additional virtual index and thus connect up to form an implicitMPSbetween partitions.Functionality for moving the biorthogonal and orthogonal gauge within this implicit
MPSis supported and the 1-site boundary MPS routine follows naturally by appropriate ordering of gauge moves and calls tomessage_update(bp_cache(bmpsc, pe::PartitionEdge)).Tests are added which show some of the generality of this code (works immediately for complex numbers and real numbers, norm networks and flat tensor networks, on a range of lattices such as hexagonal lattices, square lattices, comb trees etc). The code also immediately works for half-periodic systems where the doubly partitioned network forms a ring and effectively makes the BP approximation on the ring (along with the approximation from the rank of the MPS).
Note this code can be leveraged to do powerful things things like approximately contract "quasi-3D" tensor networks simply by passing a belief propagation cache which partitions up such a network into a flat 2D structure.
Currently the
orthogonalgauge is used as default for the MPS fitting as it is stable and robust. Thebiorthogonalgauge is working but more sensitive to things like the initial message tensors used, the details of the SVD and the ordering ofpartitionedgeupdates. Work will need to be done to figure out how to stabilize it.A number of further improvements are possible.
n-siteMPS fitting which might help the biorthogonal stability.channelsand efficiently compute more complicated derivatives of the tensor network (currentlyenvironment(bmpsc::BoundaryMPSCache, verts::Vector)) is only supported for contiguous vertices which lie in the same column/ row partition.@mtfishman @emstoudenmire