simphony / simphony-common

The native implementation of the Simphony cuds objects
BSD 2-Clause "Simplified" License
7 stars 5 forks source link

NaN value for PrimitiveCell.for_rhombohedral_lattice #245

Closed kitchoi closed 8 years ago

kitchoi commented 8 years ago

when the angle alpha gets close to 120 degree, the z coordinate of the third primitive vector gets vanishingly small. Eventually np.sqrt(sina**2 - ((cosa-cosa**2) / sina)**2) here is trying to compute the square-root of a negative value.

Edited: Similar problem with for_triclinic_lattice Should raise a ValueError when the quantity within sqrt is less than 0