Dear Dr. Adel
I could not compute len(sys.sites) since sys.sites is of the type "method". How should I change it? Thanks.
Best, Johnny
On 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 sites
Since 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 helps
Best regards, Adel www.abboutadelhomepage.com