Skip to content

Generate MPO automatically based on finite state automata

Notifications You must be signed in to change notification settings

Haokai-Zhang/AutoMPO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Generate MPO automatically based on finite state automata

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages