-
Notifications
You must be signed in to change notification settings - Fork 14
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
Generic Boundary Matrix Product States Contraction Code #212
Open
JoeyT1994
wants to merge
53
commits into
ITensor:main
Choose a base branch
from
JoeyT1994:BoundaryMPS
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
BeliefPropagationCache
has been separated into anAbstractBeliefPropagationCache
and the concrete subtypesBeliefPropagationCache
andBoundaryMPSCache
in order to achieve this in a streamlined way.The
bmpsc::BoundaryMPSCache
is anAbstractBeliefPropagationCache
which wraps abpc::BeliefPropagationCache
, an added layer of partitioning around thepartitioned_tensornetwork
inBeliefPropagationCache
and themaximum_virtual_dimension
which indicates the maximum permissible size of the virtual links between message tensors.The underlying
partitioned_tensornetwork
in theBeliefPropagationCache
is 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_function
kwarg 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
BeliefProgpationCache
which live between the row/column partitions carry an additional virtual index and thus connect up to form an implicitMPS
between partitions.Functionality for moving the biorthogonal and orthogonal gauge within this implicit
MPS
is 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
orthogonal
gauge is used as default for the MPS fitting as it is stable and robust. Thebiorthogonal
gauge is working but more sensitive to things like the initial message tensors used, the details of the SVD and the ordering ofpartitionedge
updates. Work will need to be done to figure out how to stabilize it.A number of further improvements are possible.
n-site
MPS fitting which might help the biorthogonal stability.channels
and 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