Author Topic: Defining new Tersoff potential  (Read 8346 times)

0 Members and 1 Guest are viewing this topic.

Offline payam

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Reputation: 0
    • View Profile
Re: Defining new Tersoff potential
« Reply #15 on: July 25, 2016, 19:07 »
Dear Julian,
Thank you  very much for your response.
I followed your instructions and modified the script. However, still I get error. Could you please look at the below and let me know how to resolve it?
Thank you in advance.

Best regards,
Payam
+------------------------------------------------------------------------------+
|                                                                              |
| Atomistix ToolKit 2015.1 [Build 5b36b25]                                     |
|                                                                              |
+------------------------------------------------------------------------------+

Timing:                          Total     Per Step        %

--------------------------------------------------------------------------------

Loading Modules + MPI   :       1.32 s       1.32 s      98.29% |=============|
--------------------------------------------------------------------------------
Total                   :       1.34 s
Traceback (most recent call last):
  File "Lindsay_LJ_Julian.py", line 62, in <module>
    calculator = TremoloXCalculator(parameters=[potential, lj_interlayer_potential])
  File "./build/lib/python2.7/site-packages/tremolox/TremoloBaseCalculator.py", line 84, in __init__
  File "./build/lib/python2.7/site-packages/tremolox/TremoloXPotentialSet.py", line 11714, in mergePotentials
AttributeError: 'TersoffMixitPotential' object has no attribute 'merge'

Offline Julian Schneider

  • QuantumATK Staff
  • QuantumATK Guru
  • *****
  • Posts: 164
  • Country: dk
  • Reputation: 25
    • View Profile
Re: Defining new Tersoff potential
« Reply #16 on: July 27, 2016, 11:13 »
Sorry, my mistake. The TremoloXCalculator needs to get the list of potential-sets and not potentials. Also you need to define two Tersoff-potentials, each acting on one tagged group, otherwise the Tersoff-potential only acts on the atoms without a tag, (which are probably None). The correct way is the following:
Code
# -------------------------------------------------------------
# Calculator
# -------------------------------------------------------------
#-------------------- Definition ------------------------------
potential_set_1 = TremoloXPotentialSet(name = 'hBN_Tersoff_Lindsay_2011')

#-------------------- Add Particle ------------------------------
potential_set_1.addParticleType(ParticleType(symbol='B', mass=10.811 * atomic_mass_unit, charge=None, sigma=3.212*Angstrom, sigma14=None, epsilon=0.004*eV, epsilon14=None, atomicNumber=5))
potential_set_1.addParticleType(ParticleType(symbol='N', mass=14.0067 * atomic_mass_unit, charge=None, sigma=3.212*Angstrom, sigma14=None, epsilon=0.004*eV, epsilon14=None, atomicNumber=7))

#-------------------- Single Potential ------------------------------
potential = TersoffSingleTypePotential(particleType = 'B', A = 1433.0*eV, B = 417.3*eV, R = 1.95*Angstrom, S = 2.1*Angstrom, l = 3.4661*1/Angstrom, mu = 2.2288*1/Angstrom, alpha = 0.0*1/Angstrom, beta = 1.0239e-07, omega = 1.0, chi = 1.0, chiR = 1.0, m = 0, n = 0.72674, c = 30692.4, d = 4.7295, h = -0.98578)
potential_set_1.addPotential(potential)
potential = TersoffSingleTypePotential(particleType = 'N', A = 1433.0*eV, B = 417.3*eV, R = 1.95*Angstrom, S = 2.1*Angstrom, l = 3.4661*1/Angstrom, mu = 2.2288*1/Angstrom, alpha = 0.0*1/Angstrom, beta = 1.0239e-07, omega = 1.0, chi = 1.0, chiR = 1.0, m = 0, n = 0.72674, c = 30692.4, d = 4.7295, h = -0.98578)
potential_set_1.addPotential(potential)

#-------------------- Mix Potential ------------------------------
potential = TersoffMixitPotential(particleType1 = 'B', particleType2 = 'N', alpha = 0.0*1/Angstrom, omega = 1.0, chi = 1.0, chiR = 1.0, m = 0)
potential_set_1.addPotential(potential)

# Tell this potential-set to act only among atoms of the tagged group.
potential_set_1.setTags('layer1')

#-------------------- Definition ------------------------------
potential_set_2 = TremoloXPotentialSet(name = 'hBN_Tersoff_Lindsay_2011')

#-------------------- Add Particle ------------------------------
potential_set_2.addParticleType(ParticleType(symbol='B', mass=10.811 * atomic_mass_unit, charge=None, sigma=3.212*Angstrom, sigma14=None, epsilon=0.004*eV, epsilon14=None, atomicNumber=5))
potential_set_2.addParticleType(ParticleType(symbol='N', mass=14.0067 * atomic_mass_unit, charge=None, sigma=3.212*Angstrom, sigma14=None, epsilon=0.004*eV, epsilon14=None, atomicNumber=7))

#-------------------- Single Potential ------------------------------
potential = TersoffSingleTypePotential(particleType = 'B', A = 1433.0*eV, B = 417.3*eV, R = 1.95*Angstrom, S = 2.1*Angstrom, l = 3.4661*1/Angstrom, mu = 2.2288*1/Angstrom, alpha = 0.0*1/Angstrom, beta = 1.0239e-07, omega = 1.0, chi = 1.0, chiR = 1.0, m = 0, n = 0.72674, c = 30692.4, d = 4.7295, h = -0.98578)
potential_set_2.addPotential(potential)
potential = TersoffSingleTypePotential(particleType = 'N', A = 1433.0*eV, B = 417.3*eV, R = 1.95*Angstrom, S = 2.1*Angstrom, l = 3.4661*1/Angstrom, mu = 2.2288*1/Angstrom, alpha = 0.0*1/Angstrom, beta = 1.0239e-07, omega = 1.0, chi = 1.0, chiR = 1.0, m = 0, n = 0.72674, c = 30692.4, d = 4.7295, h = -0.98578)
potential_set_2.addPotential(potential)

#-------------------- Mix Potential ------------------------------
potential = TersoffMixitPotential(particleType1 = 'B', particleType2 = 'N', alpha = 0.0*1/Angstrom, omega = 1.0, chi = 1.0, chiR = 1.0, m = 0)
potential_set_2.addPotential(potential)

# Tell this potential-set to act only among atoms of the tagged group.
potential_set_2.setTags('layer2')

# Define a new potential for the interlayer interaction.
lj_interlayer_potential = TremoloXPotentialSet(name="InterLayerPotential")

# Add particle type definitions for both types.
lj_interlayer_potential.addParticleType(ParticleType.fromElement(Boron,))
lj_interlayer_potential.addParticleType(ParticleType.fromElement(Nitrogen, sigma=3.212*Angstrom, epsilon=0.004*eV))

# Add Lennard-Jones potentials between the nitrogen atoms of different layers.
lj_interlayer_potential.addPotential(LennardJonesPotential('N', 'N', r_cut=10.0*Angstrom))
lj_interlayer_potential.setTags(['layer1', 'layer2'])

# Combine all potential sets in a single calculator.
calculator = TremoloXCalculator(parameters=[potential_set_1, potential_set_2, lj_interlayer_potential])
bulk_configuration.setCalculator(calculator)

# This print statement will give you the full description of the potential.
# print calculator._potential_parameters._script()
Note, that the Tersoff potential acts only within each single layer, not between the different layers.

Offline payam

  • Heavy QuantumATK user
  • ***
  • Posts: 42
  • Reputation: 0
    • View Profile
Re: Defining new Tersoff potential
« Reply #17 on: July 27, 2016, 18:09 »
Dear Julian,
That's a perfect answer.
I used it and got the result. Thank you very much.

Best regards,
Payam