QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py...

13
1 2 2 2 3 3 5 10 13 Table of Contents Table of Contents Metadynamics Simulation of Cu Vacancy Diffusion on Cu(111) - Using PLUMED Introduction Theoretical Background Metadynamics Simulation of Cu Vacancy on Cu(111) Creating a Vacancy on Cu(111) Creating the Metadynamics Script Analyzing the Results References

Transcript of QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py...

Page 1: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

1222335

10

13

Table of Contents

Table of ContentsMetadynamics Simulation of Cu Vacancy Diffusion on Cu(111) - Using PLUMED

IntroductionTheoretical BackgroundMetadynamics Simulation of Cu Vacancy on Cu(111)

Creating a Vacancy on Cu(111)Creating the Metadynamics ScriptAnalyzing the Results

References

Page 2: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

Downloads & LinksDownloads & Links

PDF version vacancy-hopping.py extract_ F.py plot_ F_ vs_ cv1_ cv2.py cv1_ cv2_ vs_ t ime.py barrier.py

Docs » Tutorials » New or Recent ly Updated Tutorials »Metadynamics Simulat ion of Cu Vacancy Diffusion on Cu(111) - Using PLUMED

Metadynamics Simulat ion of Cu Vacancy Dif fusionMetadynamics Simulat ion of Cu Vacancy Dif fusionon Cu(111) - Using PLUMEDon Cu(111) - Using PLUMEDVersion:Version: P-2019.03

In this tutorial you will learn how to setup and run metadynamics simulat ions in Quant umAT KQuant umAT K using thePlumedMetadynamics class and the PLUMED plugin. It will cover set t ing up a simulat ion to explore the free-

energy landscape associated with the diffusion of a Cu vacancy on Cu(111), how to setup a metadynamicscalculat ion, and how to analyze the results.

In t roduct ionIn t roduct ion

Metadynamics [LP02] is a powerful method based on molecular dynamics to explore mult idimensional freeenergy surfaces (FESs). It allows one to reconstruct the FES of a system as a funct ion of a number ofcollect ive variables (CVs) which are based on the microscopic coordinates of the system.

In metadynamics, an addit ional bias potent ial is added to the system at regular intervals during thesimulat ion t ime. This allows the system to escape deep free-energy minima and overcome high-energybarriers, thereby exploring eff icient ly the ent ire free-energy surface. Within materials science, the methodhas been used to invest igate crystal polymorphism, solid- liquid interfaces, and chemical react ions in solidsand surfaces. Here, you will apply it to invest igate the diffusion of a Cu vacancy on Cu(111).

Quant umAT KQuant umAT K implements metadynamics via the PLUMED plugin. In this tutorial, we will int roduce themethod briefly, explain how to setup a metadynamics script for the vacancy diffusion on Cu(111), and howto analyze the result ing free-energy surface.

For more informat ion on the metadynamics method, you may look at Refs. [BBP11] and [BN15].

Theoret ical BackgroundTheoret ical Background

In metadynamics, an external bias potent ial is const ructed in the phase space of a few selected degrees

Quant umAT KQuant umAT K

Try it !

QuantumATK

Contact

Page 3: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

of freedom,, generally called collect ive variables (CVs) [LP02]. is a set of funct ions of the microscopic coordinates of the system.

This potent ial is built as a sum of Gaussians deposited along the t rajectory in the CVs space at t ime. In its simplest version, the potent ial takes the form [BBP11]

where is the Gaussian deposit ion st ride, is the width of the Gaussian for the

-th CV, and is the height of the Gaussian. The effect of the bias potent ial is to push the system away from local

minima and allow it to visit new regions of the phase space.

Met adynam ics Sim ulat ion of Cu Vacancy on Cu(111)Met adynam ics Sim ulat ion of Cu Vacancy on Cu(111)

Cre at i ng a Vac anc y o n Cu(111)Cre at i ng a Vac anc y o n Cu(111)

To create the Cu vacancy on Cu(111), you f irst need to make a Cu(111) surface.

In the BuilderBuilder, click on Add‣From Database and import ‘Copper‘. Then click on Builders ‣ Surface(Cleave) to create the Cu(111) surface, using the following set t ings:

Set the Miller indices to

Use the surface lat t ice shown in the image below:

SSdR

S(R) = (S1(R), . . . , Sd(R)).

t

V (S, t) = ∫ t

0dt

′ exp(−

d∑i=1 ),

W

τ

(Si(R) − Si(R(t′)))2

2σ2i

τσi

iW

⟨111⟩

Page 4: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

Set the out -of-plane cell vector as ‘Non-periodic and normal (slab)‘Set the thickness to 6 layers and the vacuum gap to 10 Å

Next , create a vacancy by delet ing the atom of the topmost layer with posit ion (shown in red in the f igure below):(x, y) = (0, 0)

Page 5: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

Finally, click on Select ion Tools ‣ Tags and tag the 4 lowermost Cu(111) layers. This tag will be used to f ixthem during the metadynamics simulat ion.

Cre at i ng t he M e t adynami c s Sc r i ptCre at i ng t he M e t adynami c s Sc r i pt

Now you are ready to create the script to perform the metadynamics simulat ion. Send the st ructure from the St ashSt ash to the Script Generat orScript Generat or and setup the script as follows:

1. Add the following blocks: Calculators ‣ ForceFieldCalculator Opt imizat ion ‣ MolecularDynamics

Page 6: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

2. Double click on the ForceFieldCalculat orForceFieldCalculat or block and use the ‘EAM_Cu_2001b‘ parameter set .

3. Open the MolecularDynamicsMolecularDynamics block and set the simulat ion parameters as shown in the f igurebelow:

Page 7: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

4. Finally, click on Add Const raint sAdd Const raint s and f ix the bot tommost 4 layers of Cu(111), which have beenpreviously tagged.

Send the script to the Edit orEdit or using the icon in the Script erScript er, and add the highlighted lines asshown below to include the PlumedMetadynamics class to perform the metadynamics calculat ion:

Page 8: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

# -------------------------------------------------------------# Calculator# -------------------------------------------------------------

potentialSet = EAM_Cu_2001b()calculator = TremoloXCalculator(parameters=potentialSet)calculator.setVerletListsDelta(0.25*Angstrom)

bulk_configuration.setCalculator(calculator)nlprint(bulk_configuration)bulk_configuration.update()nlsave('vacancy-hopping.hdf5', bulk_configuration)

# -------------------------------------------------------------# Molecular Dynamics# -------------------------------------------------------------

initial_velocity = MaxwellBoltzmannDistribution( temperature=200.0*Kelvin, remove_center_of_mass_momentum=True)

method = Langevin( time_step=1*femtoSecond, reservoir_temperature=200*Kelvin, friction=0.01*femtoSecond**-1, initial_velocity=initial_velocity, heating_rate=0*Kelvin/picoSecond,)

fix_atom_indices_0 = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63]

constraints = [FixAtomConstraints(fix_atom_indices_0)]

plumed_command = """\UNITS LENGTH=A TIME=fs ENERGY=96.48533645956869p: POSITION ATOM=81METAD ARG=p.x,p.y SIGMA=0.025,0.025 HEIGHT=0.05,0.05 PACE=1000 LABEL=restraintPRINT ARG=p.x,p.y,restraint.bias STRIDE=10 FILE=COLVAR"""

plumed_hook = PlumedMetadynamics( configuration=bulk_configuration, timestep=1.0*fs, plumed_commands=plumed_command, logfile='plumed.log',)md_trajectory = MolecularDynamics( bulk_configuration, constraints=constraints, trajectory_filename='vacancy-hopping-trajectory.hdf5', steps=10000000, log_interval=1000, post_step_hook=plumed_hook, method=method)

bulk_configuration = md_trajectory.lastImage()nlsave('vacancy-hopping.hdf5', md_trajectory)

You can also download the input f ile from here: vacancy-hopping.py.

Page 9: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

In the input above, the plumed_command sect ion contains the input that will be passed direct ly toPLUMED [BBP11].

There are four command lines:

UNITS: this line controls the units that will be used by PLUMED. Edit the lines as above, and the units ofÅ, femtoseconds, and eV will be used.p: This line is used to define the constrained atoms, in this case, the atom with index

.

Not eNot e

This value should be set according to the indexing used by PLUMED, where atom indexing startsfrom

, and not from as in Quant umAT KQuant umAT K. This value should therefore be set to “atom index

”, where “atom index” is the index of the constrained atom.

We will look at the potent ial energy surface in the- and- axis using the gaussian funct ion of the width (

) and height () on each axis.

METAD: This line controls the type of metadynamics and the shape of Gaussians funct ions that will beused during the simulat ions:

ARG: this f lag is used to set the collect ive variables. In this case, we will use as collect ivevariables the posit ion of the atom

along the Cartesian direct ion and

.SIGMA: this f lag is used to set the value of the width of the Gaussian funct ions

used for each collect ive variable. In this case, we will use for both collect ive variables.

HEIGHT: this f lag is used to set the height of the Gaussian funct ions used for each collect ivevariable. In this case, we will use a height of

eV for both collect ive variables.PACE: this f lag is used to set the intervals at which a new Gaussian funct ion will be added. In thiscase, we will add a new Gaussian funct ion every

MD steps.LABEL: this f lag is used to set the name of the collect ive variables.

PRINT: This line controls the format of the PLUMED output .

ARG: this f lag controls the variables that will be printed, in the present case,, and the bias.

STRIDE: this indicates the print ing interval. In the present case, MD steps.

FILE: this line indicates the name of the output f ile.

If you would like to know more detailed informat ion, we recommend you to look in the PLUMED

81

10+1

xy0.0250.05

p

x (p. x)y (p. y)

σ

σ = 0.025

0.05

1000

p. x

p. y

10

Page 10: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

documentat ion. These commands are passed to the PlumedMetadynamics class. The lat ter is passed to theMolecularDynamics class using a hook f unct ionhook f unct ion.

Once you are done, send it to the Job ManagerJob Manager and run the simulat ion. It will take about 8 hours on 8CPUs.

Anal yz i ng t he R e sul t sAnal yz i ng t he R e sul t s

In addit ion to the standard Quant umAT KQuant umAT K output , at the end of the job you will obtain the f iles COLVAR andHILLS . These two f iles are the output of PLUMED and will be used to analyze the metadynamics

simulat ion.

To plot the profile of the free energy as a funct ion of the collect ive variables

and, you f irst have to run the script ext ract_F.py as atkpython extract_F.py . Three output f iles will

be produced:

F_vs_cv1.dat contains the data for vs.

.F_vs_cv2.dat contains the data for vs.

.F_vs_cv1_cv2.dat contains the data for vs.

and.

The map of the free energy profile can be obtained by running the script plot_F_vs_cv1_cv2.py as:

atkpython F_vs_cv1_cv2.py

FCV 1CV 2

FCV 1

FCV 2

FCV 1CV 2

F

Page 11: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

The above plot shows a heat map of the free energy profile as a funct ion of the collect ive variables and. It can be seen that there are two minima on the free-energy surface, corresponding to the

diffusion of the vacancy from one site to the neighboring one.

The evolut ion of the collect ive variables over the simulat ion t ime can be obtained by running the script cv1_cv2_vs_t ime.py as:

atkpython cv1_cv2_vs_time.py

CV 1CV 2

Page 12: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

The result ing plot shows the evolut ion of (red) and (blue) as a funct ion of the simulat ion t ime. It can be seen that, which corresponds to the

Cartesian coordinate, oscillates around a constant value (

), because both free energy minima occur at the same value of. Conversely, the evolut ion of

, which corresponds to the x Cartesian coordinate, indicates that the simulat ion starts in theminimum on the left (

). The f irst minimum is f illed unt il at approx. ns, and then the system moves to the second minimum (

). After the second minimum is also f illed, at around ns the system oscillates with equivalent probabilit ies between the two minima, unt il the simulat ion is

completed.

The free energy barrier can also be analyzed by running the script barrier.py as:

atkpython barrier.py

CV 1CV 2CV 2yCV 2= 0ÅyCV 1

CV 1= −2.5Å2.2CV 1= 0Å6

Page 13: QuantumATK Q-2019.12 Documentation | …...Downloads & Links PDF version vacancy-hopping.py extract_F.py plot_F_vs_cv1_cv2.py cv1_cv2_vs_time.py barrier.py Docs » Tutorials » New

Next

The results show that the barrier has a height of eV, in good agreement with the results in [KNB17].

ReferencesReferences

[BN15] Kristof M. Bal and Erik C. Neyts. Merging metadynamics into hyperdynamics: Accelerated molecularsimulat ions reaching t ime scales from microseconds to seconds. Journal of Chemical Theory andComputat ion, 11(10):4545–4554, 2015.

[BBP11] (1, 2, 3) Alessandro Barducci, Massimiliano Bonomi, and Michele Parrinello. Metadynamics. WIREs:Comput. Mol. Sci., 1(5):826–843, 2011. doi:10.1002/wcms.31.

[KNB17] Suresh Kondat i Natarajan and Jörg Behler. Self-diffusion of surface defects at copper-waterinterfaces. The Journal of Physical Chemistry C, 121(8):4368–4383, 2017.

[LP02] (1, 2) Alessandro Laio and Michele Parrinello. Escaping free-energy minima. Proc. Nat l. Acad. Sci.,99(20):12562–12566, 2002.

Previous

© Copyright 2020 Synopsys, Inc. All Rights Reserved.

0.647