1
$\begingroup$

I am getting the following error while implementing ase cell method. I am not able to understand where is it going wrong, although I think it has to do something with the values I am getting for cell.

Value of cell as input:

print("cell: ", cell)

cell:  tensor([-20652532695040.0000,      2.5612,      5.1907,    368.5623,     88.8819,
           101.3538])

Problem Code:

placeholder = Atoms(numbers=[1], positions=[[0,0,0]], cell=cell.detach().cpu().numpy())

Error:

/site-packages/ase/cell.py", line 80, in new
    cell = cellpar_to_cell(cell)

/site-packages/ase/geometry/cell.py", line 129, in cellpar_to_cell
    assert cz_sqr >= 0
AssertionError
$\endgroup$
2
  • 3
    $\begingroup$ There is a lot weird about your cell parameters. How did you get such a large negative value for the first parameter (which should be cell parameter "a")? How did you get an angle greater than 360 for $\alpha$ (the fourth parameter)? I think we need to see your whole script/input structures to understand what really went wrong. As for the error message you are getting, cellpar_to_cell is making the assumption that angles will be between 0 and 360, so some of the if checks it does are invalid for your cell. Source code: gitlab.com/ase/ase/-/blob/master/ase/geometry/cell.py $\endgroup$
    – Tyberius
    Mar 30 at 21:54
  • $\begingroup$ @Formal_this Could you please add your entire script as a code block? $\endgroup$ May 1 at 15:03

0