Codes of Matrix Product State (MPS)
General
This is a simple example code of Gradient Descent Method on Matrix Product State. I wrote it for my undergraduate thesis. This is not a formal project and it may have many bugs XD.
The tensor type is defined by Prof. B Clark at UIUC. See his Problem Set 3.
I developed SVRG/SCSG and Adam algorithms about Gradient Optimization on 1-dim Tensor Network (MPS).
Installation
Julia Programming Language
I recommend you to compiling from source code using the latest stable version. I'm using v1.6.0.
Jupyter Lab / Notebook
Please open these *.ipynb
file via Jupyter Lab. You can install it here or use the following command in Julia:
using Pkg; Pkg.add("IJulia")
Alternative
If you already have Jupyter installed, IJulia can call up your Jupyter instead of installing a new one. You can click the IJulia here and follow this guide:
You can force it to use a specific
jupyter
installation by settingENV["JUPYTER"]
to the path of thejupyter
program beforePkg.add
, or before runningPkg.build("IJulia")
Usage
First Time
Run Julia, go into Package mode by entering ]
and install some packages. This may take a long time, but you can see progressmeter bars of them to ensure the process is not stuck. (Do not copy codes before >
or $
. )
$ julia
julia> ]
(@v1.6) pkg> add Plots, FFTW, ColorSchemes, LinearAlgebra, StatsBase, ProgressMeter, TensorOperations
(@v1.6) pkg> build
Press Backspace
and then Ctrl+D
to exit.
Run Program
After the installation, enter this repository and call up Jupyter Lab by Julia:
$ julia -e 'using IJulia; jupyterlab(detached=true, dir=".")'
To Professor Carlson
Tests about Heisanberg model was placed in Heisenberg.ipynb.