Code Monkey home page Code Monkey logo

autompo's Introduction

AutoMPO

”Generate matrix product operator automatically based on finite state automata. “

Small Tutorial

Use "fsa.Add()" to add each term in your Hamiltonian.

Use "fsa.GenMPO()" to generate a matrix product form of the Hamiltonian.

Test file for the transverse-field Ising chain.

from AutoMPO.class_fsa import fsa
from AutoMPO.class_named_data import named_data
from AutoMPO.opr_pool import GenSpinOpr

if __name__ == "__main__":
    # model parameter
    N = 5
    J = 1
    g = 0.5
    # define operator with a string as name
    Sz = named_data('Sz', GenSpinOpr('Sz'))
    Sx = named_data('Sx', GenSpinOpr('Sx'))
    # construct finite state automata
    fsa = fsa(N)
    for i in range(0, N):
        # add each term in the Hamiltonian
        if (i < N - 1):
            fsa.Add(J, [Sz, Sz], [i, i + 1])
        fsa.Add(g, [Sx], [i])
    # use the constructed fsa to generate MPO
    list_mpo = fsa.GenMPO()
    # visualize MPO represented by operator symbols
    fsa.PrintSymbolMPO()

Click here for the general idea behind AutoMPO.

Click here for the implementation details of AutoMPO.

Click here for more information about the density matrix renormalization group (DMRG) method.

autompo's People

Contributors

haokai-zhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.