def test_reciprocal_matrix2(self): c = Crystal("oxalic acid") c.lattice_angles_deg = np.fromstring("90.0 103.2 90.0", sep=' ') c.lattice_lengths = np.fromstring("6.094 3.601 11.915", sep=' ') c.calculate_reciprocal() isaw_rec = np.fromstring(""" 1.031045 0.000000 0.000000 -0.000000 1.744845 0.000000 0.241829 -0.000000 0.54164""", sep=' ').reshape(3,3) assert np.allclose(isaw_rec, c.reciprocal_lattice), "Reciprocal lattice of %s matches ISAW lattice." % c.name
def test_reciprocal_matrix1(self): c = Crystal("quartz") c.lattice_angles_deg = np.fromstring("90.0 90.0 120.0", sep=' ') c.lattice_lengths = np.fromstring("4.913 4.913 5.400", sep=' ') c.calculate_reciprocal() isaw_rec = np.fromstring(""" 1.278890 0.000000 0.000000 0.738367 1.476735 -0.000000 -0.000000 -0.000000 1.163553""", sep=' ').reshape(3,3) assert np.allclose(isaw_rec, c.reciprocal_lattice), "Reciprocal lattice of %s matches ISAW lattice." % c.name
def test_reciprocal_matrix4(self): c = Crystal("Natrolite(conventional orthorhombic cell)") c.lattice_angles_deg = np.fromstring("90.0 90.0 90.0", sep=' ') c.lattice_lengths = np.fromstring("18.328 18.585 6.597", sep=' ') c.calculate_reciprocal() isaw_rec = np.fromstring(""" 0.342819 0.000000 0.000000 -0.000000 0.338078 0.000000 -0.000000 -0.000000 0.952431 """, sep=' ').reshape(3,3) #print c.reciprocal_lattice, "\n\n\n" assert np.allclose(isaw_rec, c.reciprocal_lattice, atol=1e-5), "Reciprocal lattice of %s matches ISAW lattice." % c.name
def test_reciprocal_matrix3(self): c = Crystal("Natrolite(reduced cell)") c.lattice_angles_deg = np.fromstring("83.5 70.5 70.2", sep=' ') c.lattice_lengths = np.fromstring("6.601 9.739 9.893", sep=' ') c.calculate_reciprocal() isaw_rec = np.fromstring(""" 0.951854 -0.000000 0.000000 -0.342876 0.685738 0.000000 -0.336898 0.000033 0.673719 """, sep=' ').reshape(3,3) #print c.reciprocal_lattice, "\n\n\n" assert np.allclose(isaw_rec, c.reciprocal_lattice, atol=1e-3), "Reciprocal lattice of %s matches ISAW lattice." % c.name