[ALPS-users] problem in reading custom-lattice.xml

Bheema Lingam Chittari bheemalingam at gmail.com
Fri Jun 2 08:22:46 CEST 2017


Dear Users,

Recently, I started using ALPS for Classical Monte Carlo with Python
interface. I would like to do calculations for square-lattice with 1st
(vertical), 2nd (horizantal) and 3rd (diagonal) nearest neighbours
interactions J0, J1, J2. For the I have created a square-lattice.xml for
4x4 lattice.

If I run the code in jupyter notebook, i am getting following error:

parsing task files ...
could not find graph/lattice specified in parameters: name was:
'Square_lattice'

Please help me to find the error (I mean the xmal file written properly?),
Do I need to do before I have to use my own xml file?

My code is as follows:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
import pyalps
import matplotlib.pyplot as plt
import pyalps.plot

parms = []
for l in [16]:
    for t in [1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8,
8.5, 9, 9.5, 10, 11, 12, 13, 14, 15]:
        parms.append(
            {
             'LATTICE_LIBRARY' : "./Square-lattice.xml",
              'LATTICE'        : "Square_lattice",
              'T'              : t,
              'S'              : 2.62,
              'J0'              : 0.52 ,
              'J1'              : -0.09 ,
              'J2'              : 0.86 ,
              'THERMALIZATION' : 1000,
              'SWEEPS'         : 400000,
              'UPDATE'         : "local",
              'MODEL'          : "Ising",
              'L'              : l
            }
    )

input_file = pyalps.writeInputFiles('Square_isg',parms)
pyalps.runApplication('spinmc',input_file,Tmin=10)
pyalps.evaluateSpinMC(pyalps.getResultFiles(prefix='Square_isg'))
data =
pyalps.loadMeasurements(pyalps.getResultFiles(prefix='Square_isg'),['|Magnetization|',
'Specific Heat'])
magnetization_abs =
pyalps.collectXY(data,x='T',y='|Magnetization|',foreach=['L'])
spec_heat = pyalps.collectXY(data,x='T',y='Specific Heat',foreach=['L'])

#make plots
plt.figure()
pyalps.plot.plot(magnetization_abs)
plt.xlabel('Temperature $T$')
plt.ylabel('Magnetization $|m|$')
plt.legend()
plt.title('2D Ising model')

plt.figure()
pyalps.plot.plot(spec_heat)
plt.xlabel('Temperature $T$')
plt.ylabel('Specific Heat $c_v$')
plt.legend()
plt.title('2D Ising model')
plt.show()
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
my xml file is below:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
<LATTICES>

<LATTICE name="Square_lattice" dimension="2">
  <PARAMETER name="a" default="1"/>
  <PARAMETER name="b" default="1"/>
  <BASIS>
    <VECTOR>a   0</VECTOR>
    <VECTOR>0   b</VECTOR>
  </BASIS>
  <RECIPROCALBASIS>
    <VECTOR>2*pi/a 0</VECTOR>
    <VECTOR>0 2*pi/b</VECTOR>
  </RECIPROCALBASIS>
</LATTICE>

<UNITCELL name="simple2d" dimension="2" vertices = "4">
 <VERTEX><COORDINATE>  0.0 0.0</COORDINATE></VERTEX>
  <VERTEX><COORDINATE> 0.5 0.0</COORDINATE></VERTEX>
 <VERTEX><COORDINATE>  0.0 0.5</COORDINATE></VERTEX>
  <VERTEX><COORDINATE> 0.5 0.5</COORDINATE></VERTEX>

  <EDGE type="0"><SOURCE vertex="1" offset="0 0"/><TARGET vertex="2"
offset="0.5 0"/></EDGE>
  <EDGE type="1"><SOURCE vertex="1" offset="0 0"/><TARGET vertex="3"
offset="0 0.5"/></EDGE>
  <EDGE type="2"><SOURCE vertex="1" offset="0 0"/><TARGET vertex="4"
offset="0.5 0.5"/></EDGE>
</UNITCELL>

<LATTICEGRAPH name = "Square_lattice 4x4" >
  <FINITELATTICE>
    <LATTICE ref="Square_lattice"/>
    <EXTENT dimension="1" size="4"/>
    <EXTENT dimension="2" size="4"/>
    <BOUNDARY type="periodic"/>
  </FINITELATTICE>
  <UNITCELL ref="simple2d"/>
</LATTICEGRAPH>

</LATTICES>
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Thank you in advance
Dr. Bheema Lingam Chittari
Post Doctoral Researcher,
Room No:14-115,
Department of Physics,
University of Seoul,
163 Seoulsiripdae-ro,
Dongdumen-gu,
Seoul, South Korea
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.phys.ethz.ch/pipermail/comp-phys-alps-users/attachments/20170602/e148ebad/attachment.html>


More information about the Comp-phys-alps-users mailing list