Quantum Compression of Tensor Network States

We design quantum compression algorithms for parametric families of tensor network states. We first establish an upper bound on the amount of memory needed to store an arbitrary state from a given state family. The bound is determined by the minimum cut of a suitable flow network, and is related to the flow of information from the manifold of parameters that specify the states to the physical systems in which the states are embodied. For given network topology and given edge dimensions, our upper bound is tight when all edge dimensions are powers of the same integer. When this condition is not met, the bound is optimal up to a multiplicative factor smaller than 1.585. We then provide a compression algorithm for general state families, and show that the algorithm runs in polynomial time for matrix product states.


I. INTRODUCTION
Quantum data compression [1,2] is one of the pillars of quantum information theory. At the foundational level, it establishes the qubit as the basic unit of quantum information. At the more practical level, it provides a blueprint for the efficient transmission of quantum data in future quantum communication networks, with applications to distributed quantum computing [3] and quantum cloud computing [4].
The ultimate limit for compressing sequences of independently prepared quantum states was initially established in the pure state case [1] and later extended to mixed states [5][6][7]. Universal compression protocols for the scenario where the average state of each system is unknown, except for an upper bound on its von Neumann entropy, were provided in Ref. [8]. In recent years, there has been an interest in developing compression protocols for identically prepared systems [9][10][11][12][13]. Such systems occur in a wide range of tasks, including quantum tomography [14,15], quantum cloning [16,17], estimation [18,19], and quantum machine learning [20]. Compression protocols for identically prepared systems have found applications in quantum metrology [21] and inspired new results in quantum state estimation [22]. An instance of compression for identically prepared systems was experimentally demonstrated in Ref. [23].
Most of the existing compression protocols assume that the input systems are in a product state. However, many relevant scenarios involve correlated systems, whose state cannot be expressed as a tensor product of single-system states. The ability to store correlated states into a smaller amount of quantum bits is important for the simulation of many-body quantum systems on small and medium-size quantum computers. For example, Kraus et al. showed that log n qubits are enough to simulate several families of n-qubit many-body states [24][25][26]. In particular, the result of Ref. [24] led to an experimental simulation of a 32-spin Ising chain using only 5 qubits [27]. In addition to quantum simulations, many-body states are relevant to quantum metrology, where they can serve as probes for unknown quantum processes [28,29]. In this context, compression protocols for many-body states could be useful to transmit such probes from one location to another, or to store them in a quantum memory until further processing is required.
First, we provide an efficiently computable upper bound of the number of qubits required to compress unknown states from a given parametric family of tensor network states. The upper bound can be interpreted as a bottleneck for the information flow from the parameters specifying the states to the physical systems in which the states are embodied. For the family of all tensor network states with given network topology and given edge dimensions, this upper bound is tight whenever all the edge dimensions are powers of the same integer. In general, the upper bound is tight up to a multiplicative factor of at most log 3 ≈ 1.585.
Second, we design a quantum algorithm that implements the compression protocol, and we show that the algorithm runs in polynomial time for families of MPSs. For more general state families, we provide sufficient conditions for the algorithm to run in polynomial time. Informally, the conditions express the fact that the linear span of the state family contains a "sufficiently dense", yet polynomial-size set of states that can be efficiently prepared on a quantum computer.
One of the state families considered in our paper involves translationally invariant MPSs [33], hereafter abbreviated as TIMPS. We show that a completely unknown TIMPS of n identical systems with given bond dimension can be compressed without errors into a number of logical qubits growing at most as O(log n). Our result enables a compressed simulation of various models of many-body quantum states, such as the one-dimensional Ising model [39] and the AKLT model [40]. The logarithmic scaling of the total memory is optimal, as the set of TIMPSs includes the set of all identically prepared states, for which the optimal compression protocol is known to require Ω(log n) memory qubits, both for exact [11] and approximate compression protocols [12,13]. The same result holds for higher dimensional lattices, and for a broader class of tensor network states for which the correlation tensors are site-independent: a generic site-independent n-particle state with a given bond dimension can be perfectly stored into O(log n) logical qubits. We also consider tensor network states with the property that all tensors except those on the boundary are constant. For every subset of systems in the bulk, we show that the exact compression protocol satisfies an area law: the number of logical qubits used to compress the systems in the chosen subset is proportional to the size of its boundary.
This article is structured as follows. In Section II we introduce the graphical notations for tensor networks. In Section III we state our first result on the memory usage of exact compression of tensor network states and apply it to a case-wise study of tensor network state families in Section IV. We extend our results from pure states to marginal and mixed states in Section V. Section VI provides a compression protocol for MPSs with variable boundary conditions, which can be realised by logarithmic-depth circuits explicitly constructed from the description of the MPS. In Section VII we construct a quantum algorithm realising compression protocols for general efficiently preparable states, and discuss its applicability to tensor network states. Finally, we conclude with discussions on how our results can provide bounds for coding theory in Section VIII.

II. PRELIMINARIES
A. Compression of parametric state families Consider a quantum system P with Hilbert space H P , and denote by S(H P ) the set of density operators on H P . Let {ρ x } x∈X ⊆ S(H P ) be a parametric family of quantum states, labeled by a parameter x in a given manifold X. For example, x could be a parameter that determines the Hamiltonian of the system, and ρ x could be the ground state of the Hamiltonian parametrized by x.
Given a parametric family {ρ x } x∈X , the goal of compression is to store the states of the family into a quantum memory M, whose dimension is smaller than the dimension of the initial system P. A compression protocol for the states {ρ x } x∈X is specified by an encoding channel E : S(H P ) → S(H M ), and by a decoding channel D : S(H M ) → S(H P ), where H M denotes the Hilbert space of the quantum memory. Mathematically, the channels are described by completely positive trace-preserving linear maps. Both channels E and D are required to be independent of the parameter x, meaning that the compression operations must work "blindly", without any knowledge of which state is being compressed.
In the following we will consider exact compression protocols, that is, protocols satisfying the condition For pure state families, with ρ x = |Ψ x Ψ x | for all x ∈ X, the simplest compression protocols are defined by isometries V : H in → H M from the input subspace H in := Span{|Ψ x } x∈X ⊆ H P to the memory space H M . An optimal compression protocol is a protocol that uses a memory system whose dimension is exactly d M = dim(H in ). In this case, the isometry V : H in → H M is actually a unitary. In theory, constructing compression protocols for families of pure states is straightforward: one only needs to determine the input subspace H in , and to define an isometry V from H in to a memory space H M ≃ H in . In practice, the efficiency of this construction is an issue. When the input system consists of many particles, constructing the isometry V may be computationally unfeasible, because it requires manipulations of exponentially long vectors. The situation is different when the subspace H in exhibits some specific structure that can be used to efficiently identify it and to construct the encoding operations. An example of this situation is the totally symmetric subspace H sym = Span{|φ ⊗n | |φ ∈ H P }, for which an efficient compression exists [9] and is based on the Schur transform [41,42]. In this paper we will identify other scenarios in which the compression operations can be constructed efficiently, taking advantage of the tensor network structure.

B. Graphical notation for tensors
Here we introduce the graphical notation used in the rest of the paper. Our notation coincides, up to minor changes, with other notations used in the literature on tensor networks [43][44][45].
Vectors and matrices. A vector is represented as a box connected to an open edge. A column vector has an outgoing edge, while a row vector has an ingoing edge. A matrix is represented as a box with both an ingoing edge and an outgoing one. In the following examples, |v is a d-dimensional column vector, v| is the adjoint of |v , v| is the transpose of |v , and A is a d × d matrix.
For a matrix, the place where an arrow is attached to the box matters. Here we assume that the left side of A corresponds to its row index, and the right side its column index. For a vector, the attachment position is unimportant, because the vector has only one index.
Multiplication. An edge connecting two tensors represents a summation over the corresponding index. With this notation, one can conveniently represent multiplications between matrices and vectors.
The outgoing open edge indicates that the result of the multiplication is a column vector. Tensor product. A tensor network with several disconnected components is a tensor product of the components (or an outer product of vectors).
Trace. The trace of a matrix is represented by connecting its two indices: In general, a network with no open edges evaluates to a scalar.
Higher-order tensors. Higher order tensors can describe states and linear operations involving multiple systems. To represent them, one uses boxes with more than two edges. For example, the following graph represents an order-3 tensor T , where {|i }, {|j }, {|k } are orthonormal bases in their corresponding spaces.
We label the edges by i, j and k to indicate their correspondence to the first, second and third index of T , respectively. In the following, the indices will be sometimes omitted in the graphical notation.
Reversal of edges. Multiplication by the unnormalised maximally entangled state |I := i |i |i or its adjoint I| := i i| i| does not alter the elements of a tensor, but it converts a column index to a row index and vice versa.
We represent a multiplication with |I by a reversal of the direction of the arrow involved in the multiplication.
We always assume that the Hilbert space of each edge comes with a default basis, so that for each edge, the maximally entangled state is uniquely defined.
Vectorisation. If we reverse all ingoing edges of a tensor, we obtain a tensor with only outgoing edges, which is a column vector on the tensor product of the Hilbert spaces corresponding to all the edges. For example, In a tensor network, reversing non-open edges does not affect the values assigned to the whole network. For example, for every A, B and |v .

C. Tensor networks
Informally, a tensor network is a set of tensors connected with each others. In the following we introduce a few formal definitions that will become useful later in the paper.
is an oriented 1 graph, with set of vertices V and set of edges E ⊆ V × V • d : E → N + is a function that associates each edge e with an integer d(e), called the dimension of the edge e • V filled ⊂ V is a subset of vertices, called the filled vertices, such that each vertex in V \ V filled is adjacent to one and only one vertex, and that vertex is in V filled .
A tensor network is obtained from a tensor network template by filling all vertices in V filled with tensors: where Temp is a tensor network template, and T is a function mapping filled vertices v ∈ V filled into tensors T (v), with the order of the tensor T (v) equal to the number of edges incident on v. Each edge e incident on a filled vertex represents an index of the corresponding tensor, and the values of the index range from 1 to d(e).
Graphically, we will represent a tensor network as a diagram where the filled vertices are represented by boxes, and the empty vertices V empty := V \ V filled are omitted. An illustration is shown in Figure 1. In the following, we will associate each edge e ∈ E with a Hilbert space H e of dimension d(e). With this notation, the tensor network defines an operator from the total Hilbert space associated to the ingoing edges to the total Hilbert space associated to the outgoing ones: be the set of ingoing (outgoing) edges of a tensor network N , and let H in := e∈Ein H e and H out := e∈Eout H e be the corresponding Hilbert spaces. The tensor network operator of a tensor network N is a linear operator N * : H in → H out obtained from contracting the tensors {T (v)} v∈V filled according to the connections specified by the network template.
For example, the tensor network operator associated to the tensor network in Figure 1 is When a given operator A arises from the contraction of tensors in a tensor network with template Temp, we say that the operator A is compatible with that template: e∈Ein H e → e∈Eout H e is compatible with the template Temp if there exists a tensor network N = (Temp, T ) such that A is the tensor network operator associated to N , namely A = N * .

D. Pure tensor network states
If a tensor network N has only outgoing edges but no ingoing ones, its operator N * is a vector on the tensor product Hilbert space H out . A pure quantum state |Ψ ∈ H out is a tensor network state if its amplitudes are represented by a tensor network, namely, |Ψ = N * for some tensor network N with no ingoing edges.
An example of tensor network states is provided by the matrix product states (MPSs) [32][33][34]. MPSs can be used to represent the ground states of one-dimensional chains of particles with local interactions, including the onedimensional Ising model [39] and the AKLT model [40]. In addition, many MPSs, including the AKLT state, are a resource for measurement-based quantum computation (MBQC) [47].
As an example, consider the class of MPSs with open boundary conditions [33] and assume for simplicity that every physical system in the MPS has the same dimension. Any such MPS is specified by L|A [1] i1 A [2] i2 . . . A
We assume that the norms of the vectors |L and |R are chosen in such a way that the overall vector |Ψ L,R,A [1] ,...,A [n] is normalised. The MPS (11) is described by a tensor network of the following form: where for each k, we regard the set {A i } dp i=1 as an order-3 tensor of dimension d p × d c × d c , denoted as A [k] . The vertical arrows correspond to the physical systems, while horizontal ones correspond to the correlation spaces.
MPSs with periodic boundary conditions [33] are defined by replacing the boundary conditions with the maximally entangled state, as the following: where |I := dc i=1 |i |i represents the unnormalised maximally entangled state. We will sometimes restrict our attention to site-independent MPSs (SIMPS) [33], that is, MPSs where the matrices A i are independent of k. Hence, the set of matrices will be simply denoted as {A i } dp i=1 . In the site-independent case, Equation (11) becomes |Ψ L,R,A = dp i1,...,in=1 SIMPSs with periodic boundary conditions (13) are called translationally invariant MPSs [33], and have the following form.

III. MEMORY BOUND FOR THE STORAGE OF TENSOR NETWORK STATES
In this section we apply the framework of flow networks to bound the amount of memory qubits needed to compress a given family of tensor network states. We illustrate this approach for various families of tensor network states, including MPSs and PEPSs.
A. Parametric families of tensor network states A parametric family of tensor network states is specified by a tensor network where some of the tensors depend on the values of the parameters. For example, consider the following family of SIMPSs with variable boundary conditions for some parameter x ∈ X and some mappings L : x → |L x and R : x → |R x . Here, the vectors |L x and |R x are variable, while the tensor A is fixed. Using vectorisation, the tensor network can be rearranged in such a way that all the variable tensors are column vectors. The tensor product Hilbert space associated to the edges of the variable tensors will be called the parameter Hilbert space and will be denoted by H X . The tensor product Hilbert space associated to all the physical systems in the network will be called the physical Hilbert space and will be denoted by H P .
With the above notation, every parametric family of tensor network states can be represented as where |v x is a vector in H X , N is the tensor network consisting of the fixed tensors, and N * : H X → H P is the tensor network operator associated to N . An example of this parametrisation is provided in the following, where the operator N * arises from the tensor network N inside the dashed frame. It is clear from Equation (17) that the dimension of the input subspace H in = Span{|Ψ x } is upper bounded by the rank of N * . Hence, the (logarithm of the) rank of N * provides an upper bound on the number of qubits needed for the optimal compression. However, the matrix N * may generally have an exponentially large number of columns and rows, and its rank may not be efficiently computable. One way to address this problem is to search for efficiently computable upper bounds on the rank of N * , by inspecting the internal structure of the tensor network N . In the following subsection we will exploit a connection between tensor networks and flow networks to construct useful bounds on the rank of N * , and therefore, on the number of qubits needed for compression.

B. Flow networks and memory bounds
We now provide a construction that associates tensor network templates with flow networks, and provide a memory bound valid for all families of tensor network states with a given template.
A flow network [48] N = (G, c, s, t) consists of a directed graph G = (V, E), with set of vertices V and set of edges E, a function c : E → R 0+ := {x ∈ R | x ≥ 0}, associating each edge e ∈ E with a non-negative number c(e), called its capacity, and two distinguished vertices, s and t, called the source and the sink, respectively.
A flow network can be intuitively understood as a pipe system with edges being pipes and vertices being junctions. Fluid enters in the pipe system from the source s and exits at the sink t. At any time, the flux in each pipe is no more than the capacity of the pipe, while at each junction, the total amount of fluid is conserved, meaning that the total flux going into the junction equals to the total flux going out. This idea is captured by the mathematical notion of flow. A flow f : E → R 0+ in a flow network is an assignment of non-negative numbers to the edges of the network, subject to the conditions 1. for every edge e, the flow is upper bounded by the capacity, namely f (e) ≤ c(e) 2. for every vertex v other than the source and the sink, the total flow entering in the vertex v is equal to the total flow exiting from it, namely u∈V, In the pipe system analogy, f (e) represents the amount of fluid that is flowing through the pipe e.
The value of the flow f , denoted by f s , is the total flow exiting from the source, namely The maximum of f s over all possible flows is called the max-flow of the network, and is denoted as Intuitively, f s represents the maximum amount of fluid that can enter into a pipe system. This amount can be upper bounded by considering that all the fluid entering from the source has to exit from the sink, and, in order to do so, it has to pass through the pipes between the source and the sink. A cut of the flow network is a cross-section of the pipe system that separates the source and the sink. Formally, a cut is a partition of the vertices into two disjoint subsets C s ⊂ V and C t ⊂ V , with s ∈ C s and t ∈ C t . We write the cut as C = (C s , C t ). An edge (u, v) is called a cut edge if u belongs to C s and v belongs to C t .
Since all the fluid entering from the source has to pass through the cut C, the total capacity of the pipes associated to cut edges poses an upper bound to the flux. Explicitly, the capacity of the cut (C s , C t ), denoted as c(C s , C t ) is the sum of the capacities of the cut edges, namely and one has the upper bound for every possible cut (C s , C t ). The best bound is obtained by choosing the cut with minimum capacity. The minimum of the capacity c(C s , C t ) over all possible cuts (C s , C t ) is called the min-cut, and is denoted by The max-flow min-cut theorem states that max-flow( N ) = min-cut( N ) [48]. Intuitively, this shows that the maximum flux a pipe system can carry from s to t is exactly equal to the capacity of the minimal cross-section of the pipes.
An example of a flow network is shown in Figure 2. The analogy of the pipe system will be useful to understand the intuitive content of our results, where we use flow networks to model the "flow of information", rather than the flow of a material fluid. We imagine information flowing into the ingoing edges and out of the outgoing edges of the tensor network, and each edge has a capacity equal to the maximum amount of information it can carry, which is log d(e) qubits for an edge e with dimension d(e). Given a tensor network template, we relate it to a flow network that can be constructed in the following way: Construction 1. Let Temp = (G, d, V filled ) be a tensor network template, and let V empty = V \ V filled the set of empty vertices. The flow network associated to the template Temp, denoted by Temp = ( G, c, s, t), is constructed through the following prescriptions: 1. Add the vertices s and t to V .

Replace each ingoing edge
4. Remove all the vertices in V empty .

For every internal edge
An illustration of the above procedure is provided in Figure 3. Consider the tensor network N = (Temp, T ) associated to the fixed tensors in the given state family {|Ψ x }, and let Temp be the flow associated to the template Temp via Construction 1. Every cut in the flow network Temp defines a factorisation of the operator N * as N * = N 2 * N 1 * , where N 1 * and N 2 * are the operators of the two subnetworks N 1 and N 2 on the two sides of the cut, as illustrated in Figure 4. Then, one has the bound where d C is the dimension of the Hilbert space H C associated to the edges in the cut. Hence, ⌈log(d C )⌉ qubits are sufficient to compress the state family. Recalling that the logarithm of d C is the capacity of the cut, we obtain the following: For every cut C = (C s , C t ) of Temp, the state family {|Ψ x } x∈X can be compressed without errors into ⌈c(C)⌉ memory qubits. In particular, the state family can be compressed into memory qubits, where min-cut( Temp) = min C log d C is the minimum cut of the flow network Temp.
Intuitively, Theorem 1 tells us that, since the maximum amount of information that can flow in the network is upper bounded by the capacity of the min-cut, the amount of memory needed to store this information is also upper bounded by the capacity of the min-cut. The point of Theorem 1 is that, while the calculation of rank(N * ) may not be computationally feasible, the minimum cut can be found efficiently using known algorithms such as the Relabel-To-Front algorithm [48], which runs in O(|V | 3 ) time.
In Section IV, we will provide explicit examples of minimum cuts for some relevant families of tensor network states. Before that, we will discuss the optimality of Q cut as an upper bound on the number of memory qubits needed for compression.

C. Optimality for fixed tensor network templates
The amount of memory used by the best compression protocol is intuitively related to the flow of quantum information from the parameters specifying the quantum state to the physical systems in which the states are embodied. To make this intuition precise, suppose that we want to compress a known, but otherwise generic family of tensor network states with network template Temp, that is, a family of the form {N * |v x } x∈X , where N * is a tensor network operator compatible with the template Temp, and {|v x } is a generic set of (suitably normalised) vectors in the parameter space H X . In the worst case over {|v x } and N * , it is easy to see that the minimum number of memory qubits necessary for compression is ⌈log rank(N * )⌉. Indeed, the vectors {|v x } could form a spanning set for the parameter space H X , so that the dimension of the input space H in = Span{N * |v x } x∈X is exactly equal to the rank of N * . It is then immediate to conclude that every exact compression protocol will require at least ⌈log rank(N * )⌉ memory qubits. Taking the worst case over N * , we obtain the following Proposition 1. The minimum number of memory qubits required for the exact compression of a generic state family of tensor network states with template Temp is where quantum-max-flow( Temp) is the quantum max-flow [46], defined as the maximum being over all tensor network operators N * compatible with the template Temp. 2 Now, an important question is whether the compression protocols of Theorem 1 can reach the minimum number of qubits (26), in the worst case over all state families compatible with a given network template. In other words, the question is whether the equality ⌈quantum-max-flow( Temp)⌉ = ⌈min-cut( Temp)⌉ holds. Such equality would follow from a quantum version of the max-flow min-cut theorem [49], which would state the equality quantum-max-flow( Temp) = min-cut( Temp). Remarkably, Ref. [46] shows that such quantum version does not always hold, and in general the quantum max-flow is only a lower bound on the min-cut quantum-max-flow( Temp) ≤ min-cut( Temp) .
Nevertheless, the equality holds in the case where all dimensions are powers of the same integer [46]. In this case, the validity of the quantum max-flow-min-max theorem implies the following optimality property: Proposition 2. Let Temp be a network template with d(e) = b n(e) for some fixed integer b and for some integer-valued function n : E → N. Then, Q cut = Q min , meaning that the number of qubits used in Theorem 1 is minimum in the worst case over all state families with the given network template.
Proposition 2 guarantees that, under the assumption that each dimension d(e) is an integer power of b, the amount of qubits used in Theorem 1 is optimal for the least compressible family of tensor network states compatible with the given template. In the general case, we show that the amount of qubit used by the compression protocol of Theorem 1 is at most log 3 times the minimum number needed for compression. This result, provided in the following Proposition, is based on a general relation between the min-cut and the quantum-max-flow of a generic tensor network: As a consequence, one has the bound which implies that, asymptotically, the number of qubits used in the compression protocol of Theorem 1 is at most log 3 times the minimum number Q min .
The proof is provided in Appendix A. In conclusion, the number of qubits used in Theorem 1 is either minimum (if all dimensions are power of the same integer), or within a factor log 3 ≈ 1.585 of the minimum (if some dimensions are not power of the same integer). Equipped with this result, in the next section we will analyse the number of qubits needed to compress various families of tensor network states.

IV. EXPONENTIALLY COMPRESSIBLE FAMILIES OF TENSOR NETWORK STATES
In this section we apply the memory bound of Theorem 1 to various families of tensor network states. In most of these examples, the amount of memory qubits required to store the states is exponentially smaller than the original number of physical particles in which the states are embodied.

A. MPSs with variable boundary conditions
Consider the following family of MPSs with variable boundary conditions: Here, the tensors A [1] , A [2] , . . . , A [n] are fixed and known, and the free parameters are the components of the vectors |L and |R . We consider the case where d c = O(poly(n)), namely the the bond dimension d c grows at most polynomially with n, which is true for MPS approximations of ground states one-dimensional gapped Hamiltonians [50][51][52]. In cases of the one-dimensional Ising model [39] and the AKLT model [40], d c is even constant. In Equation (31), we regard the tensors surrounded by the dashed line as the tensor network N , and we write |Ψ L,R = N * (|L ⊗ |R ). In order to apply Theorem 1, the first step is to convert N to a flow network, as illustrated in Figure 5. Then, Theorem 1 guarantees that the states {|Ψ L,R } can be compressed into a number of qubits equal to the capacity of the minimum cut. For the flow network in Figure 5, there are two candidates for the minimum cut (C s , C t ): i) C s contains only s, while C t contains all the other vertices. This cut has capacity 2 log d c .
ii) C t contains only t, while C s contains all other vertices. This cut has capacity n log d p .
For all other cuts, the cut edges necessarily contain at least two edges of capacity log d c and one edge of capacity log d p , leading to a capacity larger than that of i). For sufficiently large n, as we have assumed d c is no larger than a polynomial of n, we have 2 log d c ≤ n log d p , and i) is the minimum cut. Therefore the states {|Ψ L,R } can be compressed into a number of ⌈2 log d c ⌉ qubits, which is O(log n) assuming d c = O(poly(n)). s t A [1] A [2] · · · A [n] s t A [1] A [2] · · · A [n] i) Capacity = 2 log dc ii) Capacity = n log dp FIG. 5. Flow network associated to the states (31), and the two candidate minimum cuts. Except the edges connected to the source s or the sink t, all edges are made bidirectional. The dashed lines indicate the minimum cuts. When n is sufficiently large, as dc is assumed to grow polynomially with n, 2 log dc ≤ n log dp, and the one on the left is the minimum cut.
Note that although we considered MPSs with open boundary conditions, our memory bound also applies to other cases. For example, it applies to MPS with periodic conditions (13). More generally, the bound holds for any set of states {|Ψ B } of the form |Ψ B = N * |B , where |B ∈ H c ⊗ H c is a generic vector on the joint Hilbert space of the boundary conditions.
In Section VI we will provide an explicit compression protocol that achieves the memory bound ⌈2 log d c ⌉ and can be implemented efficiently on a quantum computer.

B. Site-independent MPS
Another important family of MPSs is the family of site-independent MPSs [33]. Suppose that we know nothing about an MPS except that it is site-independent (14), has a constant bond dimension d c , and has a constant physical dimension d p . A constant bond dimension can be observed in some systems where the interactions are local, such as the one-dimensional Ising model [39] and the AKLT model [40]. A generic state of this form can be expressed as Note that the entries of the tensor A are free parameters, like the entries of the vectors |L and |R . We now provide an alternative tensor network representation of the state |Ψ A,L,R . To this purpose, we can convert the tensor A into a vector of dimension d 2 c d p , denoted by |A ∈ H d 2 c dp . The vectorisation is implemented by inserting copies of the unnormalised maximally entangled state |I := dc i=1 |i |i , as in the following picture: Now, note that the vector |A ⊗n belongs to the symmetric subspace of H ⊗n d 2 c dp , which has dimension n+d 2 c dp−1 d 2 c dp−1 . Let S be a Hilbert space of dimension n+d 2 c dp−1 d 2 c dp−1 . Then, there exists an isometry V S such that, for any |A , there exists a vector |S A ∈ S satisfying |A ⊗n = V S |S A . Using this fact, we can replace |A ⊗n by V S |S A , thus obtaining a new tensor network representation with smaller minimum cut: For sufficiently large n, the minimum cut is illustrated by the dashed line in Equation (34). The cut edges are the outgoing edges of L, R and S A , and their combined dimension is dim H C = d 2 c n+d 2 c dp−1 d 2 c dp−1 . Hence, Theorem 1 implies that the total number of qubits to encode the states C. Memory bounds for other families of tensor network states In Appendix B we derive memory bounds for several families of tensor network states, including PEPS (either with variable boundary conditions or site-independent) and MPS/PEPS generated by an unknown unitary gate acting identically on the physical particles, a scenario that is relevant to the use of MPS/PEPS in quantum metrology. The results of Appendix B are summarised in Table I. log(nm + dp − 1) + (2n + 2m) log dc Cases 1 and 3 deal with the compression of multipartite states where the tensors responsible for the correlations between particles are known, while the boundary condition is unknown. The scaling of the memory size manifests an area law: the number of qubits needed to encode the state is proportional to the size of the boundary. The area law can be immediately read out from the graphical representation of the states, as Theorem 1 states that the memory size equals to the minimum cut between the system and the variable terms, and in this case the variable terms are only on the boundary. Cases 2 and 4 consider a site-independent multipartite system with fixed bond dimension. A logarithmic scaling can be observed: the memory size is O(log n) for a system of n particles. The same scaling is also observed in the compression of identical uncorrelated systems [13]. Cases 5, 6, 7 and 8 exemplify a tensor network state under an unknown global transformation. The total memory usage equals to a fixed term d 2 p +dp−2 2 log(n + d p − 1) plus the memory for the tensor network state. The fixed term can be interpreted as the amount of information contained in the unknown transformation U ⊗n g .

V. LOCAL COMPRESSION OF BIPARTITE STATES
In this section we extend Theorem 1 to the scenario where some of the physical systems are inaccessible, and the task is to compress the accessible part, while maintaining the correlations in the overall system.
Consider a family of pure states {|Ψ x } ⊂ H P ⊗ H E of the composite system P ⊗ E, consisting of a physical system P (with Hilbert space H P ) and of its environment E (with Hilbert space H E ). Here we are interested in compression protocols where the encoding and decoding operations act only on system P, but still allow one to recover the joint state |Ψ x . Our goal is to find channels E : S(H P ) → S(H M ) and D : S(H M ) → S(H P ) that satisfy where I E is the identity map on system E. An optimal pair of channels (E, D) is a pair that minimises the memory size, namely the dimension of H M . We call the above task local compression of the states {|Ψ x } ⊂ H P ⊗ H E . Operationally, local compression is important in the situation where Alice and Bob share a state of the composite system P ⊗ E, of which Alice holds part P, while Bob holds part E. In this scenario, it is interesting to ask how Alice can store her part of her system in a quantum memory, while ensuring that the correlations with Bob's system are preserved.
A local compression protocol can be constructed from a partial isometry V : H P → H M that satisfies the following: where I E is the identity operator on system E. In order to generalize Theorem 1 to the scenario of local compression, we need to cope with the presence of the inaccessible environment E. The key idea is to regard the environment not as an output of the tensor network, but as another source of information, in addition to the parameter Hilbert space in which the parameter x is encoded. Mathematically, this change of perspective corresponds to a reversal of the edges associated to the environment, which become inputs, instead of outputs. After the edges have been reversed, we apply Theorem 1, and search for the minimum cut that separates physical systems from the parameter space and from the environment, as shown in Figure 6. This approach leads to an upper bound on the number of memory qubits needed for local compression, provided in the following proposition: Proposition 4. Let {|Ψ x } be a parametric family of pure states of the form |Ψ x = N * |v x , where N * : H X → H P ⊗H E is a fixed tensor network operator and |v x ∈ H X is some (not necessarily normalised) vector, parameterised by parameter x. Let N = (Temp, T ) be the tensor network associated to the operator N * , each of whose outgoing edges corresponds to either a physical system (i.e. a subsystem of P) or a part of the environment (i.e. a subsystem of E). Let Temp ′ be the tensor network template obtained from reversing all open edges of Temp that are associated to the environment. Let Temp ′ be the flow network corresponding to the template Temp ′ via Construction 1. For every cut C = (C s , C t ) of Temp ′ , the marginal state on system P of the state family {|Ψ x } x∈X can be compressed without errors into ⌈c(C)⌉ qubits.
The proof is provided in Appendix C. As an example, consider the scenario where Alice holds the leftmost n systems of an MPS and Bob holds the rest n ′ systems, and Alice's task is to store her systems in a quantum memory, while preserving the correlations with Bob's systems.
We assume Alice does not know the boundary conditions |L and |R , and therefore her goal is to find channels for some Hilbert space H M whose dimension should be minimised.
Using Proposition 4, we convert the tensor network in Equation (37) to into the flow network in Figure 7, with the cut indicated by the dashed line. There are two cut edges, each has dimension d c , and therefore Alice can still compress her state into ⌈log dim H C ⌉ = ⌈2 log d c ⌉ qubits, as in the case of compression of an MPS with variable boundary conditions (Section IV A). The compression protocol will be presented explicitly in Section VI. Proposition 4 automatically provide upper bounds on the amount of memory needed to compress mixed tensor network states. Any such state ρ x ∈ S(H P ) can be regarded as the marginal of a pure tensor network state involving an environment, namely Tr E [|Ψ x Ψ x |] = ρ x for some pure state |Ψ x ∈ H P ⊗ H E . Clearly, a local compression protocol for the purifications {|Ψ x } is also a compression protocol for the mixed states {ρ x }, as one can see by taking the partial trace over the environment on both sides of the local compression condition (35).

VI. COMPRESSION PROTOCOL FOR MATRIX PRODUCT STATES WITH VARIABLE BOUNDARY CONDITIONS
Here we construct an explicit compression protocol for the family of all MPSs with variable boundary conditions. The idea is to perform a local compression on each pair of adjacent physical systems locally, and to iterate the protocol until we cannot reach a smaller memory size. For simplicity of presentation, we assume the number of physical systems n is a power of 2. We consider two adjacent physical systems, the i-th and the (i + 1)-th, and regard the others as the environment.
FIG. 8. We regard the i-th and the (i + 1)-th systems as the physical systems to which the compression protocol will be applied. The other systems are regarded as the environment.
By Proposition 4, there exists a partial isometry V i,i+1 that faithfully encodes the i-th and the (i + 1)-th physical systems into a single system of dimension d 2 c . Note that, per se, V i,i+1 may not be a useful compression operation, because the dimension d 2 c may be larger than the dimension d 2 p of the two input systems. Nevertheless, we now show that a concatenation of partial isometries like V i,i+1 can squeeze the initial state into the minimum number of qubits, equal to ⌈2 log d c ⌉.
The construction can be iterated, because the output of the isometry V (1) is itself an MPS. This can be verified by defining the tensors so that the output state |Ψ L,R = L A [1,2] A [3,4] · · · A [n−1,n] R Crucially, the bond dimension is still d c . Now, we can again apply Proposition 4 to each adjacent pair of d 2 c -dimensional systems, and compress them into a single d 2 c -dimensional system, using partial isometries V 1,4 , V 5,8 , . . . , V n−3,n . Also in this case, Proposition 4 guarantees that the (n/2)-particle |Ψ (2) L,R is encoded faithfully into the (n/4)-particle state |Ψ Iterating this pairwise encoding for a total of log n times, we can faithfully compress the input state into ⌈2 log d c ⌉ qubits. An illustration of the compression protocol for n = 8 is provided in Figure 9.
L A [1] A [2] A [3] A [4] A [5] A [6] A [7] A [ L,R , which is also the circuit structure to perform the encoding operation. Each partial isometry Vi,j acts on a space with dimension no more than max{d 4 c , d 2 p } and outputs a system with dimension d 2 c .
The encoding can be realised by a quantum circuit of depth O(log n), implementing partial isometries V i,j shown above. Since each partial isometry has size no larger than d 2 c × max{d 4 c , d 2 p } and the circuit uses n − 1 such partial isometries in total, the overall complexity of the encoding operations is O(poly(n)) (assuming d c is polynomial in n), meaning that this construction is efficient in the number of physical systems. The same argument applies to the decoding circuit, which can be obtained from the encoding circuit by reversing each gate.
Note that the above technique also applies to the local compression of MPSs, corresponding to the scenario where only a subset of the physical system is accessible.

A. The algorithm
Here we outline a general quantum algorithm for compressing families of pure states lying in a low-dimensional subspace of a high-dimensional quantum system. The idea of the algorithm is to train a quantum machine to perform the desired compression operations, by showing to the machine how such operations should act on a fiducial set of input states.
The algorithm is based on the universal quantum emulator of Marvian and Lloyd [53], a quantum circuit that "learns" how to implement a completely unknown unitary gate U from a set of examples, as illustrated in Figure  10. To implement the gate U on a state |ψ , the emulator consumes Q pairs of input-output states, of the form (|ψ j k , U |ψ j k ) with k ∈ {1, . . . , Q}. Each input state |ψ j k is taken from a set of m possible inputs {|ψ j } m j=1 , with m ≤ Q.
For large Q, the output of the emulator converges to the desired output state U |ψ provided that 1. the input state |ψ belongs to the subspace K := Span{|ψ j } m j=1 , and 2. the quantum channel R : S(K) → S(K) defined by where I K is the identity on K, is mixing [54], meaning that every input state ρ converges to a fixed state ρ 0 (in this particular case ρ 0 = I/d) under a large number of repeated applications of the channel; in formula, The second condition is equivalent to the statement that the channel R has one and only one eigenvalue on the unit circle [55]. Since all the eigenvalues of a quantum channel are inside the unit circle, this implies that the eigenvalue λ with the second largest modulus satisfies the condition |λ| < 1. Equivalently, this means that the spectral gap γ R := 1 − |λ| is non-zero.
Target input |ψ The number of input-output pairs needed to approximate the gate U depends on the error tolerance ε, on the dimension of the subspace spanned by the input states {|ψ j }, denoted by r, and on the spectral gap γ R . Specifically, Marvian and Lloyd [53] show that Q grows as To emulate the encoding, which is an isometry instead of a unitary, we choose a unitary U acting on the composite system P ⊗ M, and satisfying the condition where |Ψ 0 (|W 0 ) is a fixed state of the physical (memory) system, and V : H in → H M is an isometry that encodes the input states into the memory system. To train the emulator, we use input (output) states of the form where the states {|Φ j } m j=1 , hereafter called the fiducial states, span the input subspace H in := Span{|Ψ x } x∈X . In general, the states {|Φ j } m j=1 may or may not be a subset of the state family we are trying to compress. The isometry V is constructed from the Gram matrix G jk = Φ j |Φ k via the following procedure: 1. Compute the rank of G, denoted by r, and set H M = C r . The calculation of the rank can be done, e.g. by diagonalising G and counting the non-zero eigenvalues. Note that r is equal to the dimension of Span{|Φ j } m j=1 , which, by construction, is equal to the dimension of the input subspace H in .
2. Construct an r × m matrix W such that W † W = G. This can be done by diagonalising G as G = XΛX † , setting W = √ ΛX † , and removing the zero rows from W .
The above definition is well-posed and uniquely determines the linear operator V within the subspace spanned by the fiducial states {|Φ j } m j=1 . Note that V is an isometry: indeed, for every vector |Ψ = j c j |Φ j ∈ H in , one has To train the emulator, we will use input-output pairs of the form (|Φ j ⊗ |W 0 , |Ψ 0 ⊗ |W j ), with |W j := W |j . Now, recall that the number of input-output pairs needed by the emulator depends on the spectral gap of the channel R in Equation (43), with states |ψ j = |Ψ j ⊗ |W 0 . Since the states |Ψ j ⊗ |W 0 are unitarily equivalent to the states |Ψ 0 ⊗ |W j , the spectral gap of the channel R : S(H P ) → S(H P ) is equal to the spectral gap of the channel where I r is the identity operator on C r . This observation is important because channel R ′ acts only on the memory space, and therefore its spectral gap involves the diagonalisation of a low-dimensional matrix. With the knowledge of the spectral gap, we can keep under control the error in the emulator protocol, and determine how many input-output pairs are needed to attain the desired level of accuracy in the implementation of the gate U . All together, the algorithm can be summarised as follows: Output: Approximation of the compressed state V |Ψ ∈ H M Preprocessing: 1 Compute the Gram matrix G jk = Φ j |Φ k ; 2 Compute the rank r = rank(G) and set H M = C r ; 3 Find an r × m matrix W satisfying W † W = G; 4 Compute the spectral gap of the channel R in Equation (43).
The above algorithm implements an approximation of the encoding channel E(ρ) = Tr P [U (ρ ⊗ |W 0 W 0 |)U † ] to any desired accuracy. The same construction applies to the decoding channel D(ρ) = Tr M [U † (|Ψ 0 Ψ 0 | ⊗ ρ)U ], by simply exchanging the role of the input and output of the quantum emulator. The algorithm reaches the optimal memory size for exact compression, because the memory space has dimension r, which is exactly equal to the dimension of the input subspace H in .

B. Running time
Here we analyse the running time of the general quantum compression algorithm, providing sufficient conditions for its efficient implementation. We will measure the size of the input physical system P in terms of the number of logical qubits needed to represented it, namely n := ⌈log dim H P ⌉.
The running time of Step 1 (calculation of the Gram matrix) depends on the structure of the fiducial states. The calculation of the matrix element G jk = Φ j |Φ k can be implemented efficiently for various families of tensor network states, such as MPSs [43,[56][57][58] and MERAs [38]. The number of matrix elements is O(m 2 ), where m is the size of the fiducial set. Hence, the efficient implementation of Step 1 requires m to be at most polynomial in n. In the following, we will always assume m = O(poly(n)). Of course, this implies that the subspace containing the input states has polynomial dimension d in = O(poly(n)), namely it is exponentially smaller than the total Hilbert space H P .
Under the assumption m = O(poly(n)), Steps 2 and 3 (calculation of the rank and construction of the matrix W ) can be implemented in polynomial time by diagonalising the Gram matrix G, e.g. with the QR algorithm [59]. Note that one has r = d in = O(poly(n)), meaning that the memory system has polynomial dimension.
Step 4, the calculation of the spectral gap, can be implemented in polynomial time by diagonalising the r 2 × r 2 matrix describing the channel R ′ .
The emulation part has running time T tot = Q T prep + T emulator , where Q is the number of input-output pairs used by the emulator, T prep is the time complexity of preparing each input-output pair, and T emulator is the running time of the emulator.
The running time of the emulator can be bounded as T emulator = O(n Q log Q) [53]. The complexity of preparing the input-output pair (|Φ j ⊗ |W 0 , |Ψ 0 ⊗ |W j ) is essentially the complexity of preparing the fiducial state |Φ j . Indeed, |Ψ 0 can be chosen to be any efficiently preparable state, i.e. any state preparable in O(poly(n)) time. The states |W j and |W 0 are efficiently preparable by construction, because they are vectors with a polynomial number of efficiently computable entries. Hence, the preparation time T prep is polynomial if and only if each fiducial state |Φ j can be prepared in polynomial time. This condition is satisfied whenever the fiducial states {|Φ j } m j=1 are MPSs [43,58] or MERAs [38].
By Equation (44), under the assumption m = O(poly(n)), the number of input-output examples required by the emulator is polynomial in n and ε −1 if the inverse spectral gap γ −1 R is at most polynomial in n. In summary, the compression operations can be implemented in polynomial time if 1. the number of fiducial states is at most polynomial, m = O(poly(n))), 2. the overlap of any two fiducial states can be computed in polynomial time, 3. each fiducial state can be prepared in polynomial time, and 4. the inverse spectral gap is at most polynomial, γ −1 R = O(poly(n)). Conditions 1 and 2 are relatively straightforward for tensor network states. As we have seen in Section IV, many families of tensor network states are contained in subspaces of dimension O(poly(n)), making it easy to satisfy Condition 1. In addition, the overlap between two tensor network states can be efficiently computed in many physically relevant cases (e.g. MPSs and MERAs). In those cases, if the input subspace H in has polynomial dimension (as it must be in order to satisfy Condition 1), then every state in H in is a linear combination of polynomial number of tensor network states, and the overlap between any two states in H in can be computed in polynomial time.
Condition 3 is satisfied when the fiducial states are efficiently preparable tensor network states, such as MPSs or MERAs, which can be prepared through sequences of isometries [38,43,58]. However, it is not automatically satisfied when the fiducial states are generic vectors in H in . The problem is that, in general, a linear combination of efficiently preparable states may not be an efficiently preparable state. For MPSs, however, this condition is satisfied: k=1 be a polynomial-size set of MPSs that span the input space H in , and let {c k } t k=1 be a set of coefficients such that the linear combination |Ψ = k c k |Σ k is a unit vector. If the initial states have bond dimension d c , then the state |Ψ is an MPS with bond dimension t d c and can be prepared in polynomial time.
The proof is provided in Appendix D. For more general families of tensor network states, other than MPSs, a sufficient condition for the efficient preparability of the fiducial states will be given in the next section.
The proof is provided in Appendix E. Lemma 2 guarantees that the fiducial set {|Ψ l,α,s } l∈{1,...,r},α∈{x,y,z},s∈{+,−} gives rise to a channel with inverse spectral gap growing at most as O(r 3 ), where r is the dimension of the input subspace. Since the input subspace is assumed to be of polynomial dimension (Condition 1), this result guarantees that the inverse spectral gap is at most polynomial.
Lemmas 1 and 2 imply that every family of MPSs that can be compressed into a logarithmic number of qubits can be compressed in polynomial time on a quantum computer.

Theorem 2.
Let {|Ψ x } x∈X be a parametric family of n-particle MPSs with fixed bond dimension d c . If the input subspace H in = Span{|Ψ x } x∈X has polynomial dimension r = poly(n), then the states {|Ψ x } x∈X can be compressed into ⌈log r⌉ qubits with error ε in polynomial time poly(n, ε −1 ).
Proof. Let {|Σ k } t k=1 be a subset of the states {|Ψ x } x∈X , with the properties that (i) {|Σ k } t k=1 spans the input subspace, and (ii) the number of states t is polynomial in n. Such a set exists because, by hypothesis, H in has polynomial dimension. Then, let {|l } r l=1 be the orthonormal basis of H in obtained by applying the Gram-Schmidt procedure to the set {|Σ k } t k=1 . Explicitly, |1 := |Σ 1 , |2 := (|Σ 2 − Σ 1 |Σ 2 |Σ 1 )/ 1 − | Σ 1 |Σ 2 | 2 , . . . , |t := (|Σ t − k<t k|Σ t |k )/ 1 − k<t | k|Σ t | 2 . By construction, each vector |l is a linear combination of MPSs, and the expansion coefficients can be computed from the scalar products Σ k |Σ l . Since the states {|Σ k } t k=1 are MPSs, the scalar products can be computed efficiently, and Lemma 1 implies that the linear combinations {|l } r l=1 can be prepared in polynomial time. From the basis {|l } r l=1 , one can then construct the fiducial states defined in Equation (49). Since the fiducial states are linear combinations of at most 2 basis vectors, they can all be prepared in polynomial time (again, due to Lemma 1). Moreover, Lemma 2 guarantees that the channel R associated to the states (49) has inverse spectral gap of polynomial size. Hence, all Conditions 1, 2, 3, and 4 are satisfied, implying that the compression algorithm 1 runs in polynomial time on the states {|Ψ x } x∈X . Theorem 2 guarantees that most relevant families of MPSs can be compressed efficiently on a quantum computer. For other state families, a sufficient condition for compressibility in polynomial time is given by the following proposition: Proposition 5. Let {|Ψ x } x∈X be a parametric family of n-particle tensor network states with a given network template. If the input subspace H in = Span{|Ψ x } x∈X contains a spanning set {|Σ k } t k=1 with the following properties (i) the number of states t is at most polynomial in n, (ii) each state |Σ k is efficiently preparable by a coherent process |k → |k ⊗ |Σ k , (iii) the Gram matrix S kl := Σ k |Σ l is efficiently computable, (iv) the minimum non-zero eigenvalue of the Gram matrix S is at least inverse-polynomial in n, then the states {|Ψ x } x∈X can be compressed into ⌈log dim H in ⌉ qubits with error ε, using a quantum algorithm that runs in polynomial time O(poly(n, ε −1 )).
The proof is provided in Appendix F. Note that Proposition 5 is not specific to tensor network states, and applies broadly to every parametric family of states confined in a low-dimensional subspace of the total Hilbert space.

VIII. CONCLUSIONS
We designed compression protocols for parametric families of tensor network states, in which some of the tensors depend on the parameters, while some others are constant. Physically, the variable tensors can be associated to systems that carry unknown parameters, or to inaccessible degrees of freedom of the environment. Given a tensor network with constant and variable tensors, one can construct a flow network, where the variable tensors are connected to the source, and the physical systems are connected to the sink. In such a network, every cut identifies an exact deterministic compression protocol that compresses every state in the parametric family into a quantum memory of dimension equal to the size of the cut. In addition to quantifying the amount of memory needed to store tensor network states, we provided a general quantum compression algorithm, and we identified sufficient conditions for the algorithm to run in polynomial time, showing that they are satisfied by all families of MPSs.
Our results can be applied to site-independent tensor network states of n quantum systems, showing that every such state can be compressed without error into a memory of O(log n) qubits. This scaling is optimal, because the set of site-independent MPSs contains as a subset the set of all identically-prepared states, which is known to require O(log n) qubits, both for exact [11] and approximate compression protocols [12,13]. The optimal prefactor in the logaritmic scaling of the memory for general site-independent tensor network states remains to be determined.
Our results can also be used to provide upper bounds on the amount of information one can encode into multipartite system using tensor network codes, such as the toric code [60][61][62] and holographic codes [63,64]. For example, our method shows that a toric code with circumference L and with variable boundary conditions can be faithfully compressed into L qubits (a toric code is a PEPS with d c = 2 [36]). As a consequence, we can deduce that the number of qubits one can encode with the toric code is at most L. This result is consistent with the construction by Bravyi and Kitaev [62], which shows that one can encode up to L/2 − 1 qubits. The discrepancy between this value and our bound is mostly due to that in Ref. [62], the boundary condition of a toric code is not arbitrary, while we consider arbitrary boundary conditions. More generally, we showed that tensor network states with variable boundary and constant interior satisfy an area law, according to which the number of qubits needed to compress these states is proportional to the size of the boundary.
In this work we mainly focused on exact compression. Since noise and imperfections are unavoidable in every realistic implementation, an important avenue of future research is to extend our results to approximate compression protocols. Tolerating a small compression error could offer great savings in terms of the amount of memory needed to store families of tensor network states. In the case of uncorrelated systems, it was observed that tolerating any nonzero error decreases the memory size discontinuously [11,12]. Extending the study of this phenomenon to correlated systems is an interesting open question for future research.
Then, we have the following chain of inequalities: the last inequality following from the fact that the set of tensor network operators with template Temp 2 is included in the set of tensor network operators with template Temp. This proves the upper bound min-cut( Temp) ≤ log 3 · quantum-max-flow( Temp).
Appendix B: Memory bounds for various tensor network families
As in the MPS case, we regard the tensors A [i,j] on the lattice as the tensor network N , and by properly choosing the edge directions, N defines a linear operator from the systems on the boundary to the physical systems. We call this linear operator N * , and write the PEPS as |Ψ (PEPS) B = N * |B , where |B is a vectorised version of the tensor B describing the boundary condition. Then, we convert N to a flow network and look for its minimum cut. Assuming that the bond dimension d c is a constant, while the lattice has size n × m for large n and m, the optimal cut consists of the source (which replaces the tensor B) on one side, and of the sink and the tensors A [i,j] on the other side, as shown in Figure 11. The cut edges contain 2n + 2m number of d c -dimensional systems, with combined dimension d 2n+2m c . Using Theorem 1, we conclude that the states {|Ψ (PEPS) B } can be compressed into ⌈(2n + 2m) log d c ⌉ qubits. This result is consistent with the area law for PEPSs, which indicates that the amount of information contained in a two-dimensional region is upper bounded by a term proportional to its perimeter, in this case 2n + 2m. More generally, this result is an instance of the bulk-boundary correspondence in Ref. [65], which shows that the bulk (namely physical systems) and boundary of a PEPS are related by an isometry. Our result can be seen as a special case of the "holographic compression" of Ref. [66], which states that a state with area law can be approximately compressed into a memory proportional to the boundary size. In the special case of PEPSs, our construction shows that the compression is exact.

Site-independent PEPSs
The method in Section IV B for MPSs can be generalised to arbitrary systems that are "finitely correlated", in the sense that they have a finite bond dimension. For example, Figure 12 shows a site-independent PEPS defined on a square lattice. Each A in the figure is an order-5 tensor, and the loop is a tensor B describing the boundary condition.
· · · · · · · · · · · · · · · · · · · · · · · · · · · B is a generic site-independent PEPS, defined on a n × m square lattice, with fixed bond dimension d c and physical dimension d p . By vectorisation, the tensor A is transformed into a vector |A in a vector space of dimension d 4 c d p . The dimension of the symmetric subspace of nm copies of d 4 c d p -dimensional vectors is nm+d 4 c dp−1 d 4 c dp−1 . With the same argument as in the SIMPS case, |A ⊗nm = V S |S A , where V S is an isometry, and |S A is a vector in space S with dimension nm+d 4 c dp−1 d 4 c dp−1 . We obtain the following tensor network representation for |Ψ where we have rearranged the outgoing edges of V S such that the tensor labeled I ⊗(2n+2m) denotes the connections between V S and the boundary condition B, and I ⊗(2nm−n−m) corresponds to the connections between neighboring copies of A. The open edges correspond to the nm number of physical systems. In Figure 13,Ũ g := λ |λ λ| ⊗ U g,λ is a compressed version of U ⊗n g . The T-shape intersection is a copying operation on the index system |λ , defined as The region to the left of the dashed line readsŨ g ( λ |λ |λ λ|) V † µ U sch |Ψ 0 , which equals to |ψ g . The partial isometry V † µ serves as a "coherent erasure" of the system M λ . We first perform a coherent erasure on the multiplicity system M λ using V † µ and reprepare the system later using V µ . This effectively reduces the minimum cut (dashed line) of the tensor network. The cut edges constitutes the Hilbert space λ∈Y n,d R λ .
Note that we are slightly abusing the notations for tensor network, as the two cut edges constitute a space that is not the tensor product space of each edge. The dimension of the edge labeled by R λ depends on λ. To avoid ambiguity, we have to restrict the upper edge to take values only in the basis {|λ }.
We vectorise the variable tensorŨ g as |Ũ g , and regard all other tensors as the tensor network N . Then we have |Ψ g = N * |Ũ g . Choosing the cut as the dashed line in Figure 13, according to Theorem 1, the states {U ⊗n g |Ψ 0 } can be compressed into a memory of dimension equal to the dimension of λ∈Y n,d R λ , which is namely a memory of no more than d 2 +d−2 2 log(n + d − 1) qubits. The last inequality comes from Lemma 3 in Ref. [11] shown below, with r = d.

Parametric tensor network state family under identical local unitary transformations
In the previous section, we have discussed about the compression of states obtained from a fixed multipartite state under unknown local unitary transformations. Here we consider the generalisation in which the unknown transformations are applied to a parametric family of tensor network states. This generalisation could be used to treat the case of n of interacting spins with unknown couplings immersed in a uniform magnetic field of unknown direction.
Explicitly, we consider tensor network states of the form where |v x ∈ H X is a vector in a suitable parameter space H X , and U g is an unknown unitary transformation, representing the action of a group element g ∈ G on each physical system. To use Theorem 1, our goal is to construct a tensor network that generates the family {U ⊗n g N * |v x } g∈G,x∈X , with the property that the corresponding flow network has small minimum cut. We do the construction in two steps: we first consider a smaller state family and construct its corresponding tensor network, and then extend the network so that it generates our target state family {U ⊗n g N * |v x } g∈G, x∈X .
Let m = dim H X . Choose m values of the parameters x 1 , . . . , x m such that {|v x1 , . . . , |v xm } is a basis of H X . The smaller family we consider is {U ⊗n g |Ψ xi } g∈G,i=1,...,m , with |Ψ xi := N * |v xi . This family is an extension of the family in the previous section, where instead of fixing the initial state, the initial state is chosen from m alternatives.
For any x i , using the Schur transform, we can decompose |Ψ xi as is known, as in the previous section, we can construct an isometry V µ (B7). However, in this case |µ (xi) λ is unknown and depends on the value of i. Thanks to the fact that i takes a finite number of values (1 to m), we can construct one isometry for every value of i, in other words, an isometry controlled by i. As a result, we redefine V µ as where {|i } is a basis of an m-dimensional control system. And V † µ is defined as where the control system is not transposed. We then draw the tensor network that generates {U ⊗n g |Ψ xi } g∈G,i=1,...,m , which is similar to Figure 13 with additional control systems for V µ and V † µ .
14. Tensor network for {U ⊗n g |Ψx i }g∈G,i=1,...,m. Ψx i and copies of i are unknown as well asŨg.
For any fixed i, this network reduces to Figure 13, and generates the state U ⊗n g |Ψ xi . Therefore any state in the family {U ⊗n g |Ψ xi } g∈G,i=1,...,m can be generated by this network. We regard |Ψ xi , two copies of |i andŨ g as the parameters, and write U ⊗n g |Ψ xi = M * |Ψ xi |i |i |Ũ g , where M * is the linear operator represented by the constant tensors in network, and |Ũ g is the vectorised version ofŨ g . Now we consider the original state family {U ⊗n g |Ψ x } g∈G,x∈X . Take any state U ⊗n g |Ψ x = U ⊗n g N * |v x from the family, we can decompose |v x in the basis {|v xi } as |v x = i α i |v xi . Then the state U ⊗n g |Ψ x can be written as a superposition of states in the smaller family: This indicates that we can generate U ⊗n g |Ψ x via the linear operator M * with a superposition of the parameters. Defining which shows that the family {U ⊗n g |Ψ x } g∈G,x∈X can be generated by the following tensor network in Figure 15. The lower two cut edges constitutes the space λ∈Y n,d R λ , which has dimension no more than (n + d − 1) (d 2 +d−2)/2 (Lemma 3). The uppermost cut edge corresponds to the control system Span{|i } m i=1 with dimension equal to dim H X , and the combined dimension of all cut edges is (n + d − 1) (d 2 +d−2)/2 dim H X . Using Theorem 1, we then obtain the memory size for compression the states {U ⊗n g |Ψ x } g∈G,x∈X , as stated in the following proposition. log(n + d − 1) + log dim H X qubits.
Note that to minimise the memory usage in Proposition 6, one may choose an alternative parametrisation of the original family: |Ψ x = N ′ * |v ′ x , where |v ′ x resides in a space H ′ X that is smaller than H X . Specifically, the minimum cut C divides N into two subnetworks N 1 and N 2 , so that N * is a concatenation of the corresponding linear operators, namely N * = N 2 * N 1 * , as shown in Figure 4. Then by defining |v ′ x = N 1 * |v x , we have |Ψ x = N 2 * |v ′ x , and the new parameter space is H C , the combined Hilbert space of all cut edges. The dimension of H C can be smaller than the original parameter space H X . With the new parametrisation, when we apply Proposition 6 for the states {|Ψ x } g∈G,x∈X , we use a memory of d 2 +d−2 2 log(n + d − 1) + c(C) qubits, where c(C) = log dim H C is the capacity of the minimum cut.
We now consider MPSs and PEPSs. In Section IV A and Appendix B 1, we showed that an MPS or PEPS with unknown boundary condition can be written as |Ψ B = N * |B , where |B ∈ H X is a vector describing the boundary condition, and N * is a linear operator. H X has dimension d 2 c for MPSs and d 2n+2m c for PEPSs. We can then directly apply Proposition 6 to the states {U ⊗n g |Ψ B }. An MPS with variable boundary conditions under unknown transformation U ⊗n g can be compressed into a memory of log(nm + d p − 1) + (2n + 2m) log d c qubits.
Appendix C: Proof of Proposition 4 As illustrated in Figure 6, let N 1 and N 2 be the subnetworks of N induced by the cut C. Then N 1 defines a linear operator N 1 : H X → H E ⊗ H C , N 2 defines a linear operator N 2 : H C → H P , and we have N = (N 2 ⊗ I E )N 1 , where I E is the identity operator on H E .
Let d E = dim H E , and take the computational basis {|e i } dE i=1 of H E . Being the computational basis means |e i = |e i . Define |φ x,i := (I P ⊗ e i |)|Ψ x = (I P ⊗ e i |)N * |v x ∈ H P , so that |Ψ x = dE i=1 |φ x,i |e i . Now we consider the compression for the (unnormalised) states {|φ x,i } x∈X,i=1,...,dE . In fact, this set of states is generated by the same network N by reversing the edges for the environment. This results in a network N ′ , compatible with the template Temp ′ . This is shown in Figure 16. We regard the cut C for network N also as a cut for N ′ . Let |ψ x,i = N ′ 1 * |v x |e i , and then |φ x,i = N 2 * |ψ x,i . Applying Theorem 1 for {|φ x,i }, there exists a partial isometry V : H P → H C such that This V is what we want. For all x ∈ X, Appendix D: Proof of Lemma 1 Proof. For concreteness, we first prove the lemma for MPSs with open boundary conditions, and then show how to generalise the proof to arbitrary boundary conditions. We encode the coefficients into a vector |c := t k=1 c k |k . We assume |c is normalised such that the linear combination |Ψ = k c k |Σ k has unit length. Since {|Σ k } are MPSs, they have the following form: To represent their linear combination, we define tensors Λ, B [1] , . . . , B [n] , and P such that for every k ∈ {1, . . . , t} and i ∈ {1, . . . , n}. Then |Σ can be represented as: where is the tensor defined by Equation (D3) shows that |Ψ is an MPS: the left boundary condition is to the left of the first dotted line, the right boundary condition is to the right of the second dotted line, and the tensor on each physical system is B [i] connected with a T-intersection (D4). There are two edges connecting consecutive physical systems, one has dimension d c , and the other one has dimension t. Therefore the bond dimension of |Ψ is td c . For MPSs with general boundary conditions, one just needs to replace the boundary conditions by a suitable tensor connecting A [1] k and A [n] k (B [1] and B [n] ), and the rest of the proof is identical. To conclude the proof, we invoke the fact that all MPSs with polynomial-size bond dimension can be prepared in polynomial time on a quantum computer [43,58].