Hello @xiaochendu,
I encountered an error while running Si_111_5x5 tutorial and another system I'm working with (using Tersoff potential). The GaN tutorial seems to be working. The error appears randomly after 30-100 sweeps on multiple machines.
File "/home/barbosa/softwares/surface-sampling/mcmc/mcmc.py", line 380, in run
sweep_result = self.sweep(i=i) # TODO change to .step
^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/mcmc.py", line 280, in sweep
accept = self.step_canonical(iter_num=run_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/mcmc.py", line 225, in step_canonical
event = Exchange(self.surface, proposal, criterion)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/events/event.py", line 132, in init
self.action = self.proposal.get_action()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/events/proposal.py", line 163, in get_action
site1_idx, site2_idx, site1_ads, site2_ads = get_complementary_idx(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/slab.py", line 202, in get_complementary_idx
site1_idx, site2_idx = (
^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/slab.py", line 203, in
random.choices(curr_ads[x], weights=w, k=1)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/miniconda3/envs/vssr/lib/python3.11/random.py", line 509, in choices
raise ValueError('Total of weights must be greater than zero')
ValueError: Total of weights must be greater than zero
Hello @xiaochendu,
I encountered an error while running Si_111_5x5 tutorial and another system I'm working with (using Tersoff potential). The GaN tutorial seems to be working. The error appears randomly after 30-100 sweeps on multiple machines.
File "/home/barbosa/softwares/surface-sampling/mcmc/mcmc.py", line 380, in run
sweep_result = self.sweep(i=i) # TODO change to .step
^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/mcmc.py", line 280, in sweep
accept = self.step_canonical(iter_num=run_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/mcmc.py", line 225, in step_canonical
event = Exchange(self.surface, proposal, criterion)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/events/event.py", line 132, in init
self.action = self.proposal.get_action()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/events/proposal.py", line 163, in get_action
site1_idx, site2_idx, site1_ads, site2_ads = get_complementary_idx(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/slab.py", line 202, in get_complementary_idx
site1_idx, site2_idx = (
^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/softwares/surface-sampling/mcmc/slab.py", line 203, in
random.choices(curr_ads[x], weights=w, k=1)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/barbosa/miniconda3/envs/vssr/lib/python3.11/random.py", line 509, in choices
raise ValueError('Total of weights must be greater than zero')
ValueError: Total of weights must be greater than zero