Uniform matrix product states in the thermodynamic limit - Solutions
Closely following [1], we want to numerically investigate uniform matrix product states (uMPS) in the thermodynamic limit, importing the modules f_umps.py, g_vumps.py, h_utdvp.py and i_uexcitations.py.
Part 1) Injectivity and canonical form in f_umps.py
A uMPS \(\vert \psi(A) \rangle\) represents a translation invariant state of an infinite chain of \(d\)-dimensional quantum systems and is completely characterized by a single tensor \(A \in \mathbb{C}^{D \times d \times D}\) of physical dimension \(d\) and bond dimension \(D\):
A crucial condition for efficient computations is injectivity of \(A\), meaning that counting algebraic multiplicities, the transfer matrix
has only one eigenvalue of magnitude (and value) 1 and the corresponding right and left eigenvectors are positive definite matrices [2, 3]. Non-injective tensors appear with measure zero. In 1.1) we want to show that a randomly drawn tensor is indeed injective. Within the gauge freedom \(A^s \rightarrow XA^sX^{-1}\) for invertible \(X\), we can bring a uMPS in canonical form
with left/right orthonormal tensors \(A_L\)/\(A_R\) (injective with left/right leading eigenvector equal to identity matrix) and center site tensor \(A_C = A_L C = C A_R\) for some center matrix \(C\). These 4 tensors are the central attributes of the UniformMPS class. As a first physically meaningful and exactly representable uMPS, we consider the AKLT state and justify a few of its properties in 1.2). In 1.3) we make clear under which conditions a UniformMPS instance
and a SimpleMPS(bc="infinite") instance (implemented in a_mps.py) can be converted into each other.
We then investigate the variational power of the set of uMPS with a given bond dimension \(D\), forming a manifold within the full Hilbert space. An element of the tangent space at point \(\vert \psi(A) \rangle\) in this manifold reads
and we denote the projector onto the (orthogonal) tangent space with \(P_A\). For Hamiltonians \(H = \sum_n h_{n, n+1}\) with nearest-neighbor interaction \(h \in \mathbb{C}^{d^2 \times d^2}\), we run the following algorithms:
Part 2) Variational uniform matrix product states (VUMPS) in g_vumps.py
The tangent space gradient reads
The variational ground state optimum (corresponding to \(G=0\)) in the uMPS manifold satisfies a) \(A_C\) ground state of \(H_{\mathrm{eff},1}\), b) \(C\) ground state of \(H_{\mathrm{eff},0}\), c) \(A_C = A_L C = C A_R\). For this perform the following updates till convergence in gradient norm:
\(A_C\) \(\rightarrow\) ground state of \(H_{\mathrm{eff},1}\), b) \(C\) \(\rightarrow\) ground state of \(H_{\mathrm{eff},0}\), c) \(A_L\)/\(A_R\) from left/right polar decompositions of \(A_C\) and \(C\). [1] >> Note that in contrast to iDMRG (implemented in
d_dmrg.py), which successively grows the lattice by updated unit cells, VUMPS truly solves the variational problem in the sense of completely updating the state with each iteration and consequently keeping the translation invariance at any time. [4]
Part 3) Uniform time dependent variational principle (uTDVP) in h_utdvp.py
Approximately solves
for a small time step \(dt\) by a) \(A_C \rightarrow e^{-idtH_{\mathrm{eff},1}}(A_C)\), b) \(C \rightarrow e^{-idtH_{\mathrm{eff},0}}(C)\), c) \(A_L\)/\(A_R\) from left/right polar decompositions of \(A_C\) and \(C\). [1]
Part 4) Variational plane wave excitations in i_uexcitations.py
On top of a uMPS ground state \(\vert \psi(A) \rangle\), we want to variationally find quasiparticle excitations in a plane wave superposition of the form
where \(p\) is the momentum, and \(X\) the left-gauge parametrization of the tensor \(B = V_L X\) (\(V_L\) is orthogonal to \(A_L\)), perturbing the ground state around site \(n\). With
the optimization boils down to diagonalizing \(H_{\mathrm{eff}}(p)\) for a few lowest-lying eigenvalues. [1, 5]
We benchmark our algorithms with the transverse field Ising (TFI) model, which can be diagonalized analytically in one dimension. [6]
References
[1] Vanderstraeten et al., Tangent-space methods for uniform matrix product states, 2019, https://arxiv.org/abs/1810.07006. [2] Perez-Garcia et al., Matrix product state representations, 2007, https://arxiv.org/abs/quant-ph/0608197. [3] Wolf, Quantum Channels and Operations - Guided Tour, 2012, https://mediatum.ub.tum.de/node?id=1701036. [4] Zauner-Stauber et al., Variational optimization algorithms for uniform matrix product states, 2018, https://arxiv.org/abs/1701.07035. [5] Haegeman et al., Variational matrix product ansatz for dispersion relations, 2012, https://arxiv.org/abs/1103.2286. [6] Subir Sachdev, Quantum Phase Transitions, 2nd ed, Cambridge University Press, 2011.
[1]:
import numpy as np
import matplotlib.pyplot as plt
1) f_umps.py: Random states and AKLT ground state
[2]:
from tenpy_toycodes.f_umps import UniformMPS, TransferMatrix
from tenpy_toycodes.a_mps import SimpleMPS
1.1) Transfer matrix and canonical form of random injective tensor
Create a random tensor \(A \in \mathbb{C}^{D \times d \times D}\) of physical dimension \(d = 2\) and bond dimension \(D = 4\).
[3]:
D, d = 4, 2
A = UniformMPS.get_random_tensor(D, d)
Show that \(A\) is injective, i.e. its
TransferMatrixfulfills \(T_A = \vert R \rangle \langle L \vert + \mathcal{O}(\vert \lambda_2 \vert)\) with \(\vert \lambda_2 \vert < 1\) and \(R,L > 0\).
[4]:
# right eigenvector
T = TransferMatrix([A], [A])
lambdas, Rs = T.get_leading_eigenpairs(k=2)
lambda1, lambda2 = lambdas[0], lambdas[1]
R = Rs[0]
R /= np.trace(R)
ERs, _ = np.linalg.eig(R)
# left eigenvector
T = TransferMatrix([A], [A], transpose=True)
mus, Ls = T.get_leading_eigenpairs(k=2)
L = Ls[0]
L /= np.trace(L)
ELs, _ = np.linalg.eig(L)
assert np.allclose(np.abs(lambdas), np.abs(mus))
print("lambda_1 = ", lambda1)
print("|lambda_2| = ", np.abs(lambda2))
print("R > 0 with eigenvalues", np.real_if_close(ERs))
print("L > 0 with eigenvalues", np.real_if_close(ELs))
lambda_1 = (0.9999999999999913-5.551115123125783e-17j)
|lambda_2| = 0.650921953008887
R > 0 with eigenvalues [0.50901127 0.30092656 0.05625866 0.13380351]
L > 0 with eigenvalues [0.63066192 0.22089672 0.03770395 0.11073741]
Compute the canonical form of \(A\), consisting of left/right orthonormal tensor \(A_L / A_R\), center site tensor \(A_C\), and center matrix \(C\).
[5]:
AL, AR, AC, C = UniformMPS.to_canonical_form(A)
AL, L: Converged up to tol=1e-10. Final error after 6 iterations: 2.6752155210835276e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 9.133347930659786e-16.
Show that \(T_{A_L} = \vert R \rangle \langle \mathbb{1} \vert + \mathcal{O}(\vert \lambda_2 \vert)\) with \(\vert \lambda_2 \vert < 1\) and \(R > 0\).
[6]:
# right eigenvector
T = TransferMatrix([AL], [AL])
lambdas, Rs = T.get_leading_eigenpairs(k=2)
lambda1, lambda2 = lambdas[0], lambdas[1]
R = Rs[0]
R /= np.trace(R)
ERs, _ = np.linalg.eig(R)
# left eigenvector
T = TransferMatrix([AL], [AL], transpose=True)
mus, Ls = T.get_leading_eigenpairs(k=2)
L = Ls[0]
L /= np.trace(L)
assert np.allclose(np.abs(lambdas), np.abs(mus))
print("lambda_1 = ", lambda1)
print("|lambda_2| = ", np.abs(lambda2))
print("R > 0 with eigenvalues", np.real_if_close(ERs))
print("L = 1:", np.allclose(L, np.eye(4)/4))
lambda_1 = (1.0000000000000038-1.6653345369377348e-16j)
|lambda_2| = 0.6509219530088591
R > 0 with eigenvalues [0.69095712 0.22999861 0.01121072 0.06783355]
L = 1: True
Show that \(T_{A_R} = \vert \mathbb{1} \rangle \langle L \vert + \mathcal{O}(\vert \lambda_2 \vert)\) with \(\vert \lambda_2 \vert < 1\) and \(L > 0\).
[7]:
# right eigenvector
T = TransferMatrix([AR], [AR])
lambdas, Rs = T.get_leading_eigenpairs(k=2)
lambda1, lambda2 = lambdas[0], lambdas[1]
R = Rs[0]
R /= np.trace(R)
# left eigenvector
T = TransferMatrix([AR], [AR], transpose=True)
lambdas, Ls = T.get_leading_eigenpairs(k=2)
lambda1, lambda2 = lambdas[0], lambdas[1]
L = Ls[0]
L /= np.trace(L)
ELs, _ = np.linalg.eig(L)
assert np.allclose(np.abs(lambdas), np.abs(mus))
print("lambda_1 = ", lambda1)
print("|lambda_2| = ", np.abs(lambda2))
print("R = 1:", np.allclose(R, np.eye(4)/4))
print("L > 0 with eigenvalues", np.real_if_close(ELs))
lambda_1 = (1.000000000000003+0j)
|lambda_2| = 0.6509219530088584
R = 1: True
L > 0 with eigenvalues [0.69095712 0.22999861 0.01121072 0.06783355]
Show that \(A_C = A_L C = C A_R\).
[8]:
AC_L = np.tensordot(AL, C, axes=(2, 0)) # vL p [vR], [vL] vR -> vL p vR
AC_R = np.tensordot(C, AR, axes=(1, 0)) # vL [vR], [vL] p vR -> vL p vR
print(np.linalg.norm(AC_L - AC))
print(np.linalg.norm(AC_R - AC))
0.0
9.774997529390909e-16
Directly create a random
UniformMPS(for different tolerances) and test its canonical form.
[9]:
psi_random = UniformMPS.from_desired_bond_dimension(D=100, d=3, tol=1.e-10)
print(psi_random.test_canonical_form())
psi_random = UniformMPS.from_desired_bond_dimension(D=100, d=3, tol=1.e-5)
print(psi_random.test_canonical_form())
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 5.160377003601066e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.110476558538116e-14.
[2.84400437e-14 2.85188495e-14 0.00000000e+00 1.17873048e-14]
AL, L: Converged up to tol=1e-05. Final error after 6 iterations: 3.649522639547124e-06.
AR, R: Converged up to tol=1e-05. Final error after 6 iterations: 1.7342692594901902e-07.
[2.81704332e-14 2.90117149e-14 0.00000000e+00 1.73426926e-07]
1.2) AKLT state
For the spin-1 matrices \(S_x\), \(S_y\) and \(S_z\), we consider the two-site Hamiltonian matrix
The Hamiltonian for multiple sites then simply reads \(H = \sum_{n} h_{n, n+1}\). The eigenenergy is minimized (with a value of \(-2/3\)), if every bond has total spin \(S = 0\) or \(S = 1\). This is fulfilled by distributing spin-1/2 singlets between all neighbor-sites and projecting every site onto the \(S = 1\) subspace. This is the AKLT state \(\vert \psi_{\mathrm{AKLT}} \rangle\). A few lines derivation shows that it can be represented exactly by a uMPS \(\vert \psi(A) \rangle\) with left orthonormal tensor
Implement \(h, h^2 \in \mathbb{C}^{3 \times 3 \times 3 \times 3}\).
[10]:
d = 3
# spin-1 matrices
Sx = np.array([[0., 1., 0.],[1., 0., 1.],[0., 1., 0.]]) / np.sqrt(2)
Sy = -1.j * np.array([[0., 1., 0.],[-1., 0., 1.],[0., -1., 0.]]) / np.sqrt(2)
Sz = np.array([[1., 0., 0.],[0., 0., 0.],[0., 0., -1.]])
# Hamiltonian
S_dot_S = np.kron(Sx, Sx) + np.kron(Sy, Sy) + np.kron(Sz, Sz)
h = S_dot_S + (1/3.) * S_dot_S @ S_dot_S
h2 = h @ h
h = np.reshape(h, (d, d, d, d))
h2 = np.reshape(h2, (d, d, d, d))
Bring the above defined \(A_L\) into canonical form and initialize \(\vert \psi_{\mathrm{AKLT}} \rangle\) as a
UniformMPS.
[11]:
D = 2
AL = np.zeros((D, d, D), dtype=complex)
AL[:, 0, :] = np.sqrt(2/3.) * np.array([[0., 0.],[1., 0.]])
AL[:, 1, :] = np.sqrt(1/3.) * np.array([[1., 0.],[0., -1.]])
AL[:, 2, :] = -np.sqrt(2/3.) * np.array([[0., 1.],[0., 0.]])
AR, C = UniformMPS.right_orthonormalize(AL)
AC = np.tensordot(AL, C, axes=(2, 0)) # vL p [vR], [vL] vR
psi_AKLT = UniformMPS(AL, AR, AC, C)
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 1.7071693894322978e-16.
Show the following properties of \(\vert \psi_{\mathrm{AKLT}} \rangle\):
Ground state energy \(e = \langle h \rangle = -2/3\),
Variance \(\langle h^2 \rangle - \langle h \rangle^2 = 0\) (H is frustration free),
Entanglement entropy \(S = \ln(2) \approx 0.6931471805599453\),
Correlation length \(\xi = -1/\ln(\vert \lambda_2 \vert) = -1/\ln(1/3) = 1/\ln 3 \approx 0.9102392266268371\),
Connected correlation function \(C(n) = \langle S_z^0 S_z^n \rangle - \langle S_z \rangle^2 \rightarrow \vert \lambda_2 \vert^{n-1}\).
[12]:
# ground state energy
print("e = ", psi_AKLT.get_bond_expectation_value(h))
# variance
print("var_e = ", psi_AKLT.get_bond_expectation_value(h2) - psi_AKLT.get_bond_expectation_value(h)**2)
# entanglement entropy
print("S = ", psi_AKLT.get_entanglement_entropy())
# correlation length
print("xi = ", psi_AKLT.get_correlation_length())
# second largest eigenvalue (to check consistency with formula above)
T = TransferMatrix([psi_AKLT.AL], [psi_AKLT.AL])
lambdas, _ = T.get_leading_eigenpairs(k=2)
lambda2 = lambdas[1]
print("|lambda2| = ", np.abs(lambda2))
e = -0.6666666666666666
var_e = -5.551115123125783e-17
S = 0.6931471805599453
xi = 0.9102392266268375
|lambda2| = 0.3333333333333333
[13]:
# correlation functions
N = 50
ns = np.arange(1, N+1)
Cs = psi_AKLT.get_correlation_functions(Sz, Sz, N)
Cs_connected = Cs - psi_AKLT.get_site_expectation_value(Sz)**2
Cs_theo = []
for n in ns:
Cs_theo.append(np.abs(lambda2)**(n-1))
plt.figure(figsize=(6, 4))
plt.xlabel(r"$n$")
plt.semilogy(ns, Cs_connected, "x", label=r"$C(n)$")
plt.semilogy(ns, Cs_theo, "-", label=r"$\vert \lambda_2 \vert^{n-1}$")
plt.legend(loc="best")
plt.show()
1.3) Conversions between uniform MPS and infinite MPS
Convert the
UniformMPS(uMPS) \(\vert \psi_{\mathrm{AKLT}} \rangle\) to aSimpleMPS(bc="infinite")(iMPS) and recheck the values of \(e\), \(S\), \(\xi\).
[14]:
psi_AKLT_infinite = psi_AKLT.to_infinite_MPS(L=1)
# ground state energy
print("e = ", psi_AKLT_infinite.bond_expectation_value([h]))
# variance
print("var_e = ", psi_AKLT_infinite.bond_expectation_value([h2]) \
- psi_AKLT_infinite.bond_expectation_value([h])**2)
# entanglement entropy
print("S = ", psi_AKLT_infinite.entanglement_entropy())
# correlation length
print("xi = ", psi_AKLT_infinite.correlation_length())
e = [-0.66666667]
var_e = [-1.11022302e-16]
S = [0.69314718]
xi = 0.9102392266268375
Denote by \(B \in \mathbb{C}^{2 \times 3 \times 2}\) the right canonical tensor of \(\vert \psi_{\mathrm{AKLT}} \rangle\) and by \(U \in \mathbb{C}^{2 \times 2}\) a random unitary. Show that the iMPS \(\vert\psi(B_1, B_2)\rangle\) with \(B_1 = BU\) and \(B_2 = U^*B\) is translation invariant and can be converted to a uMPS. Check that this is still the AKLT state.
[15]:
B = psi_AKLT_infinite.Bs[0]
C = psi_AKLT_infinite.Ss[0]
from scipy.stats import unitary_group
U = unitary_group.rvs(2)
B1 = np.tensordot(B, U, axes=(2, 0))
B2 = np.tensordot(np.conj(U).T, B, axes=(1, 0))
psi_infinite = SimpleMPS([B1, B2], [C, C], bc="infinite")
psi_uniform = UniformMPS.from_infinite_MPS(psi_infinite)
# ground state energy
print("e = ", psi_uniform.get_bond_expectation_value(h))
# variance
print("var_e = ", psi_uniform.get_bond_expectation_value(h2) - psi_uniform.get_bond_expectation_value(h)**2)
# entanglement entropy
print("S = ", psi_uniform.get_entanglement_entropy())
# correlation length
print("xi = ", psi_uniform.get_correlation_length())
Infinite MPS is translation invariant -> Conversion to uniform MPS.
AL, L: Converged up to tol=1e-10. Final error after 5 iterations: 6.61998662436351e-14.
AR, R: Converged up to tol=1e-10. Final error after 5 iterations: 6.072741058878367e-12.
e = -0.666666666666667
var_e = -3.3306690738754696e-16
S = 0.6931471805599452
xi = 0.9102392266268376
For random right canonical tensors \(B_1 \in \mathbb{C}^{D \times d \times D}\) and \(B_2 \in \mathbb{C}^{D \times d \times D}\), show that the iMPS \(\vert\psi(B_1, B_2)\rangle\) is in general not translation invariant and cannot be converted to a uMPS.
[16]:
tensor1 = UniformMPS.get_random_tensor(D=100, d=3)
tensor2 = UniformMPS.get_random_tensor(D=100, d=3)
_, B1, _, S1 = UniformMPS.to_canonical_form(tensor1)
_, B2, _, S2 = UniformMPS.to_canonical_form(tensor2)
S1, S2 = np.diag(S1), np.diag(S1)
psi_infinite = SimpleMPS([B1, B2], [S1, S2], bc="infinite")
psi_uniform = UniformMPS.from_infinite_MPS(psi_infinite)
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.2394265643359109e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.1281732550398951e-14.
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 3.533688421854138e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.3225822984078935e-14.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[16], line 8
5 S1, S2 = np.diag(S1), np.diag(S1)
7 psi_infinite = SimpleMPS([B1, B2], [S1, S2], bc="infinite")
----> 8 psi_uniform = UniformMPS.from_infinite_MPS(psi_infinite)
File ~/Library/Mobile Documents/com~apple~CloudDocs/master/thesis/python/tenpy_toycodes/tenpy_toycodes/f_umps.py:163, in UniformMPS.from_infinite_MPS(cls, psi)
161 lambda1, U = T.get_leading_eigenpairs(k=1)
162 if np.abs(np.abs(lambda1) - 1.) > 1.e-8:
--> 163 raise ValueError(f"Infinite MPS is not translation invariant.")
164 else:
165 print(f"Infinite MPS is translation invariant -> Conversion to uniform MPS.")
ValueError: Infinite MPS is not translation invariant.
Transverse field Ising model
In the following we want to use uMPS methods to find the ground state, elementary excitations and time-evolved states of the transverse field Ising (TFI) model
\(\mathbb{Z}_2-\mathrm{symmetry}\): \([H, U] = 0\) with \(U = \prod\limits_n \sigma^x_n\), local order parameter: magnetization density \(\langle \sigma^z \rangle\). From connecting the two limits of the transverse field \(g\) we expect the following quantum phase diagram:
Ferromagnetic phase \(g < g_c\)
two degenerate, symmetry broken ground states related by \(U\) (\(\ket{...\uparrow\uparrow\uparrow...}\) and \(\ket{...\downarrow\downarrow\downarrow...}\) for \(g = 0\))
\(\langle \sigma^z \rangle = \pm m \neq 0\) (\(m = 1\) for \(g = 0\))
elementary excitations: topological domain walls (\(\ket{...\uparrow\uparrow\uparrow \downarrow\downarrow\downarrow...}\) for \(g = 0\))
Paramagnetic phase \(g > g_c\)
unique symmetric ground state (\(\ket{...\rightarrow\rightarrow\rightarrow...}\) for \(g \to \infty\))
\(\langle \sigma^z \rangle = 0\)
elementary excitations: single spin flips (\(\ket{...\rightarrow\rightarrow \leftarrow \rightarrow\rightarrow...}\) for \(g \to \infty\))
Quantum phase transition at \(g_c\)
By performing Jordan-Wigner, Fourier and Bogoliubov transformations, the TFI model (with PBC) can be diagonalized analytically. The Hamiltonian in terms of fermionic creation and annihilation operators \(\gamma_{p}^{\dagger}\) and \(\gamma_{p}\) reads
Single particle excitation energy: \(\epsilon_p = 2 \sqrt{1 - 2g\cos(p) + g^2}\) \(\Rightarrow\) energy gap closes at quantum critical point \(g_c = 1\).
Ground state energy: \(E_0 = -\sum_{p} \epsilon_p/2\) \(\Rightarrow\) ground state energy density in the thermodynamic limit: \(e_0 = - \frac{1}{2\pi} \int_{-\pi}^{\pi} \epsilon_p/2\). [2]
2) g_vumps.py: Variational ground state search
[17]:
from tenpy_toycodes.b_model import TFIModel
from tenpy_toycodes.tfi_exact import infinite_gs_energy
from tenpy_toycodes.f_umps import UniformMPS
from tenpy_toycodes.g_vumps import vumps_algorithm
For the transverse field Ising model in the thermodynamic limit, we want to find the ground state using the vumps_algorithm.
Investigate the convergence of the ground state energy density \(e_0\) with the bond dimension \(D\) by comparison to the exact value \(e_{0, \mathrm{exact}}\) from
tfi_exact.py. Consider both the paramagnetic and ferromagnetic quantum phase.
[18]:
# paramagnetic phase
g = 1.5
e0_exact = infinite_gs_energy(J=1., g=g)
print(f"e0_exact = {e0_exact}.")
h = TFIModel(L=1, J=1., g=g, bc='infinite').H_bonds[0]
Ds = [2, 4, 6, 8, 10, 20, 30, 40, 50]
for D in Ds:
print(f"D = {D}:")
guess_psi0 = UniformMPS.from_desired_bond_dimension(D)
e0, psi0, var0 = vumps_algorithm(h, guess_psi0, tol=1.e-10)
print(f"Error |e0 - e0_exact| = {np.abs(e0 - e0_exact)}.")
e0_exact = -1.6719262215361952.
D = 2:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 3.433175098891678e-16.
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 3.002224531865041e-16.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 20 iterations: 9.210796182977178e-11.
Ground state energy density: -1.6717366238936098.
Ground state variance density: (0.0009884261168258135-3.318547407668872e-16j).
Error |e0 - e0_exact| = 0.00018959764258541512.
D = 4:
AL, L: Converged up to tol=1e-10. Final error after 6 iterations: 1.6416461005434968e-15.
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 1.988642383455023e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 13 iterations: 8.343422248164067e-11.
Ground state energy density: -1.6719259668748474.
Ground state variance density: (1.3262843201050645e-06+1.3097162243624894e-16j).
Error |e0 - e0_exact| = 2.546613477871773e-07.
D = 6:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.1484406586186222e-15.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 3.1480378662432165e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 13 iterations: 2.965467915183786e-11.
Ground state energy density: -1.6719262211612977.
Ground state variance density: (2.1214398918112387e-09+1.7878493824285968e-16j).
Error |e0 - e0_exact| = 3.7489744642016376e-10.
D = 8:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.469808767136904e-15.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 5.983872605870097e-16.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 188 iterations: 9.942778749533454e-11.
Ground state energy density: -1.671926221505121.
Ground state variance density: (3.215992055993766e-10-4.8138576458356397e-17j).
Error |e0 - e0_exact| = 3.107425428083843e-11.
D = 10:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.6364505246635312e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 7.857431660737318e-16.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 11 iterations: 4.288092974547247e-11.
Ground state energy density: -1.671926221535696.
Ground state variance density: (2.846792246380403e-12+2.837357085394565e-16j).
Error |e0 - e0_exact| = 4.991562718714704e-13.
D = 20:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.250443396748274e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 4.630789143521984e-13.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 7 iterations: 6.898039999350345e-11.
Ground state energy density: -1.671926221536191.
Ground state variance density: (8.465450562766819e-16-3.142017895862992e-16j).
Error |e0 - e0_exact| = 4.218847493575595e-15.
D = 30:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 2.0829527816121544e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.181073574827011e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 6 iterations: 5.309293517221375e-11.
Ground state energy density: -1.671926221536187.
Ground state variance density: (-1.2559397966072083e-15+3.052029115546695e-17j).
Error |e0 - e0_exact| = 8.215650382226158e-15.
D = 40:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 9.549639113154081e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 4.4514805984846205e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 5 iterations: 6.232350493390576e-11.
Ground state energy density: -1.6719262215361896.
Ground state variance density: (3.677613769070831e-16-2.1028101135356358e-16j).
Error |e0 - e0_exact| = 5.551115123125783e-15.
D = 50:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 7.584092464589562e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.3944783961516874e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 5 iterations: 1.1611269500828653e-11.
Ground state energy density: -1.671926221536184.
Ground state variance density: (-5.134781488891349e-16-6.503451206382738e-16j).
Error |e0 - e0_exact| = 1.1102230246251565e-14.
[19]:
# ferromagnetic phase
g = 0.5
e0_exact = infinite_gs_energy(J=1., g=g)
print(f"e0_exact = {e0_exact}.")
h = TFIModel(L=1, J=1., g=g, bc='infinite').H_bonds[0]
Ds = [2, 4, 6, 8, 10, 20, 30, 40, 50]
for D in Ds:
print(f"D = {D}:")
guess_psi0 = UniformMPS.from_desired_bond_dimension(D)
e0, psi0, var0 = vumps_algorithm(h, guess_psi0, tol=1.e-10)
print(f"Error |e0 - e0_exact| = {np.abs(e0 - e0_exact)}.")
e0_exact = -1.0635444099733717.
D = 2:
AL, L: Converged up to tol=1e-10. Final error after 5 iterations: 7.57966017471328e-13.
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 1.9833587450108286e-16.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 10 iterations: 7.922695003270745e-11.
Ground state energy density: -1.0635440740663125.
Ground state variance density: (1.2520078542597578e-06+1.2942663434045709e-17j).
Error |e0 - e0_exact| = 3.359070592789948e-07.
D = 4:
AL, L: Converged up to tol=1e-10. Final error after 6 iterations: 6.5136586600068804e-12.
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 4.883423751465251e-16.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 18 iterations: 9.327632093569487e-11.
Ground state energy density: -1.0635444098648699.
Ground state variance density: (4.044145310517014e-10+9.007687174281132e-17j).
Error |e0 - e0_exact| = 1.0850187415201162e-10.
D = 6:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 9.058386608355725e-16.
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 4.226464292378151e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 15 iterations: 9.67645943715699e-11.
Ground state energy density: -1.0635444099733302.
Ground state variance density: (1.3094907103106124e-13+1.7376287989858893e-16j).
Error |e0 - e0_exact| = 4.1522341120980855e-14.
D = 8:
AL, L: Converged up to tol=1e-10. Final error after 6 iterations: 5.316484448587735e-13.
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 2.423779128329228e-13.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 317 iterations: 9.915982133486439e-11.
Ground state energy density: -1.063544409973364.
Ground state variance density: (7.567731163948821e-17+1.7987845777776498e-16j).
Error |e0 - e0_exact| = 7.771561172376096e-15.
D = 10:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 8.812965228195451e-14.
AR, R: Converged up to tol=1e-10. Final error after 6 iterations: 1.3481906172769791e-11.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 5 iterations: 2.272068073490711e-11.
Ground state energy density: -1.0635444099733644.
Ground state variance density: (1.3162214373974024e-16-7.743575203798814e-17j).
Error |e0 - e0_exact| = 7.327471962526033e-15.
D = 20:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.039201600851797e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.8374550966413603e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 6.720350894589906e-12.
Ground state energy density: -1.063544409973367.
Ground state variance density: (-1.1926223897340549e-17-2.2466701892973062e-17j).
Error |e0 - e0_exact| = 4.6629367034256575e-15.
D = 30:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 2.514209551478997e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 3.068103422403684e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 2.9432917813550773e-13.
Ground state energy density: -1.063544409973371.
Ground state variance density: (9.324138683375338e-17+1.399654182701951e-16j).
Error |e0 - e0_exact| = 6.661338147750939e-16.
D = 40:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 2.2361075738713263e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.994104040916385e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 3.362370163700937e-12.
Ground state energy density: -1.0635444099733689.
Ground state variance density: (1.3053794156725473e-16+2.1479061476474548e-17j).
Error |e0 - e0_exact| = 2.886579864025407e-15.
D = 50:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 2.4577434914058804e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 5.054128137274031e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 4.703516044452661e-12.
Ground state energy density: -1.0635444099733635.
Ground state variance density: (1.5048726154098802e-16+2.1115514935513002e-16j).
Error |e0 - e0_exact| = 8.215650382226158e-15.
Plot the ground state magnetization \(m = \vert \langle \sigma^z \rangle \vert\) against the transverse field \(g\) to locate the quantum phase transition at \(g_c = 1\).
[20]:
D = 30
gs = [1.e-5, 0.2, 0.4, 0.6, 0.8, 0.9, 0.95, 0.96, 0.97, 0.98, 0.99, 0.994, 0.998,\
1.002, 1.006, 1.01, 1.02, 1.03, 1.04, 1.05, 1.1, 1.2, 1.4, 1.6, 1.8, 2.0]
szs = []
for g in gs:
print(f"g = {g}:")
tfi_model = TFIModel(L=1, J=1., g=g, bc='infinite')
h = tfi_model.H_bonds[0]
guess_psi0 = UniformMPS.from_desired_bond_dimension(D)
_, psi0, _ = vumps_algorithm(h, guess_psi0, tol=1.e-10)
sz = psi0.get_site_expectation_value(tfi_model.sigmaz)
print(f"Magnetization density in z-direction: {sz}.")
szs.append(sz)
g = 1e-05:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 5.745137550922195e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.1654736221483724e-13.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 3 iterations: 6.312205871504861e-11.
Ground state energy density: -1.0000000000249984.
Ground state variance density: (-1.8387855445045062e-27-2.2791630740601794e-27j).
Magnetization density in z-direction: -0.999999999987502.
g = 0.2:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.745230204340761e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 2.656257531041552e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 3 iterations: 8.161073903835787e-12.
Ground state energy density: -1.010025253984573.
Ground state variance density: (-9.697510806525034e-17-1.269278871460569e-18j).
Magnetization density in z-direction: 0.9949102475941962.
g = 0.4:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 3.14118642758063e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.0612336432188384e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 3 iterations: 4.2246594200230875e-11.
Ground state energy density: -1.0404170862387485.
Ground state variance density: (5.771066513126505e-12-1.1530235994499163e-17j).
Magnetization density in z-direction: -0.9784416036497425.
g = 0.6:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.501991820108035e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 2.101790206060161e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 1.1753286814882392e-11.
Ground state energy density: -1.0922385835546868.
Ground state variance density: (-4.9873299934333204e-17-3.3176586478056436e-17j).
Magnetization density in z-direction: 0.9457416090031749.
g = 0.8:
AL, L: Converged up to tol=1e-10. Final error after 8 iterations: 2.02510278494247e-15.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 2.7263283066726677e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 7 iterations: 7.911923805877036e-11.
Ground state energy density: -1.1678095085207305.
Ground state variance density: (-2.949029909160572e-17+8.315830662963819e-17j).
Magnetization density in z-direction: 0.8801117367933919.
g = 0.9:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 7.129913139702856e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.1190622062170515e-13.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 29 iterations: 9.413646027675471e-11.
Ground state energy density: -1.2160009141097903.
Ground state variance density: (1.4519635493925875e-15+7.547131322671596e-16j).
Magnetization density in z-direction: -0.8125389716241237.
g = 0.95:
AL, L: Converged up to tol=1e-10. Final error after 8 iterations: 1.2604606536377943e-15.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.3228069396936037e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 50 iterations: 8.892384841230891e-11.
Ground state energy density: -1.243265704270415.
Ground state variance density: (1.3822276656583199e-14+7.903291736333085e-16j).
Magnetization density in z-direction: -0.7475247509624986.
g = 0.96:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.5847623063912433e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.2465950516696914e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 59 iterations: 9.223821225214692e-11.
Ground state energy density: -1.249016492395998.
Ground state variance density: (5.794323354457731e-14+4.6214117602194626e-17j).
Magnetization density in z-direction: -0.7274271525615083.
g = 0.97:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 2.2428241792708054e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 7.678196385628674e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 57 iterations: 8.697651525512758e-11.
Ground state energy density: -1.254878420391596.
Ground state variance density: (2.7549143521987673e-13-2.0491421059976034e-17j).
Magnetization density in z-direction: 0.7021799675148022.
g = 0.98:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.899053822881254e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.7130106365713554e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 63 iterations: 9.485895943134318e-11.
Ground state energy density: -1.2608596438310224.
Ground state variance density: (1.9199745959763703e-12+1.1115918298679195e-15j).
Magnetization density in z-direction: 0.6679007034421955.
g = 0.99:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.0952354987411084e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.2469285777283407e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 66 iterations: 9.030889382855843e-11.
Ground state energy density: -1.2669721934560787.
Ground state variance density: (2.8887649217157474e-11+9.816366469683757e-16j).
Magnetization density in z-direction: -0.6128535976810912.
g = 0.994:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 9.50826908222646e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 2.623695201005492e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 114 iterations: 9.797577750192581e-11.
Ground state energy density: -1.2694582863812958.
Ground state variance density: (1.4687944957514354e-10-4.948705291038524e-16j).
Magnetization density in z-direction: -0.5750897890928011.
g = 0.998:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 3.711814009170964e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.8623643419917193e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 73 iterations: 8.608592422470488e-11.
Ground state energy density: -1.2719712708654303.
Ground state variance density: (1.3703400497666607e-09+1.472346550235315e-16j).
Magnetization density in z-direction: -0.5015035111269169.
g = 1.002:
AL, L: Converged up to tol=1e-10. Final error after 8 iterations: 1.5418560433596118e-15.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.162592869394791e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 141 iterations: 8.998323870091882e-11.
Ground state energy density: -1.2745177365002485.
Ground state variance density: (1.6412371833113282e-08+4.50079426853045e-16j).
Magnetization density in z-direction: 2.755694977762957e-13.
g = 1.006:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.878753560603624e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.3286647807077504e-13.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 225 iterations: 9.732804619486454e-11.
Ground state energy density: -1.2770975272148863.
Ground state variance density: (2.3451185091061255e-09-3.874938564463193e-16j).
Magnetization density in z-direction: -1.5037764436454104e-10.
g = 1.01:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 7.258764938836472e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.034949727666076e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 254 iterations: 9.81336946236987e-11.
Ground state energy density: -1.2797037635358637.
Ground state variance density: (7.366018454912915e-10+2.480654570646834e-16j).
Magnetization density in z-direction: -3.1195608596323865e-11.
g = 1.02:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.952998096542909e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 3.2677446423261623e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 71 iterations: 9.312855606695674e-11.
Ground state energy density: -1.2863187148765407.
Ground state variance density: (7.758735320884114e-11-3.944327503502265e-16j).
Magnetization density in z-direction: 4.001287495780659e-11.
g = 1.03:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.952075902127289e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.3805806632851974e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 64 iterations: 9.604624516330851e-11.
Ground state energy density: -1.2930580407562364.
Ground state variance density: (1.5544163178837778e-11-4.651227319962814e-16j).
Magnetization density in z-direction: 2.577100338685412e-11.
g = 1.04:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 1.4522678411259032e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.295029031029484e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 55 iterations: 9.780903298334128e-11.
Ground state energy density: -1.2999073549362836.
Ground state variance density: (4.2605294292563656e-12-4.823615465388009e-16j).
Magnetization density in z-direction: 7.311553272548732e-12.
g = 1.05:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.2518289142685216e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 2.5335909506341314e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 289 iterations: 9.698528705657107e-11.
Ground state energy density: -1.3068564702706515.
Ground state variance density: (1.654704151476949e-12-1.3338397227002918e-16j).
Magnetization density in z-direction: -1.1537437671904627e-12.
g = 1.1:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 8.598626551547987e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.0111068626750637e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 50 iterations: 9.92750146466495e-11.
Ground state energy density: -1.342864022725115.
Ground state variance density: (2.6451063561694355e-14-8.95415469201466e-16j).
Magnetization density in z-direction: 2.0685536616937839e-13.
g = 1.2:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 7.377253962672713e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.456463666559525e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 27 iterations: 9.652287756842463e-11.
Ground state energy density: -1.419619274898223.
Ground state variance density: (4.579669976578771e-16+4.3237982638721917e-16j).
Magnetization density in z-direction: 1.8610113450279187e-14.
g = 1.4:
AL, L: Converged up to tol=1e-10. Final error after 8 iterations: 1.3171818056367935e-15.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 2.5766567867363824e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 9 iterations: 7.480485683340944e-11.
Ground state energy density: -1.5851883000539688.
Ground state variance density: (-1.3461454173580023e-15-6.223320470066795e-16j).
Magnetization density in z-direction: -5.7055055124877185e-15.
g = 1.6:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 8.201089266841845e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.2156251835819366e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 5 iterations: 3.7446117015194653e-11.
Ground state energy density: -1.7605081222045873.
Ground state variance density: (7.632783294297951e-16+3.739481055538285e-16j).
Magnetization density in z-direction: -5.2784165927022286e-14.
g = 1.8:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 6.931999391244948e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.1067441034443073e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 3.814632297128336e-11.
Ground state energy density: -1.9418043043913777.
Ground state variance density: (-8.895661984809067e-15+1.1904539853890839e-16j).
Magnetization density in z-direction: 1.56875207268925e-12.
g = 2.0:
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.487714260056109e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.1515006758115014e-14.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 1.4555760667419244e-11.
Ground state energy density: -2.1270888199467226.
Ground state variance density: (-6.938893903907228e-17+1.4818333192445632e-16j).
Magnetization density in z-direction: 5.343919751155113e-13.
[21]:
plt.figure(figsize=(6, 4))
plt.title(f"TFI quantum phase diagram with VUMPS ($D={D}$)")
plt.axvline(x=1.0, color="darkblue")
plt.plot(gs, np.abs(szs), ".-", color="cornflowerblue")
plt.xlabel(r"transverse field $g$")
plt.ylabel(r"magnetization $\vert \langle \sigma^z \rangle \vert$")
plt.show()
3) h_utdvp.py: Global quench dynamics
[22]:
from tenpy_toycodes.b_model import TFIModel
from tenpy_toycodes.c_tebd import example_TEBD_gs_tf_ising_infinite, calc_U_bonds, update_bond
from tenpy_toycodes.f_umps import UniformMPS
from tenpy_toycodes.g_vumps import vumps_algorithm
from tenpy_toycodes.h_utdvp import utdvp_algorithm
Consider the following global quench dynamics for the TFI model: the ground state for a value \(g_1\) of the transverse field is time-evolved according to a different value \(g_2\),
We want to implement this time evolution using the utdvp_algorithm. For benchmark we use iTEBD. The run_TEBD function in c_tebd.py relies on a first order Trotter decomposition. We want to improve this to second order:
Implement this improved scheme in a function
run_TEBD_second_order.Then write a function
itebd_global_quenchperforming the global quench dynamics described above. Converge the method in bond dimension \(D\) and time step \(dt\).
[23]:
def run_TEBD_second_order(psi, U_bonds, U_bonds_half_dt, N_steps, chi_max, eps):
"""Evolve MPS psi for N_steps time steps with second order TEBD.
H = H_odd + H_even
U = exp(-i * dt * H) \\approx exp(-i * dt/2 * H_odd) exp(-i * dt * H_even) exp(-i* dt/2 *H_odd)
"""
Nbonds = psi.L - 1 if psi.bc == 'finite' else psi.L
assert len(U_bonds) == len(U_bonds_half_dt) == Nbonds
for i_bond in range(0, Nbonds, 2): # odd (half)
update_bond(psi, i_bond, U_bonds_half_dt[i_bond], chi_max, eps)
for i_bond in range(1, Nbonds, 2): # even
update_bond(psi, i_bond, U_bonds[i_bond], chi_max, eps)
for n in range(N_steps - 1): # N_steps - 1 times odd, even
for k in [0, 1]:
for i_bond in range(k, Nbonds, 2):
update_bond(psi, i_bond, U_bonds[i_bond], chi_max,eps)
for i_bond in range(0, Nbonds, 2): # odd (half)
update_bond(psi, i_bond, U_bonds_half_dt[i_bond], chi_max, eps)
def itebd_global_quench(g1, g2, chi_max, dt, T):
"""Calculate the tfi ground state for transverse field g1 and evolve it according to different g2
up to time T in steps of dt with second order iTEBD."""
_, psi1, _ = example_TEBD_gs_tf_ising_infinite(g1, chi_max)
model2 = TFIModel(L=2, J=1., g=g2, bc="infinite")
H_bonds = model2.H_bonds
U_bonds = calc_U_bonds(H_bonds, 1.j * dt)
U_bonds_half_dt = calc_U_bonds(H_bonds, 1.j * dt/2)
ts = []
Ss = []
t = 0.
ts.append(t)
Ss.append(psi1.entanglement_entropy()[1])
psi = psi1
for i in range(int(T/dt)):
run_TEBD_second_order(psi, U_bonds, U_bonds_half_dt, N_steps=1, chi_max=chi_max, eps=1.e-10)
t += dt
ts.append(t)
Ss.append(psi.entanglement_entropy()[0])
return ts, Ss
[24]:
g1 = 3.
g2 = 1.5
T = 5.
[25]:
plt.figure(figsize=(6, 4))
plt.title(f"TFI global quench with $g_2={g2}$ on GS of $g_1={g1}$ (iTEBD)")
plt.xlabel('time $t$')
plt.ylabel('entanglement entropy')
for dt in [0.1, 0.01, 0.001]:
for D in [10, 20, 30]:
ts_itebd, Ss_itebd = itebd_global_quench(g1, g2, D, dt, T)
plt.plot(ts_itebd, Ss_itebd, label=f"D={D}, dt={dt}")
plt.legend(loc='center left', bbox_to_anchor=(1, 0.5))
plt.show()
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [10, 10]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.886591626230449
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [11, 11]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8939157106447442
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [11, 11]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8939157106447435
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [10, 10]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8865916262304465
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [11, 11]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8939157106447669
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [11, 11]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8939157106447387
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [10, 10]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8865916262304483
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [11, 11]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8939157106447684
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [11, 11]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8939157106447557
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
Analogous to
itebd_global_quench, write a functionutdvp_global_quenchand make sure they give the same dynamics.
[26]:
def utdvp_global_quench(g1, g2, D, dt, T):
"""Calculate the tfi ground state for transverse field g1 and evolve it according to different g2
up to time T in steps of dt with uTDVP."""
h1 = TFIModel(L=1, J=1., g=g1, bc="infinite").H_bonds[0]
h2 = TFIModel(L=1, J=1., g=g2, bc="infinite").H_bonds[0]
guess_psi1 = UniformMPS.from_desired_bond_dimension(D)
_, psi1, _ = vumps_algorithm(h1, guess_psi1, tol=1.e-10)
ts, Ss = utdvp_algorithm(psi1, h2, dt, T)
return ts, Ss
[27]:
g1 = 3.
g2 = 1.5
D = 30
T = 5.
dt = 0.01
[28]:
ts_itebd, Ss_itebd = itebd_global_quench(g1, g2, D, dt, T)
ts_utdvp, Ss_utdvp = utdvp_global_quench(g1, g2, D, dt, T)
infinite TEBD, imaginary time evolution, transverse field Ising
g=3.00
dt = 0.10000: E (per site) = -3.0722915530137
dt = 0.01000: E (per site) = -3.0827483842174
dt = 0.00100: E (per site) = -3.0838108901537
dt = 0.00010: E (per site) = -3.0839168389419
dt = 0.00001: E (per site) = -3.0839274447472
final bond dimensions: [11, 11]
<sigma_x> = 0.97161
<sigma_z> = -0.00000
correlation length: 0.8939157106447625
Analytic result: E (per site) = -3.0839288503801
relative error: 4.5579290330811456e-07
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 4.989161815670688e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 3.2188988713804404e-15.
uMPS ground state converged with VUMPS up to tol=1e-10 in gradient norm. Final error after 4 iterations: 2.4714217379505394e-12.
Ground state energy density: -3.083928850380077.
Ground state variance density: (-6.245004513516506e-16-5.5294310796760726e-17j).
uMPS evolved with TDVP up to time T=5.0 in steps of dt=0.01.
[29]:
plt.figure(figsize=(6, 4))
plt.title(f"TFI global quench with $g_2={g2}$ on GS of $g_1={g1}$")
plt.xlabel('time $t$')
plt.ylabel('entanglement entropy')
plt.plot(ts_itebd, Ss_itebd, label=f"iTEBD (D={D}, dt={dt})")
plt.plot(ts_utdvp, Ss_utdvp, label=f"uTDVP (D={D}, dt={dt})")
plt.legend(loc='center left', bbox_to_anchor=(1, 0.5))
plt.show()
4) i_uexcitations.py: Variational plane wave excitations
[30]:
from tenpy_toycodes.tfi_exact import infinite_gs_energy, infinite_excitation_dispersion
from tenpy_toycodes.b_model import TFIModel
from tenpy_toycodes.f_umps import UniformMPS
from tenpy_toycodes.g_vumps import vumps_algorithm
from tenpy_toycodes.i_uexcitations import VariationalPlaneWaveExcitationEngine
By running the VariationalPlaneWaveExcitationEngine, we want to compute the single particle excitations \(\epsilon_p = 2 \sqrt{1 - 2g\cos(p) + g^2}\) on top of the TFI ground state.
For this write a function
get_tfi_spectrum, returning both the variational dispersion relation and the exact one fromtfi_exact.py. Actively target topological domain wall excitations for transverse field values \(g < 1\).
[31]:
def get_tfi_spectrum(g, D):
print(f"g = {g:.1f}, D = {D}:")
# exact analytical solution
e0_exact = infinite_gs_energy(J=1., g=g)
print(f"e0_exact = {e0_exact}.")
ps_exact, es_exact = infinite_excitation_dispersion(J=1., g=g)
# vumps and variational plane wave excitations
h = TFIModel(L=1, J=1., g=g, bc='infinite').H_bonds[0]
guess_psi0 = UniformMPS.from_desired_bond_dimension(D)
e0, psi0, _ = vumps_algorithm(h, guess_psi0, tol=1.e-8)
print(f"|e0_exact - e0| = {np.abs(e0_exact - e0)}")
ps = list(np.arange(-np.pi, 0, np.pi/10)) + [0] + list(np.arange(0, np.pi + np.pi/10, np.pi/10))
if g >= 1.: # paramagnetic phase (single spin flip excitations) and critical point (gapless excitation)
es = []
for p in ps:
excitation_engine = VariationalPlaneWaveExcitationEngine(psi0, h, p, k=1, tol=1.e-8)
e, _ = excitation_engine.run()
es.append(e)
return ps_exact, es_exact, ps, es
elif 0 <= g < 1: # ferromagnetic phase (topological domain wall excitations)
sigma_z = TFIModel(L=1, J=1., g=g, bc='infinite').sigmaz
sz = psi0.get_site_expectation_value(sigma_z)
for i in range(100):
guess_psi0_tilde = UniformMPS.from_desired_bond_dimension(D)
_, psi0_tilde, _ = vumps_algorithm(h, guess_psi0_tilde, tol=1.e-8)
sz_tilde = psi0_tilde.get_site_expectation_value(sigma_z)
if np.abs(sz + sz_tilde) < 1.e-5:
print(f"Found sz={sz} and sz_tilde={sz_tilde} after {i+2} ground state searchs.")
es = []
for p in ps:
excitation_engine = VariationalPlaneWaveExcitationEngine(psi0, h, p, k=1, tol=1.e-8, \
psi0_tilde=psi0_tilde)
e, _ = excitation_engine.run()
es.append(e)
return ps_exact, es_exact, ps, es
[32]:
D = 30
ps_exact, es_exact_para, ps, es_para = get_tfi_spectrum(g=1.5, D=D)
_, es_exact_crit, _, es_crit = get_tfi_spectrum(g=1.0, D=D)
_, es_exact_ferro, _, es_ferro = get_tfi_spectrum(g=0.5, D=D)
g = 1.5, D = 30:
e0_exact = -1.6719262215361952.
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 3.960938757655051e-11.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 6.288235903606723e-14.
uMPS ground state converged with VUMPS up to tol=1e-08 in gradient norm. Final error after 4 iterations: 3.897649278681079e-09.
Ground state energy density: -1.671926221535125.
Ground state variance density: (-3.0839913955915677e-12+4.542807102714264e-16j).
|e0_exact - e0| = 1.070254995738651e-12
g = 1.0, D = 30:
e0_exact = -1.2732395447351625.
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 8.370035562611671e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.3174723448174354e-15.
uMPS ground state converged with VUMPS up to tol=1e-08 in gradient norm. Final error after 78 iterations: 9.892290565137428e-09.
Ground state energy density: -1.2732395297253791.
Ground state variance density: (2.3240924379441807e-08+1.6151901864602802e-16j).
|e0_exact - e0| = 1.5009783416175537e-08
g = 0.5, D = 30:
e0_exact = -1.0635444099733717.
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 7.243643498737732e-12.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.3140283050486809e-15.
uMPS ground state converged with VUMPS up to tol=1e-08 in gradient norm. Final error after 4 iterations: 1.6905444333507086e-11.
Ground state energy density: -1.063544409973369.
Ground state variance density: (1.8409752888803865e-16-1.0965688535154172e-17j).
|e0_exact - e0| = 2.6645352591003757e-15
AL, L: Converged up to tol=1e-10. Final error after 7 iterations: 3.590882800043658e-13.
AR, R: Converged up to tol=1e-10. Final error after 7 iterations: 1.266832377228487e-15.
uMPS ground state converged with VUMPS up to tol=1e-08 in gradient norm. Final error after 3 iterations: 5.003229193865994e-09.
Ground state energy density: -1.0635444099732108.
Ground state variance density: (-2.7150373962947505e-13+7.430173013314723e-18j).
Found sz=0.9646786299603096 and sz_tilde=-0.9646786299571539 after 2 ground state searchs.
[33]:
plt.figure(figsize=(6, 4))
plt.title(r"TFI excitations $\epsilon_p = 2 \sqrt{g^2 - 2g\cos(p) + 1}$")
plt.xticks(np.arange(-np.pi, 3*np.pi/2, np.pi/2), \
[r"$-\pi$",r"$-\pi /2$", r"$0$", r"$\pi /2$",r"$\pi$"])
plt.axhline(y=0., color="black")
plt.plot(ps_exact, es_exact_para, color="lightskyblue")
plt.plot(ps, es_para, ".", color="blue", label=r"$g = 1.5$")
plt.plot(ps_exact, es_exact_crit, color="lightcoral")
plt.plot(ps, es_crit, ".", color="darkred", label=r"$g = 1.0$")
plt.plot(ps_exact, es_exact_ferro, color="lightgreen")
plt.plot(ps, es_ferro, ".", color="green", label=r"$g = 0.5$")
plt.xlabel(r"$p$")
plt.ylabel(r"$\epsilon_p$")
plt.legend(title=f"VUMPS + variational perturbations ($D = {D}$)", loc='center left', \
bbox_to_anchor=(1, 0.5))
plt.show()