Dear Johnny,you need just to finalize your system before doing calculation.so :sys=sys.finalized()m=len(sys.sites)and it will work .Best regards,Adel--On Sun, Apr 17, 2016 at 7:23 PM, Johnny Wu <darknesswtc@gmail.com> wrote:Dear Dr. AdelI could not compute len(sys.sites) since sys.sites is of the type "method". How should I change it? Thanks.Best,JohnnyOn 14 April 2016 at 18:44, Abbout Adel <abbout.adel@gmail.com> wrote:Dear Johnny,if you want to get the index of a site in you system, you can do it as follow:sys=make_system()sys=sys.finalized()Positions=[sys.sites[i].pos for i in range(len(sys.sites))] # list of all the positions of the sitesSince you know the form of you system, you can obtain the positions of the sites at the edge.for example if the site at (3,5) is at the edge you can find its index straightforwardly:Index_i= Positions.index((3,5))once you know the index of your site, you can do whatever you want. for example delete that site:del sys[sys.sites[index_i]]or you can pass it to a function which has site as an argument :function(sys.sites[index_i])I hope that this helpsBest regards,Adel
Abbout Adel