DMRGPy is a Python library to compute quasi-one-dimensional spin chains and fermionic systems using matrix product states with DMRG as implemented in ITensor. Most of the computations can be performed both with DMRG and exact diagonalization for small systems, which allows one to benchmark the results.
Let me just start by saying that I RALLY like the package, nice interface to DMRG!
I think the example "Spin and charge correlator of the 1D Hubbard model
" in the README.md has some typos.
specifically, I think it should be
I noted corrections with NOTE
from dmrgpy import fermionchain
n = 20 # number of sites
fc = fermionchain.Spinful_Fermionic_Chain(n)
# first neighbor hopping
h = 0
for i in range(n-1):
h = h+fc.Cdagup[i]*fc.Cup[i+1] # NOTE h = h+... instead just h = ...
h = h+fc.Cdagdn[i]*fc.Cdn[i+1]
h = h.get_dagger() # Make Hermitian
# Hubbard term
for i in range(n): # NOTE range should go for all sites
h = 2.*(fc.Nup[i]-.5)*(fc.Ndn[i]-.5) # NOTE Ndn instead of Cup[i+1]
fc.set_hamiltonian(h) # initialize the Hamiltonian
pairs = [(0,i) for i in range(n)]
# compute the two correlators
zz = [fc,vev(fc.Sz[0]*fc.Sz[i]).real for i in range(n)]
cc = [fc,vev(fc.Cdagup[0]*fc.Cup[i]).real for i in range(n)]
print("Spin correlators",zz)
print("Site correlators",cc)
Am I correct? I was not sure if this warranted a pull request.. :)
Let me just start by saying that I RALLY like the package, nice interface to DMRG!
I think the example "Spin and charge correlator of the 1D Hubbard model " in the
README.md
has some typos. specifically, I think it should be I noted corrections withNOTE
Am I correct? I was not sure if this warranted a pull request.. :)