QuantumATK Forum

QuantumATK => General Questions and Answers => Topic started by: Nemthianhoi Zou on April 24, 2025, 10:02

Title: Documentation example is not working
Post by: Nemthianhoi Zou on April 24, 2025, 10:02
https://docs.quantumatk.com/_downloads/230cae9ab632421ed113e69e59fb14aa/TiO2_Matsui.py
shows error
Traceback (most recent call last):
  File "/home/qtk/quantumatk/W-2024.09/bin/../atkpython/bin/atkpython", line 8, in <module>
    sys.exit(__run_atkpython())
             ^^^^^^^^^^^^^^^^^
  File "zipdir/ATKExecutables/atkwrappers/__init__.py", line 803, in __run_atkpython
  File "Tio2.py", line 32, in <module>
    potentialSet.addParticleType(ParticleType(symbol='O', mass=15.9994*atomic_mass_unit, charge=-1.098))
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "build/atkpython/lib/python3.11/site-packages/tremolox/potentials/particletype.py", line 90, in __init__
  File "build/atkpython/lib/python3.11/site-packages/tremolox/potentials/potentialbase.py", line 335, in setParameter
  File "build/atkpython/lib/python3.11/site-packages/tremolox/potentials/potentialbase.py", line 155, in __setitem__
  File "build/atkpython/lib/python3.11/site-packages/tremolox/potentials/checks.py", line 139, in apply
TypeError: The parameter charge = -1.098 must have a unit that can be converted to e.
Title: Re: Documentation example is not working
Post by: Ulrik G. Vej-Hansen on April 25, 2025, 14:51
Looks like it is just a missing unit on the charge definition, try adding "*e".

Could you link to the page where you found it?
Title: Re: Documentation example is not working
Post by: Nemthianhoi Zou on April 28, 2025, 07:04
Thank you for your response. I also tried it with *e but the error still persists : "NameError: name 'e' is not defined".
Here's the link to the file:https://docs.quantumatk.com/tutorials/combining_potentials/combining_potentials.html
Title: Re: Documentation example is not working
Post by: Anders Blom on April 29, 2025, 01:29
e is not a variable or known name. Use elementary_charge
Title: Re: Documentation example is not working
Post by: Nemthianhoi Zou on April 29, 2025, 12:50
Yes after trying this *elementary_charge, the error popping up with the elastic Constants saying an unexpected keyword argument 'scf_restart_step_length'. i tried after removing the line 'scf_restart_step_length=0.1*Angstrom' from the elastic constants. The simulation finishes but now resultant structure (.hdf5) was not generated. What would be the issue?
Title: Re: Documentation example is not working
Post by: Anders Blom on May 2, 2025, 18:55
You can just add
nlsave("analysis.hdf5", elastic_constants)
as the last line.