[ase-users] A short script for making a periodic table

Ask Hjorth Larsen asklarsen at gmail.com
Wed Jan 22 19:43:22 CET 2020


Am Mi., 22. Jan. 2020 um 11:16 Uhr schrieb Jens Jørgen Mortensen via
ase-users <ase-users at listserv.fysik.dtu.dk>:
>
> Den 13.01.2020 kl. 16.54 skrev Michael Joseph Waters via ase-users:
> > Hi all,
> >
> > I made a short script that creates the row and column positions for each
> > element in the periodic table. I think it's handy if you are picking a
> > color set.
>
> Thanks! I've added it to our gallery:
>
>      https://wiki.fysik.dtu.dk/ase/dev/gallery/gallery.html#periodic-table

Good idea!  For the record I found it really neat, too, but didn't get
around to reply yet because... long TODO list.

Thanks Michael.

Best regards
Ask

>
> Jens Jørgen
>
> >
> >
> > ############### generates column, row positions for each element
> > x, y = 1, 1 # column, row , initial coordinates for Hydrogen
> > position_list = [(0,0,0)]
> > zmax = 118
> > for z in range(1,zmax+1):
> >      if z==2:  x += 16
> >      if z==5:  x += 10
> >      if z==13: x += 10
> >      if z==57 or z==89: y+=3
> >      if z==72 or z==104:
> >          y-=3
> >          x-=14
> >      position_list.append((x,y,0))
> >      x += 1
> >      if x > 18:
> >          x=1
> >          y+=1
> > ################### now for viewing
> > from ase.data import chemical_symbols, colors
> > from ase import Atoms, Atom, io
> > import numpy as np
> >
> > spacing = 2.5
> >
> > atoms = Atoms()
> > for z in range(1,zmax+1):
> >      symbol = chemical_symbols[z]
> >      position = spacing *np.array(position_list[z])
> >      position[1] = -position[1]
> >      atoms.append(Atom(symbol, position=position))
> >
> > io.write('ptable.xyz',atoms)
> >
> > from ase.visualize import view
> > view(atoms)
> >
> > I hope someone finds it useful.
> >
> > Cheers,
> > -Mike
> >
> > _______________________________________________
> > ase-users mailing list
> > ase-users at listserv.fysik.dtu.dk
> > https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
> >
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users



More information about the ase-users mailing list