DRMGenie Logo

DMRGenie

Tensor Networks Made Easy


Home

Tutorial

The field of theoretical quantum physics is notoriously difficult to grasp, and information about it is often obfuscated in complex rhetoric. Leave that behind with DMRGenie!

DMRGenie is intended to be a tool for research and education.
Learn how to use its cutting edge features with this guide.
Density Matrix Renormalization Group (DMRG)
To get up to speed on Tensor Networks check out these papers:
Density Matrix Renormalization Group (DMRG) environment

Algorithm Runner

The Algorithm Runner allows you to run known tensor network algorithms without coding knowledge. Currently, the density matrix renormalization group (DMRG) algorithm is the only one available, but more are coming soon.

DMRG

This tutorial will guide you through running DMRG on known and custom models. Let's start by going over the basics of what everything means.


On the Algorithm Runner page you will be met with the following option menu. Each option is as follows:
Main menu components
  • Hamiltonian: The model which DMRG will be run on in Matrix Product Operator (MPO) form.
  • Compute Correlations: Specify operators to be evaluated at each lattice site to receive tensors populated with correlation functions upon computation.
  • Symmetry: Enforce quantum symmetries. Selecting this will run DMRG on a separate quantum model as well.
  • Number of Sites: MPO terms, with a maximum of 15 allowed.


With the default options set, clicking Run Algorithm will run DMRG on the given model and the ground state energy will be given, as well as any other specified outputs.

Hamiltonians

The 1-dimensional Ising spin model represents a system of particles with nearest-neighbour interactions along a line. A simple version of it can be expressed 1-dimensional Ising modelwhere J is the coupling constant. A magnetic field can be imposed by adding the term with constant h, representing magnetic field strength, 1-dimensional Ising model with magnetic interactionsThe 1-dimensional Ising model shares some resemblance to the Heisenberg model, which can be expressed The Heisenberg modelA magnetic field term can similarly be added on The Heisenberg model with magnetic interactions

There are three built in models one can select from:
  • Heisenberg model
  • Hubbard model
  • t-J model
Selecting and running one of these will construct them in MPO form then apply DMRG, giving the ground state energy of the system and any other specified information.

Constructing Custom Hamiltonians

Custom Hamiltonians can be specified and constructed as well. Let's consider the Hamiltonian of the 1-dimensional Ising model. Begin construction by selecting Hamiltonian -> Custom
Model input section
  • Physical dimension: The dimension of the outward facing indices of MPO terms.
  • Hamiltonian constant: Multiplicative constant applied to Hamiltonian sum.
  • Components: Operators specified in Hamiltonian.
The 1-dimensional Ising model with a coupling constant of J=0.5 can be input as 1-dimensional Ising model setup

Then an external magnetic field with constants J=0.5 and h=0.05 can be imposed as 1-dimensional Ising model setup with an external magnetic

Then for the Heisenberg model with J = 0.5 the input would be 1-dimensional Ising model setup with an external magnetic

Tensor Network Builder

The Tensor Network Builder allows you to craft novel tensor network algorithms and test your ideas. Effortlessly connect, contract, and decompose tensors on the canvas in seconds!


GIF of the tensor network builder

The process boils down into two parts:
  1. Specify all the steps by placing, contracting, and decomposing tensors.
  2. Submit the steps to be run with TensorPACK and receive the output.


Operations

Below outlines how to apply each operation and then run the set of steps to obtain an output.

Creating a Tensor

Tensors are created under the Drag and Drop section of the options menu. The rank of the tensor can be specified before the tensor is created. The rank can be from 0 and 4. Tensors made this was are initialized as random unitaries.


Uploading a Tensor

Tensors can also be uploaded as well. To do this, index names and their corresponding dimensions must be provided. If the sizes are incorrect, then contraction will fail or give undesired results. Only text files are accepted, and their contents must be in Julia array syntax where one set of square braces encloses the tensor elements and semicolons are used to differentiate between indices (e.g. columns). This is the same syntax convention as output tensors are written in.

For example, a 2 by 3 tensor should be input as
[6 1 2; 6 4 7]

Or a 2 by 5 by 3 tensor should be input as
[9 7 1 9 8; 6 4 4 9 6;;;
  3 5 6 9 8; 4 6 3 9 1;;;
  7 3 3 5 9; 2 4 8 5 8]

Or a 2 by 3 by 4 by 5 tensor should be input as
[8 3 9; 5 3 2;;; 5 9 5; 9 8 4;;; 2 7 7; 6 4 3;;;;
  7 1 1; 7 8 4;;; 2 2 3; 3 3 5;;; 6 1 1; 7 6 2;;;;
  3 6 7; 8 6 6;;; 4 9 9; 1 9 7;;; 8 4 1; 3 7 2;;;;
  5 9 9; 4 6 5;;; 2 7 7; 7 2 5;;; 9 2 3; 8 9 8]

Code such as println(rand(2, 3, 4)) should produce tensors of this format by default.


Connecting Tensors

Tensors can be connected by dragging between the points on any two tensors. However, there is a maximum of one connection per point. A free index can be created by dragging from a connection point to the network canvas.


Contract

The Contract option accepts two tensor IDs and contracts them into one. Tensors can be contracted if they are connected to each other by an edge, or if each has a free index with a common name and dimension. If there are no common indices between two tensors then they cannot be contracted.


Singular Value Decomposition (SVD)

The SVD option accepts the ID of a tensor and the desired grouping of indices. The operation will decompose tensor A as A = UDV, where D is a diagonal matrix and U and V are unitaries. The resulting tensors will be labelled accordingly.


QR and LQ Decompositions

The QR decomposition accepts the ID of a tensor and the desired grouping of indices. The operation will decompose A as A = QR, where Q is orthogonal and R is an upper triangular when reshaped into a matrix.

The LQ decomposition is similar, except it decomposes as A = LQ where L is lower triangular when reshaped as a matrix.


Eigenvalue Decomposition

The Eigenvalue decomposition accepts just the ID of a tensor. The tensor must be able to be reshaped into a square matrix. The result of the operation will result in a tensor of eigenvectors, its dual, and a diagonal tensor of eigenvalues.


Split Index and Connect Index

Split Index accepts the name of an index. If two tensors are connected, then the connection will be turned into a free index for each tensor.

Connect Index accepts the name of two indices and connects them directly. The dimensions of the indices must match.


Run Network Steps

All the steps for the network will be run and the tensors resulting from the final step will be given in Julia array syntax in a text downloadable file.