## Useful Packages for Measurements

#### PyVISA

PyVISA controls your instruments using raw commands.

#### Keithley2600

Keithley2600 controls your Keithley 2600 instruments with abstraction.

#### PyMeasure

PyMeasure controls a wide range of instruments.

Expand

2021/9/13 12:09:41

0%
0%
0%
0%

## DMRG (I): Theory

トニカクタダシイ

### Simple DMRG

#### Basic Theory

Quantum renormalization in real space applies only to single-particle systems.

On each step, the Hamiltonian undergoes a truncation $H^S(M) = V^\dagger H(M\cdot M_S) V,$ where $$V$$ contains the most significant $$M$$ eigenstates of $\rho^S (M\cdot M_S),$ given by the ground state of $H(M\cdot M_S).$

In the algorithm, we should keep track of the creation operators on the boundary sites.

##### Structure of Infinite-Size DMRG
1. Set up an initial chain of length $$L$$.
2. Calculate the ground state of this chain.
3. Get the reduced density matrix $$\rho^S$$.
4. Diagonalize $$\rho^S{}$$ and keep the most significant $$M$$ eigenstates as $$V$$.
5. Reduce $$H$$ to a matrix of size $$M\times M$$, as well as the creation operators at the boundary.
7. Find the ground state of the new system.
##### Structure of Finite-Size DMRG
1. Carry out infinite-size DMRG until the size reaches $$L$$. During this step, store all the Hamiltonians and other necessary steps in the memory.
2. Reduce the matrices (Hamiltonian and creations operators) of $$S$$ to size $$M$$. Before doing the projection, we should first trace out the environment part.
3. Add two sites to $$H_S$$, and reduce the environment to length $$L/2 - 2$$.
4. The procedure of the last two steps is repeated until $$S$$ has size $$L-3$$. The matrices for $$S$$ should still be stored for each size.
5. Reduce the size of $$S$$. For the environment, the stored matrices are used, whereas for the system, the matrices are updated at eac hstep. Carry on until the system $$S$$ has reached size $$1$$.
6. Repeat the up and down sweeps of the previous steps until convergence has been achieved.

### Matrix Product State

Prerequisites: for SVD and QR Decomposition, see Mathematics Miscellany.

###### Conventions
• $$M$$ for general matrices;
• $$\Lambda$$ and $$S$$ for diagonal matrices;
• $$A$$ for left-canonical ones;
• $$B$$ for right-canonical ones.
• Label $$l$$ in $$\ket{a_l}$$ indicates the bond.
• Superscript $$[l]$$ in $$O^{[l]}$$ indicates that the operator lives on site $$l$$.
• OBS unless otherwise stated. Site index from $$1$$ to $$L$$ while bond index from $$1$$ to $$L-1$$.
###### Graphical Notations
 $$\Lambda_{a_{l-1}, a_l}$$ Diagonal Matrix $$A^{\sigma_1}_{1, a_1}{}$$ Row Matrix (MPS) $$A^{\sigma_L}_{a_{L-1}, 1}{}$$ Column Matrix (MPS) $$A^{\sigma_l}_{a_{l-1}, a_l}{}$$ Left or Right Normalized Matrix (MPS) $$A^{\sigma_l *}_{a_{l-1}, a_l}{} = A^{\sigma_l \dagger}_{a_{l}, a_{l-1}}{}$$ Conjugation $$\sum_{\sigma} A^{\sigma \dagger} A^\sigma = \mathbb{1}{}$$ Left Normalization $$\sum_{\sigma} B^{\sigma} B^{\sigma\dagger} = \mathbb{1}{}$$ Right Normalization $$\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} M^{\sigma_1} \cdots M^{\sigma_L} \ket{\sigma_1\cdots \sigma_L}{}$$ MPS String $$W^{\sigma_1 \sigma'_1}_{1,b_1}{}$$ Row Matrix (MPO) $$W^{\sigma_L \sigma'_L}_{b_{L-1},1}{}$$ Column Matrix (MPO) $$W^{\sigma_l \sigma'_l}_{b_{l-1}, b_l}{}$$ Matrix (MPO) $$\hat{O} = \sum_{\vb*{\sigma},\vb*{\sigma}'} W^{\sigma_1 \sigma'_1} \cdots W^{\sigma_L \sigma'_L} \ket{\vb*{\sigma}}\bra{\vb*{\sigma}'}$$ MPO String $$\hat O \ket{\psi} = \sum_{\vb*{\sigma}} N^{\sigma_1} \cdots N^{\sigma_L} \ket{\vb*{\sigma}}$$ MPO Acting on MPS

#### Representations and Conversions ##### Classical Representation

$\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} c_{\sigma_1,\cdots,\sigma_L} \ket{\sigma_1, \cdots, \sigma_L}.$

##### Left-Canonical

$\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} A^{\sigma_2} \cdots A^{\sigma_{L-1}} A^{\sigma_L} \ket{\sigma_1,\cdots,\sigma_L}$ where

• for every $$l$$, $\sum_{\sigma_l} A^{\sigma_l \dagger} A^{\sigma_l} = \mathbb{1};$
• $$A^{\sigma_1}$$'s are row matrices while $$A^{\sigma_L}$$'s are column matrices.
###### From Classical Representation

\begin{align*} c_{\sigma_1,\cdots,\sigma_L} &\xlongequal[\mathrm{reshape}]{} \Psi_{\sigma_1,(\sigma_2,\cdots,\sigma_L)} \\ &\xlongequal{\mathrm{SVD}} \sum_{a_1}^{r_1} U_{\sigma_1,a_1} S_{a_1,a_1} (V^\dagger)_{a_1,(\sigma_2,\cdots,\sigma_L)} \\ &\xlongequal[\mathrm{reshape}]{A^{\sigma_1}_{a_1} = U_{\sigma_1,a_1}} \sum_{a_1}^{r_1} A^{\sigma_1}_{a_1} \Psi_{(a_1\sigma_2),(\sigma_3,\cdots,\sigma_L)} \\ &\xlongequal{\mathrm{SVD}} \sum_{a_1}^{r_1} \sum_{a_2}^{r_2} A^{\sigma_1}_{a_1} U_{(a_1\sigma_2),a_2} S_{a_2,a_2} (V^\dagger)_{a_2,(\sigma_3,\cdots,\sigma_L)} \\ &\xlongequal[\mathrm{reshape}]{A^{\sigma_2}_{a_1,a_2} = U_{(a_1\sigma_2),a_2}} \sum_{a_1}^{r_1} \sum_{a_2}^{r_2} A^{\sigma_1}_{a_1} A^{\sigma_2}_{a_1,a_2} \Psi_{(\sigma_2 a_3),(\sigma_4,\cdots,\sigma_L)} \\ &= \cdots \\ &= \sum_{a_1,\cdots,a_{L-1}} A^{\sigma_1}_{a_1} A^{\sigma_2}_{a_1,a_2} \cdots A^{\sigma_{L-1}}_{a_{L-2},a_{L-1}} A^{\sigma_L}_{a_{L-1}} \end{align*}

###### From General MPS

\begin{align*} \sum_{\sigma_1,\cdots,\sigma_L} \sum_{a_1,\cdots,a_L} M_{(\sigma_1,1),a_1} M^{\sigma_2}_{a_1,a_2} \cdots \ket{\sigma_1\cdots \sigma_L} &= \sum_{\sigma_1,\cdots,\sigma_L} \sum_{a_1,\cdots,a_L} \sum_{s_1} A_{(\sigma_1,1),s_1} S_{s_1,s_1} V^\dagger_{s_1,a_1} M^{\sigma_2}_{a_1,a_2} \cdots \ket{\sigma_1,\cdots,\sigma_L} \\ &= \sum_{\sigma_1,\cdots,\sigma_L} \sum_{a_2,\cdots,a_L} \sum_{s_1} A^{\sigma_1}_{1,s_1} \tilde{M}^{\sigma_2}_{s_1,a_2} M^{\sigma_3}_{a_2,a_3} \cdots \ket{\sigma_1,\cdots,\sigma_L} \\ &= \cdots. \end{align*}

###### From Vidal Notation

$\qty(\Lambda^{} \Gamma^{\sigma_1})\qty(\Lambda^{} \Gamma^{\sigma_2})\qty(\Lambda^{} \Gamma^{\sigma_3})\cdots \rightarrow A^{\sigma_1} A^{\sigma_2} A^{\sigma_3} \cdots.$

##### Right-Canonical

$\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} B^{\sigma_1} B^{\sigma_2} \cdots B^{\sigma_{L-1}} B^{\sigma_L} \ket{\sigma_1,\cdots,\sigma_L}$ where

• for every $$l$$, $\sum_{\sigma_l} B^{\sigma_l} B^{\sigma_l \dagger} = \mathbb{1};$
• $$B^{\sigma_1}$$'s are row matrices while $$B^{\sigma_L}$$'s are column matrices.
###### From Classical Representation

Similar to that of left-canonical ones.

###### From General MPS

Similar to that of left-canonical ones.

###### From Vidal Notation

$\qty(\Gamma^{\sigma_1}\Lambda^{}) \qty(\Gamma^{\sigma_2}\Lambda^{}) \qty(\Gamma^{\sigma_3}\Lambda^{})\cdots \rightarrow B^{\sigma_1} B^{\sigma_2} B^{\sigma_3} \cdots.$

##### Mixed-Canonical

$\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} \cdots A^{\sigma_l} S B^{\sigma_{l+1}} \cdots B^{\sigma_L}.$

###### From Classical Representation

\begin{align*} c_{\sigma_1,\cdots,\sigma_L} &= \sum_{a_l} (A^{\sigma_1} \cdots A^{\sigma_l})_{a_l} S_{a_l,a_l} (V^\dagger)_{a_l,(\sigma_{l+1},\cdots,\sigma_L)} \\ &= \sum_{a_l} (A^{\sigma_1} \cdots A^{\sigma_l})_{a_l} S_{a_l,a_l} (B^{\sigma_{l+1}} \cdots B^{\sigma_L})_{a_l}. \end{align*}

##### Vidal Notation

$\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} \Gamma^{\sigma_1} \Lambda^{} \Gamma^{\sigma_2} \Lambda^{} \cdots \Gamma^{\sigma_{L-1}} \Lambda^{[L-1]} \Gamma^{\sigma_L} \ket{\sigma_1,\cdots,\sigma_L},$ where

• the states on block $$A$$ and $$B$$ given by \begin{align*} \ket{a_l}_A &= \sum_{\sigma_1,\cdots,\sigma_l} \qty(\Gamma^{\sigma_1} \Lambda^{} \Gamma^{\sigma_2} \cdots \Lambda^{[l-1]}\Gamma^{\sigma_l})_{a_l} \ket{\sigma_1,\cdots,\sigma_l}, \\ \ket{a_l}_B &= \sum_{\sigma_{l+1},\cdots,\sigma_L} \qty(\Gamma^{\sigma_{l+1}} \Lambda^{[l+1]} \Gamma^{\sigma_{l+2}} \cdots \Lambda^{[L-1]} \Gamma^{\sigma_L})_{a_l} \ket{\sigma_{l+1} \cdots \sigma_L} \end{align*} are orthonormal respectively.
• The reduced density matrices are given by $\rho^{[l]}_A = \rho^{[l]}_B = \qty(\Lambda^{[l]})^2.$
###### From Classical Representation

\begin{align*} c_{\sigma_1,\cdots,\sigma_L} &\xlongequal[\mathrm{reshape}]{} \Psi_{\sigma_1,(\sigma_2,\cdots,\sigma_L)} \\ &\xlongequal{\mathrm{SVD}} \sum_{a_1} A^{\sigma_1}_{a_1} \Lambda^{}_{a_1,a_1}(V^\dagger)_{a_1,(\sigma_2,\cdots,\sigma_L)} \\ &\xlongequal[\mathrm{reshape}]{A^{\sigma_1}_{a_1} = \Gamma^{\sigma_1}_{a_1}} \sum_{a_1} \Gamma^{\sigma_1}_{a_1} \Psi_{(a_1\sigma_2),(\sigma_3,\cdots,\sigma_L)} \\ &\xlongequal{\mathrm{SVD}} \sum_{a_1,a_2} \Gamma^{\sigma_1}_{a_1} A^{\sigma_2}_{a_1,a_2} \Lambda^{}_{a_2,a_2} (V^\dagger)_{a_2,(\sigma_3,\cdots,\sigma_L)} \\ &\xlongequal[\color{orange} \mathrm{problematic\ division}]{A^{\sigma_2}_{a_1,a_2} = \Lambda^{}_{a_1,a_1}\Gamma^{\sigma_2}_{a_1,a_2}} \sum_{a_1,a_2} \Gamma^{\sigma_1}_{a_1} \Lambda^{}_{a_1,a_1} \Gamma^{\sigma_2}_{a_1,a_2} \Psi_{(a_2,\sigma_3),(\sigma_4,\cdots,\sigma_L)} \\ &= \cdots \\ &= \sum_{a_1,\cdots,a_L} \Gamma^{\sigma_1}_{a_1} \Lambda^{}_{a_1,a_1} \Gamma^{\sigma_2}_{a_1,a_2} \Lambda^{}_{a_2,a_2} \cdots \Lambda^{[L-1]}_{a_{l-1},a_{l-1}} \Gamma^{\sigma_L}_{a_{l-1},a_l}. \end{align*}

• Substitution starting from the left: $A^{\sigma_l}_{a_{l-1},a_l} = \Lambda^{[l-1]}_{a_{l-1},a_{l-1}} \Gamma^{\sigma_l}_{a_{l-1},a_l}.$
• Substitution starting from the right: $B^{\sigma_l}_{a_{l-1},a_l} = \Gamma^{\sigma_l}_{a_{l-1},a_l} \Lambda^{[l]}_{a_l,a_l}.$
• Dummy $\Lambda^{} = \Lambda^{[L]} = 1.$
###### From Left-Canonical

Similar to that of right-canonical ones.

###### From Right-Canonical

\begin{align*} B^{\sigma_1} B^{\sigma_2} B^{\sigma_3} \cdots &\xlongequal{\mathrm{SVD}} (A^{\sigma_1} \Lambda^{} V^\dagger) B^{\sigma_2} B^{\sigma_3} \cdots \\ &\xlongequal{A^{\sigma_1} = \Lambda^{}\Gamma^{\sigma_1}} \Gamma^{\sigma_1} M^{\sigma_2} B^{\sigma_3} \cdots \\ &\xlongequal{\mathrm{SVD}} \Gamma^{\sigma_1} (A^{\sigma_2} \Lambda^{}V^\dagger) B^{\sigma_3} \cdots \\ &\xlongequal[\color{orange}\mathrm{problematic\ division}]{A^{\sigma_2} = \Lambda^{}\Gamma^{\sigma_2}} \Gamma^{\sigma_1} \Lambda^{}\Gamma^{\sigma_2} M^{\sigma_3} B^{\sigma_3} \cdots. \end{align*}

#### Calculation With MPS

##### Block States
• Left block: defined recursively by \begin{align*} \ket{a_l}_A &= \sum_{a_{l-1}} \sum_{\sigma_l} A^{\sigma_l}_{a_{l-1}, a_l} \ket{a_{l-1}}_A \ket{\sigma_l} \\ &= \cdots \\ &= \sum_{\sigma_1,\cdots,\sigma_l} (A^{\sigma_1} \cdots A^{\sigma_l})_{1,a_l} \ket{\sigma_1} \cdots \ket{\sigma_l}. \end{align*}
• Right block: defined recursively by \begin{align*} \ket{a_{l}}_B &= \sum_{a_{l+1}} \sum_{\sigma_{l+1}} B^{\sigma_{l+1}}_{a_l,a_{l+1}} \ket{\sigma_{l+1}} \ket{a_{l+1}}_B \\ &= \cdots \\ &= \sum_{\sigma_{l+1}, \cdots, \sigma_L} (B^{\sigma_{l+1}} \cdots B^{\sigma_L})_{a_{l+1},1} \ket{\sigma_{l+1}} \cdots \ket{\sigma_L}. \end{align*}
• The $$\qty{\ket{a_l}_A}$$ (as well as $$\qty{\ket{a_l}_B}$$) constructed in this way are orthonormal.
• A general state may be written as $\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} \cdots A^{\sigma_l} \Psi B^{\sigma_{l+1}} \cdots B^{\sigma_L} \ket{\sigma_1} \cdots \ket{\sigma_L},$ where $$\Psi$$ is a matrix.
##### Vidal Notation and DMRG
• Vidal notation to blocks: $\begin{gather*} \qty(\Lambda^{}\Gamma)\cdots \qty(\Lambda^{[l-2]}\Gamma)\qty(\Lambda^{[l-1]}\Gamma) \Lambda^{[l]} \qty(\Gamma \Lambda^{[l+1]}) \qty(\Gamma \Lambda^{[l+2]}) \cdots \qty(\Gamma \Lambda^{L}) \\ \rightarrow \ket{\psi} = \sum_{a_l} \ket{a_l}_A s_{a_l} \ket{a_l}_B. \end{gather*}$
• Vidal notation to one-site DMRG: $\begin{gather*} \qty(\Lambda^{}\Gamma)\cdots \qty(\Lambda^{[l-2]}\Gamma)\qty(\Lambda^{[l-1]}\Gamma \Lambda^{[l]}) \qty(\Gamma \Lambda^{[l+1]}) \qty(\Gamma \Lambda^{[l+2]}) \cdots \qty(\Gamma \Lambda^{L}) \\ \rightarrow \ket{\psi} = \sum_{a_{l-1},a_l,\sigma_l} \ket{a_{l-1}}_A \Psi^{\sigma_l}_{a_{l-1},a_l} \ket{a_l}_B. \end{gather*}$
• Vidal notation to two-site DMRG: $\begin{gather*} \qty(\Lambda^{}\Gamma)\cdots \qty(\Lambda^{[l-2]}\Gamma)\qty(\Lambda^{[l-1]}\Gamma \Lambda^{[l]} \Gamma \Lambda^{[l+1]}) \qty(\Gamma \Lambda^{[l+2]}) \cdots \qty(\Gamma \Lambda^{L}) \\ \rightarrow \ket{\psi} = \sum_{a_{l-1},a_{l+1},\sigma_l,\sigma_{l+1}} \ket{a_{l-1}}_A \Psi^{\sigma_l\sigma_{l+1}}_{a_{l-1},a_{l+1}} \ket{a_{l+1}}_B. \end{gather*}$
##### Matrix Elements
###### Notations
• $$\ket{\psi}$$ as MPS: $\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} M^{\sigma_1} \cdots M^{\sigma_L} \ket{\sigma_1} \cdots \ket{\sigma_L}.$
• $$\ket{\phi}$$ as MPS: $\ket{\phi} = \sum_{\sigma_1,\cdots,\sigma_L} N^{\sigma_1} \cdots N^{\sigma_L} \ket{\sigma_1} \cdots \ket{\sigma_L}.$
• Operator living on site $$l$$: $\hat{O}^{[l]} = \sum_{\sigma_l,\sigma'_l} O^{\sigma_l,\sigma'_l} \ket{\sigma_l} \bra{\sigma'_l}.$
###### Overlap
• $$C^{} = 1$$.
• $$C^{[l]}$$ defined recursively by $C^{[l]} = \sum_{\sigma_l} N^{\sigma_l\dagger} C^{[l-1]} M^{\sigma_l}.$
• Transfer operator: specifically for $$N=M$$, $\hat{E}^{[l]} = \sum_{a_{l-1},a'_{l-1}} \sum_{a_l,a'_l} \qty(\sum_{\sigma_l} N^{[l] \sigma_{l*}} \otimes M^{[l]\sigma_l})_{a_{l-1} a'_{l-1}, a_l a'_l} (\ket{a'_{l-1}} \bra{a_{l-1}})(\ket{a_l}\bra{a'_l}).$
• Reformulated with transfer opeartor: $C^{[l]} = E^{[l]}\qty[C^{[l-1]}].$
• Finally we have $C^{[L]} = \bra{\phi}\ket{\psi}.$
###### Matrix Element
• $$C^{} = 1$$.
• For $$l\neq i, j$$, $$C^{[l]}$$ is defined recursively by $C^{[l]} = \sum_{\sigma_l} N^{\sigma_l\dagger} C^{[l-1]} M^{\sigma_l}.$
• For $$l=i$$ or $$l=j$$, $$C^{[l]}$$ is defined by $C^{[l]} = \sum_{\sigma_l,\sigma'_l} O^{\sigma_l,\sigma'_l} N^{\sigma_l\dagger} C^{[l-1]} M^{\sigma'_l}.$
• Transfer operator: specifically for $$N=M$$, $\hat{E}^{[l]}_O = \sum_{a_{l-1},a'_{l-1}} \sum_{a_l,a'_l} \qty(\sum_{\sigma_l,\sigma'_l} O^{\sigma_l,\sigma'_l} N^{[l] \sigma_{l*}} \otimes M^{[l]\sigma_l})_{a_{l-1} a'_{l-1}, a_l a'_l} (\ket{a'_{l-1}} \bra{a_{l-1}})(\ket{a_l}\bra{a'_l}).$
• Reformulated with transfer opeartor: $C^{[l]} = E^{[l]}\qty[C^{[l-1]}].$
• Finally we have $C^{[L]} = \bra{\phi} O^{[i]} O^{[j]} \ket{\psi}.$
###### Properties of Transfer Matrices
• If $$N=M$$ is a left-normalized or right-normalized matrix, then all eigenvalues of $$E$$ satisfies $\abs{\lambda} \le 1.$

#### Compression of MPS

##### SVD Compression
• Starting from a left-canonical MPS.
• $$\tilde{O}$$ denoting $$O$$ truncated, \begin{align*} \ket{\psi} &= \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} \cdots A^{\sigma_L} \ket{\sigma_1 \cdots \sigma_L} \\ &= \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} \cdots A^{\sigma_{L-1}} USB^{\sigma_L} \ket{\sigma_1 \cdots \sigma_L} \\ &\rightarrow \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} \cdots (A^{\sigma_{L-1}} \tilde{U}\tilde{S})B^{\sigma_L} \ket{\sigma_1 \cdots \sigma_L} \\ &= \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} \cdots A^{\sigma_{L-2}} US B^{\sigma_{L-1}} B^{\sigma_L} \ket{\sigma_1 \cdots \sigma_L} \\ &\rightarrow \cdots \\ &\rightarrow \sum_{\sigma_1,\cdots,\sigma_L} (A^{\sigma_1} \cdots A^{\sigma_l} U) S (B^{\sigma_{l+1}}\cdots B^{\sigma_L}) \ket{\sigma_1\cdots \sigma_l} \ket{\sigma_{l+1}\cdots \sigma_L}. \end{align*}
##### Variational Compression

Section not done, cf. §4.5.2, Schollwöck (2011).

#### MPO

$\hat O \ket{\psi} = \sum_{\vb*{\sigma}} N^{\sigma_1} \cdots N^{\sigma_L} \ket{\vb*{\sigma}}.$

• Left/right normalized by taking $$(\sigma_l,\sigma'_l)$$ as a large index.

$\hat{O} \ket{\psi} = \sum_{\vb*{\sigma}} N^{\sigma_1} \cdots N^{\sigma_L} \ket{\vb*{\sigma}}$ where $N^{\sigma_i} = \sum_{\sigma'_i} W^{\sigma_i \sigma'_i} \otimes M^{\sigma'_i}.$

#### Ground State Calculation

##### MPO Representation of Hamiltonians
1. Hamiltonian defined by $\hat{H} = \sum_{i=1}^{L-1} \qty(\frac{J}{2} \hat{S}_i^{+} \hat{S}_{i+1}^{-} + \frac{J}{2} \hat{S}_{i}^{-} \hat{S}_{i+1}^+ + J^z \hat{S}^z_{i} \hat{S}^z_{i+1}) - h\sum_i \hat{S}^z_i.$
2. Hamiltonian represented as $\hat{O} = \hat{W}^{} \cdots \hat{W}^{[L]}$ where $$W^{[i]}$$'s are Operator-valued matrices $\hat{W}_{bb'} = \sum_{\sigma \sigma'} W^{\sigma \sigma'}_{bb'} \ket{\sigma}\bra{\sigma}{}.$
3. For $$2 \le l \le L-1$$, the linear space that $$W^{[l]}$$ acts on may be generated by $$\qty{\vb*{e}^{[l]}_{b'}}$$ defined by \begin{align*} O^{[l]}_1 &= \mathbb{1} \otimes \cdots \otimes \mathbb{1}, \\ O^{[l]}_2 &= \hat{S}^+ \otimes \mathbb{1} \otimes \cdots \otimes \mathbb{1}, \\ O^{[l]}_3 &= \hat{S}^- \otimes \mathbb{1} \otimes \cdots \otimes \mathbb{1}, \\ O^{[l]}_4 &= \hat{S}^z \otimes \mathbb{1} \otimes \cdots \otimes \mathbb{1}, \\ O^{[l]}_5 &= \mathrm{sum\ of\ completed\ terms\ to\ the\ right}. \\ \end{align*}
4. We have the recurrence relation \begin{align*} O^{[l-1]}_1 &= \mathbb{1} \otimes O^{[l]}_1, \\ O^{[l-1]}_2 &= \hat{S}^+ \otimes O^{[l]}_1, \\ O^{[l-1]}_3 &= \hat{S}^- \otimes O^{[l]}_1, \\ O^{[l-1]}_4 &= \hat{S}^{z} \otimes O^{[l]}_1, \\ O^{[l-1]}_1 &= -h \hat{S}^z \otimes O^{[l]}_1 + \frac{J}{2} \hat{S}^- \otimes O^{[l]}_2 + \frac{J}{2} \hat{S}^+ \otimes O^{[l]}_3 + J^z \hat{S}^z O^{[l]}_4 + \mathbb{1}\otimes O^{[l]}_5. \\ \end{align*}
5. We could therefore define $$W^{[l]}$$ by $W^{[l]} = \begin{pmatrix} \hat{1} & & & & \\ \hat{S}^+ & & & & \\ \hat{S}^- & & & & \\ \hat{S}^z & & & & \\ -h\hat{S}^z & (J/2) \hat{S}^- & (J/2) \hat{S}^+ & J^z \hat{S}^z & \mathbb{1} \end{pmatrix}{}$ such that $\begin{pmatrix} O^{[l-1]}_1 \\ O^{[l-1]}_2 \\ O^{[l-1]}_3 \\ O^{[l-1]}_4 \\ O^{[l-1]}_5 \end{pmatrix} = \hat{W}^{[l]} \begin{pmatrix} O^{[l]}_1 \\ O^{[l]}_2 \\ O^{[l]}_3 \\ O^{[l]}_4 \\ O^{[l]}_5 \end{pmatrix},$ where the multiplication in the dot product is given by kron.
6. At the border we have $\hat{W}^{} = \begin{pmatrix} -h\hat{S}^z & (J/2) \hat{S}^- & (J/2) \hat{S}^+ & J^z \hat{S}^z & \mathbb{1} \end{pmatrix}$ and $\hat{W}^{[L]} = \begin{pmatrix} \mathbb{1} \\ \hat{S}^+ \\ \hat{S}^- \\ \hat{S}^z \\ -h\hat{S}^z \end{pmatrix}.$

The lesson:

• It's not that hard to contruct $$W^{[l]}$$. Instead of thinking $$W^{[l]}$$ as matrices labeled by $$\sigma$$ and $$\sigma'$$, we take it as operator-valued matrices labeld by $$b$$ and $$b'$$.
• $$W^{[l]}$$ is sparse.
• The MPO representation of Hamiltonian stores the exact Hamiltonian in a small space without compression.
##### Applying a Hamiltonian MPO to a Mixed Canonical State

$\ket{\psi} = \sum_{\sigma_1,\cdots,\sigma_L} A^{\sigma_1} \cdots A^{\sigma_{l-1}} \Psi^{\sigma_l} B^{\sigma_{l+1}} \cdots B^{\sigma_L} \ket{\sigma_1 \cdots \sigma_L}.$ $\bra{a_{l-1} \sigma_l a_l} \hat{H} \ket{a'_{l-1}\sigma'_l a'_l} = \sum_{b_{l-1},b_l} L^{a_{l-1},a'_{l-1}}_{b_{l-1}} W^{\sigma_l \sigma'_l}_{b_{l-1},b_l} R^{a_l,a'_l}_{b_l}.$

1. Target: with a Lagrangian multiplier $$\lambda$$, we minimize $\bra{\psi} H \ket{\psi} - \lambda \bra{\psi} \ket{\psi}.$ 2. Iterative search: only $$M^{[l]}$$ is allowed to vary. 3. Boost: we'd like
1. $$M^{[l]}$$'s be already a good guess, and
2. The matrices left and right are left-normalized and right-normalized, respectively, so that the above equation is a eigenvalue problem instead of a generalized one.
###### Algorithm
1. Start from some initial guess for $$\ket{\psi}$$, right-normalized.
2. Calculate the $$R$$-expressions iteratively for all sites from $$L-1$$ to $$1$$.
3. Right sweep: sweeping from site $$l=1$$ to $$L-1$$.
1. At each site, solve the eigenvalue problem with starting vector given by the current state, getting $$M^{\sigma_l}$$.
2. Obtain $$A^{\sigma_l}$$ by SVD, with the remaining $$SV^\dagger$$ multiplied to the $$M^{\sigma_{l+1}}$$ to the right as the starting point of the eigensolver for the next site.
3. Build iteratively the $$L$$-expression.
4. Left sweep: sweeping from site $$l=L$$ to $$2$$.
1. Again, solve the eigenvalue problem at each site.
2. Obtain $$B^{\sigma_l}$$ by SVD, with the remaining $$US$$ multiplied to the $$M^{\sigma_l}$$ to the left.
3. Build iteratively the $$R$$-expression.
5. Repeat left and right sweeps, until convergence is achieved. Convergence condition given by $\bra{\psi} \hat{H}^2 \ket{\psi} - \qty(\bra{\psi} \hat{H} \ket{\psi})^2 \rightarrow 0.$

### Computational Tricks

For tricks that speed up the computation, see Computational Tricks, DMRG (II).

#### Avoid Trapping

Add a correction to $$\hat{\rho}^{A\bullet}$$ before doing SVD: $\hat{\rho}^{A\bullet} = \tr_B \ket{\psi} \bra{\psi} + \alpha \sum_{b_l} \tr_B \hat{H}^{A\bullet}_{b_l}\ket{\psi} \bra{\psi} \hat{H}^{A\bullet}_{b_l},$ where $$\alpha$$ takes small value $$O(10^{-4})$$ and will be taken slowly to zero as sweeping goes on.

The correction term $$\hat{H}_{b_l}^{A\bullet}\ket{\psi}$$ is evaluated as follows. ### Miscellaneous

#### Entanglement

• Maximally entangled state: $$\rho \in H_A \otimes H_B$$ has the form for each of the subsystems $\begin{pmatrix} 1/n & & & \\ & 1/n & & \\ & & \ddots & \\ & & & 1/n \end{pmatrix}.$

Expand

2021/8/5 20:23:50

0%
0%
0%
0%

## Mathematics Miscellany

#### Matrix Decomposition

##### SVD  $M = USV^\dagger$ where

• columns of $$U$$ are orthonormal;
• $$S$$ is diagonal with non-negative entries;
• rows of $$V^\dagger$$ are orthonormal.
##### QR Decomposition
###### Full QR  $M = QR$ where

• $$Q$$ is unitary;
• $$R$$ is upper-triangular.
###### Thin QR $M = Q_1 R_1$ where

• columns of $$Q_1$$ are orthonormal;
• $$R_1$$ is upper-triangular.

#### Kronecker Product

##### Properties
• Associativity: $(A\otimes B) \otimes C = A \otimes (B\otimes C).$
• Mixed-product: $(A\otimes B)\cdot (C\otimes D) = (A\cdot C)\otimes (B\cdot D).$ In particular, $A \otimes B = (A \otimes \mathbb{1}) \cdot (\mathbb{1}\otimes B).$
• Inverse, Transpose, etc: $\begin{gather*} (A\otimes B)^{-1} = A^{-1} \otimes B^{-1}, \\ (A\otimes B)^\dagger = A^\dagger \otimes B^\dagger. \end{gather*}{}$
• Trace, Determinant, etc: $\begin{gather*} \det (A_{n\times n}\otimes B_{m\times m}) = (\det A)^m (\det B)^n, \\ \tr (A \otimes B) = (\tr A)(\tr B). \end{gather*}{}$
• The kron of two matrices of orthonormal columns/rows is again a matrix of orthogonal columns/rows, respectively.
##### Implementations
numpy.kron(a, b)
scipy.sparse.kron(a, b)
scipy.linalg.kron(a, b)


Expand

2021/8/5 13:56:58

0%
0%
0%
0%

## DMRG (II)

Implementations

### Simple DMRG

#### Simple DMRG Program

The Hamiltonian is given by the XXZ model $H = -\frac{1}{2} \sum_{j=1}^N (J \sigma_j^x \sigma_{j+1}^x + J \sigma_j^y \sigma_{j+1}^y + J_z \sigma_{j}^z \sigma_{j+1}^z).$

##### Finite System

$$d$$ is defined to be the number of states of a single site.

In line 40 and 41 two matrices are defined, $S^z_{1} = \frac{1}{2} \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \quad S^+_{1} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}$ as well as $H_1 = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}.$ $$H_1$$ will be used as the single-site Hamiltonian at initialization.

The two-site Hamiltonian is defined in line 45 to be \begin{align*} H_2(S_1, S_2) &= \frac{J}{2} S^+_1 \otimes S^{-}_2 + \frac{J}{2} S^{-}_1 \otimes S^+_2 + J_z S^z_1 \otimes S^z_2 \\ &= J(S_1^x \otimes S_2^x + S_1^y \otimes S_2^y) + J_z S_1^z \otimes S_2^z. \end{align*}

###### Enlarging Block

The enlarging process renews the operaors as \begin{align*} H &\rightarrow H \otimes \mathbb{1}_{d\times d} + H_2(S_{\mathrm{edge}}, S_1), \\ S_{\mathrm{edge}}^z &\rightarrow \mathbb{1}_{M\times M} \otimes S^z_1, \\ S_{\mathrm{edge}}^+ &\rightarrow \mathbb{1}_{M\times M} \otimes S^+_1. \end{align*}

###### Single DMRG Step

At each DMRG step, the following steps are carried out:

1. The system block and the environment block is enlarged once.
2. The superblock Hamiltonian is constructed as $H = H_{\mathrm{sys}} \otimes \mathbb{1}_{M_{\mathrm{env}}\times M_{\mathrm{env}}} + \mathbb{1}_{M_{\mathrm{sys}} \times M_{\mathrm{sys}}} \otimes H_{\mathrm{env}} + H_2(S_{\mathrm{sys,edge}}, S_{\mathrm{env,edge}}).$
3. Calculate the lowest eigenvalue $$E$$ and $$\psi$$ of $$H$$.
4. Calculate the projected density matrix: $\rho = \tr_E (\ket \psi \bra \psi).$
5. Calculate the eigenvectors of the lowest $$m$$ eigenvalues. If $$m$$ is greater then the dimension of the matrix, we calculate all the eigenvectors.
6. Construct the transformation matrix $$T$$, where the columns are given by the eigenvectors in the previous step. $$T$$ is not necessarily a square matrix.
7. All the operators of the system, $$S_{\mathrm{sys}}$$ and $$H_{\mathrm{sys}}$$, should undergo a transformation $H \rightarrow T^\dagger H T.$

We may take system and environment to be the same. This may reduce half of the calculations.

How is the projected density matrix calculated? Although $$\psi$$ is a vector in the direct product of two Hilbert spaces, it was represented by a column vector returned from eigsh. The following snippet traces out the environment part:

psi = psi.reshape([m_sys, -1])
rho = np.dot(psi0, psi0.conjugate.transpose())


#### Hubbard Model on a Specific Sector

This section is deprecated. It's a total failure.

##### Notations
1. By $$[N_\uparrow \otimes N_\downarrow]_L$$ we mean the Hilbert space of $$N_\uparrow$$ spin-up and $$N_\downarrow$$ spin-down electrons on a chain of length $$L$$.
• If either of $$N_\uparrow$$ or $$N_\downarrow$$ is negative or greater than $$L$$ then the space is taken as an zero-dimensional one, i.e. $${0}$$.
• If $$L<0$$ then the space is taken as an zero-dimensional one, i.e. $${0}$$.
2. By $$R[N_\uparrow \otimes N_\downarrow]_L$$ we mean the projected Hilbert space of $$[N_\uparrow \otimes N_\downarrow]_L$$ onto a subspace determined by the DMRG process.

With the above notation the dimension of $$R[N_\uparrow\otimes N_\downarrow]$$ is at most $$M$$.

##### Block Solution

By a block solution of $$[0\otimes 0]_L$$ where $$L$$ may be $$0$$ we mean

1. A Hilbert space (not stored) $\mathcal{H} = \langle \ket{0} \rangle.$
2. A Hamiltonian $H = \begin{pmatrix} 0 \end{pmatrix}.$
3. Creation operators on the boundary, $$c_{L-1,\uparrow}^\dagger$$ and $$c_{L-1,\downarrow}^\dagger$$ are both $$1\times 0$$ zero matrices in this case.
4. A projection matrix $V = \begin{pmatrix} 1 \end{pmatrix}.$

By a block solution of $$[N_\uparrow \otimes 0]_L$$ where $$N_\uparrow > 0$$ we mean

1. A Hilbert space (before projection) $R[N_\uparrow \otimes 0]_{L-1} \otimes \ket{00} \oplus R[(N_\uparrow - 1) \otimes 0]_{L-1} \otimes \ket{\uparrow 0}.$
2. A Hamiltonian $H: R[N_\uparrow \otimes 0]_L \rightarrow R[N_\uparrow \otimes 0]_L.$
3. Creation operators on the boundary,
• $c_{L-1,\uparrow}^\dagger: R[(N_\uparrow - 1) \otimes 0]_L \rightarrow R[N_\uparrow \otimes 0]_L.$
• $$c_{L-1,\downarrow}^\dagger$$ an $$1\times 0$$ zero matrix.
4. A projection matrix $V: R[N_\uparrow \otimes 0]_{L-1} \otimes \ket{00} \oplus R[(N_\uparrow - 1) \otimes 0]_{L-1} \otimes \ket{\uparrow 0} \rightarrow R[N_\uparrow \otimes 0]_L.$

For a block solution of $$[0 \otimes N_\downarrow]_L$$ where $$N_\downarrow > 0$$ just substitute $$\downarrow$$ for $$\uparrow$$ in the above definition.

By a block solution of $$[N_\uparrow \otimes N_\downarrow]_L$$ where $$N_\uparrow > 0$$ and $$N_\downarrow > 0$$ we mean

1. A Hilbert space (before projection) \begin{align*} \qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} &= R\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L-1} \otimes \ket{00} \\ &\oplus R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L-1} \otimes \ket{\uparrow 0} \\ &\oplus R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L-1} \otimes \ket{0\downarrow} \\ &\oplus R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L-1} \otimes \ket{\uparrow \downarrow}. \end{align*}
2. A Hamiltonian $H: R[N_\uparrow \otimes N_\downarrow]_{L} \rightarrow R[N_\uparrow \otimes N_\downarrow]_{L}.$
3. Creation operators on the boundary,
• $c_{L-1,\uparrow}^\dagger: R[(N_\uparrow - 1) \otimes N_\downarrow]_L \rightarrow R[N_\uparrow \otimes N_\downarrow]_L.$
• $c_{L-1,\downarrow}^\dagger: R[N_\uparrow \otimes (N_\downarrow - 1)]_L\rightarrow R[N_\uparrow \otimes N_\downarrow]_L.$
4. A projection matrix \begin{align*} & V: R\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} \otimes \ket{00} \\ &\oplus R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \otimes \ket{\uparrow 0} \\ &\oplus R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{0\downarrow} \\ &\oplus R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow \downarrow} \\ &\rightarrow R[N_\uparrow\otimes N_\downarrow]_L. \end{align*}
##### Obtaining Block Solutions

Now we are gonna obtain the block solution of $$(L+1,N_\uparrow,N_\downarrow)$$ recursively. We assume that $$N_\uparrow > 0$$ and $$N_\downarrow > 0$$.

We assume that block solutions of length $$L$$ are already known, as well as the block solutions of $$(L+1, N^*_\uparrow, N^*_\downarrow)$$ where $$N^*_\uparrow \le N_\uparrow$$, $$N^*_\downarrow \le N_\downarrow$$, and at least one of the inequalities strictly holds.

The creation operators on the boundary are given by

• $c_{L,\uparrow}^\dagger = \begin{array}{ccccc} & R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \otimes \ket{00} & R\qty[(N_\uparrow - 2) \otimes (N_\downarrow)]_{L} \otimes \ket{\uparrow 0} & R\qty[(N_\uparrow-1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{0\downarrow} & R\qty[(N_\uparrow - 2) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow \downarrow} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} \otimes \ket{00} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \otimes \ket{\uparrow 0} & \mathbb{1} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{0\downarrow} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow \downarrow} & & & \mathbb{1} \end{array}.$
• $c_{L,\downarrow}^\dagger = \begin{array}{ccccc} & R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{00} & R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow 0} & R\qty[(N_\uparrow) \otimes (N_\downarrow - 2)]_{L} \otimes \ket{0\downarrow} & R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 2)]_{L} \otimes \ket{\uparrow \downarrow} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} \otimes \ket{00} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \otimes \ket{\uparrow 0} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{0\downarrow} & \mathbb{1} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow \downarrow} & & \mathbb{1} \end{array}.$

Now we have to find the creation operators next to the boundary.

• $c_{L-1,\uparrow}^\dagger = \begin{array}{ccccc} & R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \otimes \ket{00} & R\qty[(N_\uparrow - 2) \otimes (N_\downarrow)]_{L} \otimes \ket{\uparrow 0} & R\qty[(N_\uparrow-1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{0\downarrow} & R\qty[(N_\uparrow - 2) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow \downarrow} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} \otimes \ket{00} & c_{L-1,\uparrow}^\dagger\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \otimes \ket{\uparrow 0} & & c_{L-1,\uparrow}^\dagger\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{0\downarrow} & & & c_{L-1,\uparrow}^\dagger\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow \downarrow} & & & & c_{L-1,\uparrow}^\dagger\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \end{array}.$
• $c_{L-1,\downarrow}^\dagger = \begin{array}{ccccc} & R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{00} & R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow 0} & R\qty[(N_\uparrow) \otimes (N_\downarrow - 2)]_{L} \otimes \ket{0\downarrow} & R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 2)]_{L} \otimes \ket{\uparrow \downarrow} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} \otimes \ket{00} & c_{L-1,\downarrow}^\dagger\qty[(N_\uparrow) \otimes (N_\downarrow)]_{L} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \otimes \ket{\uparrow 0} & & c_{L-1,\downarrow}^\dagger\qty[(N_\uparrow - 1) \otimes (N_\downarrow)]_{L} \\ R\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{0\downarrow} & & & c_{L-1,\downarrow}^\dagger\qty[(N_\uparrow) \otimes (N_\downarrow - 1)]_{L} \\ R\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \otimes \ket{\uparrow \downarrow} & & & & c_{L-1,\downarrow}^\dagger\qty[(N_\uparrow - 1) \otimes (N_\downarrow - 1)]_{L} \end{array}.$

We are now able to construct $$H$$ in principle. Then, following the standard DMRG procedure, we obtain a projection matrix $$V$$ consists of column vectors.

1. Hamiltonian: $H = V^\dagger H V.$
2. Creations operators:
• $c^\dagger_{L,\uparrow} = V^\dagger[(N_\uparrow) \otimes (N_\downarrow)]_L c^\dagger_{L,\uparrow} V[(N_\uparrow - 1) \otimes (N_\downarrow)]_L.$
• $c^\dagger_{L,\downarrow} = V^\dagger[(N_\uparrow) \otimes (N_\downarrow)]_L c^\dagger_{L,\downarrow} V[(N_\uparrow) \otimes (N_\downarrow - 1)]_L.$

### Computational Tricks

#### Speed-Up

Section not done.

##### NetKet

Expand

2021/8/2 18:59:26

0%
0%
0%
0%

## Statistical Mechanics (II)

#### Ensembles

Expand

2021/6/24 19:26:59

0%
0%
0%
0%
0%
0%