Giter Club home page Giter Club logo

mpskit.jl's Introduction

MPSKit.jl

docs codecov CI

Contains code for tackling one-dimensional quantum and two-dimensional statistical mechanics problems using tensor network algorithms. The main focus is on matrix product states (MPS) and matrix product operators (MPO), both finite and infinite.

Additionally, the framework is built upon TensorKit.jl, which provides functionality for generic symmetries.

The toolbox contains different algorithms for finding MPS representations of groundstates or leading boundary states, performing time evolution, finding excitations and much more. Check out the examples for concrete use-cases.

This package is under active development and new algorithms are added regularly. Nevertheless, the documentation is quite terse, so feel free to open an issue if you have any questions.

Installation

The package can be installed through the Julia general registry, via the package manager:

pkg> add MPSKit

Because of the heavy use of TensorKit.jl, it is recommended to install the latest version of this package as well. Additionally, several extension packages exist that provide additional symmetries, which should all be compatible with MPSKit. For example, to install the package with support for SU(N) symmetries, SUNRepresentations.jl can be used.

pkg> add TensorKit

Finally, several pre-defined operators, hamiltonians and statistical mechanics models are available in MPSKitModels.jl. It is recommended to install this package too.

pkg> add MPSKitModels

Quickstart

After following the installation process, it should now be possible to load the packages and start simulating. For example, to obtain the groundstate of the 1D Ising model, we can use the following code:

using MPSKit, MPSKitModels, TensorKit
using ProgressMeter, Plots # for demonstration purposes

L = 16 # length of the chain
D = 4 # bonddimension
init_state = FiniteMPS(L, ℂ^2, ℂ^D)

g_values = 0:0.1:2
Z = @mpoham sum(σᶻ(){i} for i in vertices(FiniteChain(L)))

M = @showprogress map(g_values) do g
    H = periodic_boundary_conditions(transverse_field_ising(; g=g), L)
    groundstate, environment, δ = find_groundstate(init_state, H; verbose=false)
    return abs(sum(expectation_value(groundstate, Z))) / L
end

scatter(g_values, M, xlabel="g", ylabel="M", label="D=$D", title="Magnetization")

Magnetization

Similarly, these simulations can be carried out directly in the thermodynamic limit, with very minor code-changes:

using MPSKit, MPSKitModels, TensorKit
using ProgressMeter, Plots # for demonstration purposes

D = 4 # bonddimension
init_state = InfiniteMPS(ℂ^2, ℂ^D)

g_values = 0.1:0.1:2
Z = @mpoham sum(σᶻ(){i} for i in vertices(InfiniteChain()))

M = @showprogress map(g_values) do g
    H = transverse_field_ising(; g=g)
    groundstate, environment, δ = find_groundstate(init_state, H, VUMPS(; verbose=false))
    return abs(sum(expectation_value(groundstate, Z)))
end

scatter(g_values, M, xlabel="g", ylabel="M", label="D=$D", title="Magnetization")

Magnetization

mpskit.jl's People

Contributors

maartenvd avatar lkdvos avatar jutho avatar gertian avatar mhauru avatar daanmaertens avatar leburgel avatar tangwei94 avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.