Linesearch alpha is zero when mimimizing Cu(111) slabs

Hi everyone,

I’m trying to determine the relationship between the thickness of a Cu (111) nanofilm and the lattice parameter. My minimization keeps stopping due to “linesearch alpha is zero.” This only happens when I use non-integer values for zmin and zmax. I use non-integer values in order to create slabs of a specific number of layers. Any advice on how to get my slabs to minimize properly?

# -------------------VARIABLES---------------------

label loop_thick

variable zmin index 	-0.83	-1.66	-2.49	-3.32	-4.15	-4.98	-5.81	-6.64	-7.47	-8.3	-9.13	-9.96	-10.79	-11.62	-12.45	-13.28	-14.11	-14.94	-15.77	-16.6
variable zmax index	    0.84	1.67	2.5	3.33	4.16	4.99	5.82	6.65	7.48	8.31	9.14	9.97	10.8	11.63	12.46	13.29	14.12	14.95	15.78	16.61

# --------------- INITIALIZATION ------------------

clear
units 		metal
dimension	3
boundary	p p f     
atom_style	atomic

# ------------------ ATOM DEFINITION -------------------

lattice  	fcc 3.615  orient x 1 1 -2 orient y -1 1 0 orient z 1 1 1       # for (111) orientation
region		box block -3 3 -4 4 -18 18 units lattice

create_box	2 box

region		cube block INF INF INF INF ${zmin} ${zmax} units lattice 

create_atoms	1 region cube

group   Cu type 1
group   Ag type 2

mass  1  63.546
mass  2  107.868

set      group all type/fraction 2 0 56584

#dump 1 all custom 1000 asbebox.lammpstrj id type x y z 

# ------------------------ FORCE FIELDS -----------------------

pair_style	eam/alloy
pair_coeff * * CuAg.eam.alloy Cu Ag
neigh_modify	every 1 delay 0

#---------------------------Settings----------------------------

compute eng all pe/atom 
compute eatoms all reduce sum c_eng
fix 1 all box/relax x 0.0 y 0.0 couple xy vmax 0.001
thermo 10
thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms

#----------------------Run Minimization-------------------------

reset_timestep 0
min_style cg
minimize 1e-25 1e-25 100000 100000

variable natoms equal "count(all)" 
variable teng equal "c_eatoms"
variable pressure equal "press"
variable xlength equal "(lx/6)/(sqrt(8/3))"
variable ecoh equal "v_teng/v_natoms"

#undump 1

#-------------------------Output and loop-----------------------------------------


print "${teng} ${natoms} ${pressure} ${xlength} ${ecoh}" append SBE_lattice_constants_thickness_CuAg.txt screen no

next zmin
next zmax
jump SELF loop_thick

Because you are starting from a very symmetric geometry, it is difficult for the minimizer algorithms to find a direction to proceed. They are generally not built for this use case.

From my perspective, there are three things you could do:

  • try out different minimizer algorithms (via min_style) or different minimizer settings (via min_modify)
  • break the symmetry by adding a small random displacement to the atoms with the displace_atoms command
  • don’t use a minimizer and fix box/relax but rather compute a series of energies for geometries with a set of lattice parameters around the expected minimum and then fit those energies to a suitable equation of state and get the desired lattice parameter from that.