msg-byu / symlib

Spacegroup finder. Includes symmetry-related routines for cluster expansion and other codes that rely on symmetries of lattices and crystals.
MIT License
12 stars 15 forks source link

Possible error in minkowski_reduce_basis #14

Closed wsmorgan closed 7 years ago

wsmorgan commented 7 years ago

When given a basis, constructed using:

       c_basis(:,1) = (/0.5_dp,1.0_dp,0.0_dp/)
       c_basis(:,2) = (/0.5_dp,-1.0_dp,0.0_dp/)
       c_basis(:,3) = (/0.0_dp,0.0_dp,3.0_dp/)

The minkowski_reduce_basis vectors return:

 C_mink
   1.0000000000000000        0.0000000000000000        0.0000000000000000     
   0.0000000000000000        0.0000000000000000        3.0000000000000000     
   0.0000000000000000        0.0000000000000000        3.0000000000000000     

This reduced basis is linearly dependent, but the original basis is not. I've produced this error now with eps values of 1E-3 to 1E-10, and by transposing the input basis. The returned reduced basis is always linearly dependent. The input vectors above are a basis choice for a base centered orthorhombic cell. Oddly my python code returns 3 vectors that are linearly independent and make intuitive sense:

[[ 1. ,  0. ,  0. ],
       [-0.5,  1. ,  0. ],
       [ 0. ,  0. ,  3. ]]

but I'm not convinced it's the correct answer.

wsmorgan commented 7 years ago

Never mind, forgot to check a step between the minkowski reduction and the print that was changing the matrix even though it's not supposed too......