Skip to main content

Cornell University

Basic Training Spring 2024

Practical introduction to matrix product states and the density matrix renormalization group

The Density Matrix Renormalization Group (DMRG) and related tensor-network methods have become the workhouse numerical tools for studying one dimensional (1D) quantum many-body problems. For certain classes of problems these approaches yield unbiased "numerically exact" results. In this module you will learn the theory behind the method which involves developing clever ways of writing and manipulating wavefunctions. You will write a DMRG code from scratch, and use it to investigate a quantum phase transition. Finally you will learn how to use some of the tensor-network codes which are readily available. Despite the impressive sounding jargon (density matrices, renormalization group, and tensor networks) the module should be accessible to any student with a good undergraduate-level understanding of quantum mechanics and linear algebra. The language of tensor networks has become pervasive, and even students who have less interest in numerical methods should find the module useful and illuminating.

Lecture Notes

Lecture Notes

Julia Notebooks

Introduction to Julia, Jupyter, and ITensors

Creating a iDMRG code -- Solutions

Finite DMRG and Quantum Numbers -- Solutions

Mathematica Notebooks

Introduction to Named Tensors in Mathematica

Minimal Named Tensors with Conservation Numbers

Infinite DMRG using Mathematica -- Solutions

Installing Julia

Step 1: Install Julia

Go to https://julialang.org/downloadsLinks to an external site. and download the current stable release, Julia 1.10.0, using the correct version for your operating system (Linux x86, Mac, Windows, etc).

Step 2: Launch Julia

After installing, make sure that you can run Julia. On some systems, this means searching for the "Julia 1.10.0" program installed on your computer; in others, it means running the command julia in a terminal. 

This puts you in the Julia REPL -- an interface which lets you line-by-line run Julia commands.  Test it out by typing "1+1" and then "enter."  Hint: If everything is working you should get "2"

Step 3: Install IJulia

Inside the Julia REPL type "]" (closing square bracket) The Julia prompt should change to "pkg>" and turn blue, telling you that you are now in package manager mode. This mode allows you to do operations on packages (also called libraries).

To install Pluto, run the following (case sensitive) command to add (install) the package to your system by downloading it from the internet. You should only need to do this once for each installation of Julia:

"add IJulia"

Note: the "IJ" should be capitalized.

Step 4: Install Other Packages

While still in the package manager type the following lines

"add Symbolics"

"add ITensors"

"add KrylovKit"

"add Plots"

Be careful with the capitalization.  

Don't worry if you miss any of these.  They can also be added at a later date.

Step 5: Compile ITensor

This step is optional

Exit package manager mode by typing backspace or delete.  (Or start a new REPL session)

Type: 

"using ITensors; ITensors.compile()"

It will take a few minutes to compile everything.  You can use ITensor without this, but it may be faster to load this way.

Follow the instructions to create an alias to run Julia using the precompiled ITensor package  Again, don't worry too much about it -- in my own daily life I don't bother to use the precompiled version.

Step 6

If you do not already have Jupyter installed type

"using IJulia; notebook()"

It will ask if you want to install Jupyter using conda.  Say "y"

Starting Jupyter

There are two ways of starting Jupyter.  If you installed it via Julia, you can open Julia's REPL, and type:

using IJulia; notebook()

Otherwise you should be able to at a command prompt type

jupyter notebook