Author Topic: Documentation example is not working  (Read 54733 times)

0 Members and 1 Guest are viewing this topic.

Offline Nemthianhoi Zou

  • Regular QuantumATK user
  • **
  • Posts: 15
  • Country: in
  • Reputation: 0
    • View Profile
Documentation example is not working
« 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.

Offline Ulrik G. Vej-Hansen

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 427
  • Country: dk
  • Reputation: 9
    • View Profile
Re: Documentation example is not working
« Reply #1 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?

Offline Nemthianhoi Zou

  • Regular QuantumATK user
  • **
  • Posts: 15
  • Country: in
  • Reputation: 0
    • View Profile
Re: Documentation example is not working
« Reply #2 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

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5749
  • Country: dk
  • Reputation: 112
    • View Profile
    • QuantumATK at Synopsys
Re: Documentation example is not working
« Reply #3 on: April 29, 2025, 01:29 »
e is not a variable or known name. Use elementary_charge

Offline Nemthianhoi Zou

  • Regular QuantumATK user
  • **
  • Posts: 15
  • Country: in
  • Reputation: 0
    • View Profile
Re: Documentation example is not working
« Reply #4 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?

Offline Anders Blom

  • QuantumATK Staff
  • Supreme QuantumATK Wizard
  • *****
  • Posts: 5749
  • Country: dk
  • Reputation: 112
    • View Profile
    • QuantumATK at Synopsys
Re: Documentation example is not working
« Reply #5 on: May 2, 2025, 18:55 »
You can just add
nlsave("analysis.hdf5", elastic_constants)
as the last line.