Hi,Matt
This is the input parameter file with your ALPS Kondo lattice model, the DMRG parameters are chosen so that the calculation can finish in a short time, thus be easy to be debugged :

--------------------------------INPUT PARAMETER FILE (FILE NAME my_parm)-----------------------------------------

LATTICE_LIBRARY="my_lattices.xml"
LATTICE="chain lattice"
MODEL="Kondo lattice"
mu=0
t=1
J=0.2
{L=32
SWEEPS=4
MAXSTATES=40
NUMBER_EIGENVALUES=2}

-----------------------------END OF INPUT PARAMETER FILE---------------------------------


-----------------------------my_lattices.xml--------------------------------------------------------------

<LATTICES>

<LATTICE name="chain lattice" dimension="1">
  <PARAMETER name="a" default="1"/>
  <BASIS><VECTOR>a</VECTOR></BASIS>
  <RECIPROCALBASIS><VECTOR>2*pi/a</VECTOR></RECIPROCALBASIS>
</LATTICE>
<UNITCELL name="fermion" dimension="1">
  <VERTEX type="0"/>
  <VERTEX type="1"/>
  <EDGE type="0"><SOURCE vertex="1" offset="0"/><TARGET vertex="1" offset="1"/></EDGE>
  <EDGE type="1"><SOURCE vertex="1" offset="0"/><TARGET vertex="2" offset="0"/></EDGE>
</UNITCELL>
<LATTICEGRAPH name = "chain lattice">
  <FINITELATTICE>
    <LATTICE ref="chain lattice"/>
    <PARAMETER name="L" default="4"/>
    <EXTENT size="L"/>
    <BOUNDARY type="open"/>
  </FINITELATTICE>
  <UNITCELL ref="fermion"/>
</LATTICEGRAPH>

</LATTICES>

-------------------------END OF my_lattices.xml----------------------------------------


-------------------------COMMAND LINE INPUT-----------------------------------------

parameter2xml my_parm

dmrg --write-xml my_parm.in.xml

------------------------END OF COMMAND LINE INPUT-------------------------------

ERROR: site basis for type 2 not found. Hope you guys can find out what is going on.




By the way, if I use wild card and my custom fermion code to reprogram Model="Kondo lattice" in the fashion of your ALPS Model="spin", the DMRG and ED both works. But the problem is with mu=0 t=1 and J=1, by DMRG, my custom Kondo Lattice model shows the gap = 0.21, with 10^-10 truncation error, while K.Ueda in Phys.Rev.B. 46, 3175 FIG.1 shows a energy gap smaller than 0.2 under the same parameter condition by ED. (BOTH HALF FILLING)  I recheck my custom Kondo lattice model and find no obvious mistakes. And I do not know why, can you help me here, too?

--------------------------INPUT FILE OF CUSTOM KONDO LATTICE MODEL------------------------------

LATTICE_LIBRARY="my_lattices.xml"
LATTICE="chain lattice"
MODEL_LIBRARY="my_models.xml"
MODEL="Kondo lattice"
CONSERVED_QUANTUMNUMBERS="N"
N_total=128
MEASURE_LOCAL[local density]=n
local_max0=2
local_min0=0
local_max1=1
local_min1=1
mu=0
t=1
J=1
{L=64
SWEEPS=10
MAXSTATES=500
NUMBER_EIGENVALUES=2}


------------------------CUSTOM KONDO LATTICE MODEL--------------------------

<MODELS>
<SITEBASIS name="fermion">
  <PARAMETER name="local_maximum" default="local_max"/>
  <PARAMETER name="local_max" default="2"/>
  <PARAMETER name="local_minimun" default="local_min"/>
  <PARAMETER name="local_min" default="0"/>
  <QUANTUMNUMBER name="N" min="local_minimum" max="local_maximum" type="fermionic"/>
  <QUANTUMNUMBER name="Sz" min="-N*(2-N)/2" max="N*(2-N)/2"/>
  <QUANTUMNUMBER name="Nup" min="(N+2*Sz)/2" max="(N+2*Sz)/2"/>
  <QUANTUMNUMBER name="Ndown" min="(N-2*Sz)/2" max="(N-2*Sz)/2"/>
  <OPERATOR name="Splus" matrixelement="1">
    <CHANGE quantumnumber="Nup" change="1"/>
    <CHANGE quantumnumber="Ndown" change="-1"/>
    <CHANGE quantumnumber="Sz" change="1"/>
  </OPERATOR>
  <OPERATOR name="Sminus" matrixelement="1">
    <CHANGE quantumnumber="Nup" change="-1"/>
    <CHANGE quantumnumber="Ndown" change="+1"/>
    <CHANGE quantumnumber="Sz" change="-1"/>
  </OPERATOR>
  <OPERATOR name="Sz" matrixelement="Sz"/>
  <OPERATOR name="c_down" matrixelement="1">
    <CHANGE quantumnumber="Ndown" change="-1"/>
    <CHANGE quantumnumber="N" change="-1"/>
    <CHANGE quantumnumber="Sz" change="1/2"/>
  </OPERATOR>
  <OPERATOR name="cdag_down" matrixelement="1">
    <CHANGE quantumnumber="Ndown" change="1"/>
    <CHANGE quantumnumber="N" change="1"/>
    <CHANGE quantumnumber="Sz" change="-1/2"/>
  </OPERATOR>
  <OPERATOR name="c_up" matrixelement="1">
    <CHANGE quantumnumber="Nup" change="-1"/>
    <CHANGE quantumnumber="N" change="-1"/>
    <CHANGE quantumnumber="Sz" change="-1/2"/>
  </OPERATOR>
  <OPERATOR name="cdag_up" matrixelement="1">
    <CHANGE quantumnumber="Nup" change="1"/>
    <CHANGE quantumnumber="N" change="1"/>
    <CHANGE quantumnumber="Sz" change="+1/2"/>
  </OPERATOR>
  <OPERATOR name="n" matrixelement="N"/>
  <OPERATOR name="n_up" matrixelement="(N+2*Sz)/2"/>
  <OPERATOR name="n_down" matrixelement="(N-2*Sz)/2"/>
</SITEBASIS>

<BASIS name="Kondo lattice">
  <SITEBASIS ref="fermion">
    <PARAMETER name="local_maximum" value="local_max#"/>
    <PARAMETER name="local_max#" value="local_max"/>
    <PARAMETER name="local_max" value="2"/>
<PARAMETER name="local_minimum" value="local_min#"/>
    <PARAMETER name="local_min#" value="local_min"/>
    <PARAMETER name="local_min" value="0"/>
  </SITEBASIS>
  <CONSTRAINT quantumnumber="N" value="N_total"/>
  <!-- <CONSTRAINT quantumnumber="Sz" value="Sz_total"/> -->
</BASIS>

<BONDOPERATOR name="exchange" source="x" target="y">
  Sz(x)*Sz(y)+1/2*(Splus(x)*Sminus(y)+Sminus(x)*Splus(y))
</BONDOPERATOR>

<BONDOPERATOR name="fermion_hop" source="x" target="y">
  cdag_up(x)*c_up(y)+cdag_up(y)*c_up(x)+cdag_down(x)*c_down(y)+cdag_down(y)*c_down(x)
</BONDOPERATOR>

<HAMILTONIAN name="Kondo lattice">
  <PARAMETER name="mu" default="0"/>
  <PARAMETER name="t" default="1"/>
  <PARAMETER name="J" default="1"/>
  <BASIS ref="Kondo lattice"/>
  <SITETERM type="0" site="i">
    -mu*n(i)
  </SITETERM> 
  <SITETERM type="1">
    0
  </SITETERM> 
  <BONDTERM type="0" source="i" target="j">
    -t*fermion_hop(i,j)
  </BONDTERM>
  <BONDTERM type="1" source="i" target="j">
    J*exchange(i,j)
  </BONDTERM>
</HAMILTONIAN>

</MODELS>

--------------------------CHAIN LATTICE IN my_lattices.xml--------------------------------------

<LATTICES>

<LATTICE name="chain lattice" dimension="1">
  <PARAMETER name="a" default="1"/>
  <BASIS><VECTOR>a</VECTOR></BASIS>
  <RECIPROCALBASIS><VECTOR>2*pi/a</VECTOR></RECIPROCALBASIS>
</LATTICE>
<UNITCELL name="fermion" dimension="1">
  <VERTEX type="0"/>
  <VERTEX type="1"/>
  <EDGE type="0"><SOURCE vertex="1" offset="0"/><TARGET vertex="1" offset="1"/></EDGE>
  <EDGE type="1"><SOURCE vertex="1" offset="0"/><TARGET vertex="2" offset="0"/></EDGE>
</UNITCELL>
<LATTICEGRAPH name = "chain lattice">
  <FINITELATTICE>
    <LATTICE ref="chain lattice"/>
    <PARAMETER name="L" default="4"/>
    <EXTENT size="L"/>
    <BOUNDARY type="open"/>
  </FINITELATTICE>
  <UNITCELL ref="fermion"/>
</LATTICEGRAPH>

</LATTICES>

---------------------------------------END-------------------------------------------------------

กก
Best,
Bo-Nan

--
Stay foolish,Stay hungry.