def rhom_9_24(n): """Finds the symmetry preserving HNFs for the trigonal lattices with a determinant of n. Assuming A = [[1,2,2],[2,1,2],[4,3,3]] for basis 9 A = [[-0.255922,-1.44338,0.92259],[1.51184,0,-0.845178],[1.255922,1.44338,0.07741]] for basis 24. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #alpha3 condition if f%a==0: #beta1 condition if c%2==0: bs = [0,c/2] else: bs = [0] for b in bs: #beta3 condition beta13 = f+b*f/float(a) if beta13%c==0: #find e values alpha2 condition e = 0 while (e<f): beta22 = e+b*e/float(a) g21= c+2*e g11 = b+2*b*e/float(c) if beta22%c==0 and g21%f==0 and g11%f==0: #find d from alpha1 condition d = 0 while (d<f): #beta2 condition beta12 = -a+b+d+d*b/float(a) g12 = -b-d+d*d/float(a)-e*beta12/float(c) g22 = -c-2*e+d*e/float(a)-e*beta22/float(c) if beta12%c==0 and g12%f==0 and g22%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) d += a e += a return spHNFs
def hex_12(n): """Finds the symmetry preserving HNFs for the hexagonal lattices with a determinant of n. Assuming A = [[1,0,0],[0.5,-0.8660254037844386,0],[0,0,2]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #alpha2 condition if c % a == 0: b = 0 #alpha1 condition while (b < c): beta13 = a + 2 * b beta11 = 2 * b + b * b / float(a) if beta13 % c == 0 and beta11 % c == 0: #gamma2 condition if f % 2 == 0: es = [0, f / 2] else: es = [0] for e in es: gamma13 = (a + 2 * b) * e / float(c) if gamma13 % f == 0: for d in range(f): gamma11 = b * d / float( a) - e * beta11 / float(c) gamma12 = 2 * d + b * d / float( a) - e * beta11 / float(c) gamma21 = c * d / float( a) - 2 * e - b * e / float(a) gamma22 = (c * d - b * e) / float(a) if gamma11 % f == 0 and gamma12 % f == 0 and gamma21 % f == 0 and gamma22 % f == 0: HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) b += a return spHNFs
def body_ortho_19(n): """Finds the symmetry preserving HNFs for the body centered orthorhombic lattices with a determinant of n. Assuming A = [[0.5,1,1.5],[0,2,0],[0,0,3]] (3rd basis choince in notes/body_centered_ortho). Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #beta1 condition if c%2==0: bs = [0,c/2] else: bs = [0] #gamma1 and gamma2 conditions if f%2==0: es = [0,f/2] else: es = [0] for b in range(c): #beta1 condition beta13 = a+2*b if beta13%c==0: for e in es: #gamma1 condition gamma13 = e*beta13/float(c) if gamma13%f==0: for d in range(f): #gamma1 condition gamma12 = a+2*d if gamma12%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def stet_11(n): """Finds the symmetry preserving HNFs for the simple tetragonal lattices with a determinant of n. Assuming A = [[1,0,0],[0,1,0],[0,0,2]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #alpha2 condition if c % a == 0: #use beta1 condition (c divisible by 2) and gamma2 #condition (f divisible by 2) to find b and e vals. if c % 2 == 0: bs = [0, c / 2] else: bs = [0] if f % 2 == 0: es = [0, f / 2] else: es = [0] #loop over values for e and b. for b in bs: #alpha1 condition if b % a == 0: beta13 = -a + b * b / float(a) if beta13 % c == 0: for e in es: g12 = 2 * b * e / float(c) if g12 % f == 0: for d in range(f): g13 = -e * beta13 / float(c) + d * ( b / float(a) - 1) g23 = -e * (b / float(a) + 1) + d * c / float(a) if g13 % f == 0 and g23 % f == 0: HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def body_tet_6_7_15_18(n): """Finds the symmetry preserving HNFs for the body centered tetragonal lattices with a determinant of n. Assuming : A = [[1.80278,-1.47253,0.762655],[2.80278,0.13535,-0.791285], [0.80278,-0.47253,2.762655]] for 6, A = [[1.95095, 1.19163, 0.879663],[0.0, 2.60788, 0.44606], [0.95095, -0.41625, 2.433603]] for 7, A = [[-1.0,-1.0,2.0],[0.0,-2.0,0.0],[-2.0,0.0,0.0]] for 15, A = [[-2.0,-1.0,1.0],[-3.0,1.0,0.0],[-1.0,-3.0,0.0]] for 18. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f % c == 0: if f % 2 == 0: es = [0, f // 2.] else: es = [0] for e in es: if e % c == 0: g21 = -c + (e * e / float(c)) if g21 % f == 0: for d in range(f): g13 = a + 2 * d if g13 % f == 0: for b in range(c): b12 = b - d if b12 % c == 0: g12 = -b + d - (b12 * e / float(c)) if g12 % f == 0: HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def rhom_4_2(n): """Finds the symmetry preserving HNFs for the rhombohedral lattice that matches niggli conditions for niggli cells number 2 and 4 with a determinant of n. Assuming A = [[-1.11652,-0.610985,0.616515],[0.0,-1.32288,-0.5],[1.0,1.32288,1.5]] for basis 2 and A = [[-0.548584,0.774292,1.04858],[0.0,-1.32288,0.5],[1.0,1.32288,0.5]] for basis 4. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] # conditions alpha 3 and betta3 if f%a == 0: if c%2==0: bs = [0,c/2] else: bs = [0] for b in bs: beta32 = -f+b*f/float(a) if beta32%c==0: for e in range(f): beta22 = -e+b*e/float(a) gamma11 = b-2*b*e/float(c) gamma21 = c-2*e if e%a==0 and beta22%c==0 and gamma11%f==0 and gamma21%f==0: for d in range(f): beta12 = -a+b-d+b*d/float(a) gamma12 = -a+d*d/float(a)-e*beta12/float(c) gamma22 = -e+d*e/float(a)-e*beta22/float(c) if d%a==0 and beta12%c==0 and gamma12%f==0 and gamma22%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def base_ortho_36(n): """Finds the symmetry preserving HNFs for the base centered orthorhombic lattices with a determinant of n. Assuming A = [[1, 1, 1], [1.41421, -1.41421, 0], [-1.43541, -1.43541, 1.37083]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f%a==0: if f%2==0: es = [0,f//2.] else: es = [0] if c%2==0: bs = [0,c//2.] else: bs = [0] for b in bs: b32 = -b*f/float(a) if b32%c==0: for e in es: b22 = -b*e/float(a) g13 = -2*b*e/float(c) if b22%c==0 and g13%f==0 and e%a==0: for d in range(0,f,a): b12 = -b*d/float(a) g12 = 2*d-d*d/float(a)-b12*e/float(c) g22 = 2*e-d*e/float(a)-b22*e/float(c) if b12%c==0 and g12%f==0 and g22%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def base_ortho_38_13(n): """Finds the symmetry preserving HNFs for the base centered orthorhombic lattices with a determinant of n. Assuming A = [[0.5,1,0],[0.5,-1,0],[0,0,3]] (1st basis choince in notes/base_ortho) for case 38 and A = [[ 1. , 1. , 1. ], [ 1. , -1. , -1. ], [ 0. , -1.73205, 1.73205]] for case 13. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #alpha2 condition if c%a==0: #gamma1 and gamma2 conditions if f%2==0: ed_vals = [0,f/2] else: ed_vals = [0] b=0 #alhpa1 condition while (b<c): #beta1 condition beta13=-a+b*b/float(a) if beta13%c==0: for e in ed_vals: for d in ed_vals: #gamma1 and gamma2 conditions g13 = -d+b*d/float(a) -e*beta13/float(c) g23 = c*d/float(a)-e-b*e/float(a) if g13%f==0 and g23%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) b += a return spHNFs
def base_ortho_23(n): """Finds the symmetry preserving HNFs for the base centered orthorhombic lattices with a determinant of n. Assuming A = [[-0.3333333, -1.54116 , 1.87449 ], [ 1. , 1. , 1. ], [ 2. , -1. , -1. ]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f%a==0: if c%2==0: bs = [0,c//2.] else: bs = [0] if f%2==0: es = [0,f//2.] else: es = [0] for b in bs: if b*f%(a*c)==0: for e in es: if b*e%(a*c)==0 and 2*b*e%(c*f)==0 and e%a==0: for d in range(0,f,a): b13 = -b+b*d/float(a) g13 = -a+d*d/float(a)-b13*e/float(c) g23 = e+d*e/float(a)-b*e*e/float(a*c) if b13%c==0 and g13%f==0 and g23%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def stet_21(n): """Finds the symmetry preserving HNFs for the simple tetragonal lattices with a determinant of n in Niggli setting 21. Assuming A = [[0,0,0.5],[1,0,0],[0,1,0]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f % c == 0: if c % 2 == 0: bs = [0, c / 2] else: bs = [0] for b in bs: if f % 2 == 0: #This condition reached by inspection es = [0, f / 2] else: es = [0] for d in es: b13 = b - d if b13 % c == 0: for e in es: g12 = 2 * d - 2 * d * e / float(c) g13 = -b + d - b13 * e / float(c) g23 = -c + e * e / float(c) if g12 % f == 0 and g13 % f == 0 and g23 % f == 0: HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def sm_33(n): """Finds the symmetry preserving HNFs for the simple monoclinic lattices with a determinant of n. Assuming A = [[2,0,0],[0,2,0],[0.5,0,2]]. Args: n (int): The determinant of the HNFs. Returns: srHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) srHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #beta1 condition if c % 2 == 0: bs = [0, c / 2] else: bs = [0] #gamma2 condition if f % 2 == 0: es = [0, f / 2] else: es = [0] for b in bs: for e in es: #gamma1 condition and gamma1 condition gamma12 = 2 * b * e / float(c) if gamma12 % f == 0: for d in range(f): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] srHNFs.append(HNF) return srHNFs
def body_ortho_8(n): """Finds the symmetry preserving HNFs for the body centered orthorhombic lattices with niggli setting 8 a determinant of n. Assuming A = [[ 1.41144 , 0.0885622, -2. ], [-0.99868 , 2.21232 , 1.268178 ], [ 3.41012 , -1.1237578, -1.268178 ]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if 2*f%c==0: if c%2==0: bs = [0,c//2.] else: bs = [0] for b in bs: for e in range(f): b21 = 2*e g21 = -b21+b21*e/float(c) if b21%c==0 and g21%f==0: for d in range(f): b11 = -a+2*b-2*d g11 = -b11*e/float(c) g13 = a+2*d-b21*b/float(c) if b11%c==0 and g11%f==0 and g13%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def base_mono_10_14_17_27_37_39_41(n): """Finds the symmetry preserving HNFs for the base centered monoclinic lattices with a determinant of n. Assuming: for basis 10 A = [[1, -1, 1],[-1.46391, 0, 1.96391],[0, 2, 0]], for basis 14 A = [[-1,1,0],[0.5,0,2],[0,-2,0]], for basis 17 A = [[-1.05387,-1.61088,1.51474],[-0.244302,-2.77045,0.51474],[1.809568,-0.15957,0.0]] for basis 27 A = [[-1.464824,0.464824,1.907413],[-0.153209,0.153209,-2.907413],[1.0,1.0,0.0]], for basis 37 A = [[-1.79092,-1.47209,0.790922],[1.0,-1.41421,-1.0],[1.0,0.0,1.0]], for basis 39 A = [[0, -1.73205,-1],[-1.66542, -0.672857, 1.66542], [1,0,1]], for basis 41 A = [[-1.85397, -0.854143, 1.35397],[1, 0, 1],[1, -1.41421, -1]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #gamma 2 if f % 2 == 0: es = [0, f // 2] else: es = [0] for e in es: for d in range(f): g11 = -a + 2 * d if g11 % f == 0: for b in range(c): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def body_ortho_42(n): """Finds the symmetry preserving HNFs for the body centered orthorhombic lattices with niggli setting 42 a determinant of n. Assuming A = [[-1.53633, 1.36706, -1.33073], [ 1. , 1. , 1. ], [ 1.61803, -0.61803, -1. ]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f%2==0: es = [0,f//2] else: es = [0] for e in es: for b in range(c): b11 = -a+2*b g12 = -b11*e/float(c) if b11%c==0 and g12%f==0: for d in range(f): g11 = -a+2*d-b11*e/float(c) g13 = -a+2*d if g11%f==0 and g13%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def bcc_5(n): """Finds the symmetry preserving HNFs for the base centered cubic lattices with a determinant of n. Assuming A = [[-1,1,1],[1,-1,1],[1,1,-1]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if a==c and a==f: b = 0 d = 0 e = 0 HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) elif a==c and f/float(a)==2: b = 0 d = a e = a HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) elif a==c and f/float(a)==4: b=0 d= 3*a e = 3*a HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def face_ortho_26(n): """Finds the symmetry preserving HNFs for the face centered orthorhombic lattices with a determinant of n. Assuming A = [[0,1,1.5],[0.5,0,1.5],[0,0,3]] (10th basis choince in notes/body_centered_ortho). Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #beta1 candition if c%2==0: bs = [0,c/2] else: bs = [0] for b in bs: for e in range(f): #gamma2 condition and gamma1 condition gamma23 = c+2*e gamma12 = b+2*b*e/float(c) if gamma23%f==0 and gamma12%f==0: for d in range(f): #gamma1 condition gamma13 = a+b+2*d if gamma13%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def base_mono_20_25(n): """Finds the symmetry preserving HNFs for the base centered monoclinic lattices with a determinant of n. Assuming for basis 20 A = [[ 1. , 1. , 1. ], [ 1.70119 , -1.45119 , 1. ], [ 0.69779 , -1.4322505, 3.23446 ]], for basis 25 A = [[ 1. , 1. , 1. ], [ 1.45119, -1.70119, -1. ], [ 0.28878, -3.26895, 0.48018]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if c % 2 == 0: bs = [0, c // 2.] else: bs = [0] for e in range(f): g22 = -c - 2 * e if g22 % f == 0: for b in bs: g12 = -b - 2 * b * e / float(c) if g12 % f == 0: for d in range(f): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def so_32(n): """Finds the symmetry preserving HNFs for the simple orthorhombic lattices with a determinant of n. Assuming A = [[1,0,0],[0,2,0],[0,0,3]]. Args: n (int): The determinant of the HNFs. Returns: srHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) srHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #beta1 condition if c % 2 == 0: bs = [0, c / 2] else: bs = [0] #gamma1 and gamma2 condition if f % 2 == 0: ed_vals = [0, f / 2] else: ed_vals = [0] for b in bs: for e in ed_vals: #gamma1 condition if (2 * b * e) % (f * c) == 0: for d in ed_vals: HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] srHNFs.append(HNF) return srHNFs
def sm_34(n): """Finds the symmetry preserving HNFs for the simple monoclinic lattices with a determinant of n. Assuming A = [[1,1,1],[1.22474487,-1.22474487,-1],[-0.16598509,-1.64308297,1.80906806]]. Args: n (int): The determinant of the HNFs. Returns: srHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) srHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #gamma1 condition if f % 2 == 0: ds = [0, f / 2] else: ds = [0] #gamma2 condition if f % 2 == 0: es = [0, f / 2] else: es = [0] for d in ds: for e in es: for b in range(c): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] srHNFs.append(HNF) return srHNFs
def face_ortho_16(n): """Finds the symmetry preserving HNFs for the face centered orthorhombic lattices with a niggli cell of 26 and a determinant of n. Assuming A = [[1.04442, 1.43973, 1.68415], [0.779796, -1.1789, 1.0 ], [1.779796, -0.1789, 0]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs=[] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #beta 1 condition if c%2==0: bs = [c/2,0] else: bs = [0] #gamma 1 condition for b in bs: for e in range(f): g11=-b-2*b*e/float(c) g21=c+2*e if g11%f==0 and g21%f==0: for d in range(f): g12=a+2*d-(2*b*e)/float(c) if g12%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def base_ortho_40(n): """Finds the symmetry preserving HNFs for the base centered orthorhombic lattices with a determinant of n. Assuming A = [[ 1. , 1. , 1. ], [ 1.61803 , -0.618034, -1. ], [-1.05557 , 1.99895 , -0.943376]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f%c==0: for e in range(0,f,c): g22 = 2*e-e*e/float(c) if g22%f==0: for d in range(0,f,c): g12 = 2*d-d*e/float(c) if g12%f==0: for b in range(c): b13 = 2*b-d g13 = b13*e/float(c) if b13%c==0 and g13%f==0: HNF = [[a,0,0],[b,c,0],[d,e,f]] spHNFs.append(HNF) return spHNFs
def sm_35(n): """Finds the symmetry preserving HNFs for the simple monoclinic lattices with a determinant of n. Assuming A =[[-0.668912,1.96676,-1.29785], [1.61803,-0.618034,-1.0],[1.0,1.0,1.0]] Args: n (int): The determinant of the HNFs. Returns: srHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) srHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] #gamme12 and gamma22 if f % 2 == 0: ds = [0, f / 2] es = [0, f / 2] else: ds = [0] es = [0] for e in es: for d in ds: for b in range(c): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] srHNFs.append(HNF) return srHNFs
def base_mono_29_30(n): """Finds the symmetry preserving HNFs for the base centered monoclinic lattices with a determinant of n. Assuming for basis 29 A = [[-0.666125, 1.16613 , 2.04852 ], [ 1. , 1. , 0. ], [ 1.61803 , -0.618034, 1. ]], for basis 30 A = [[ 1. , 1. , 0. ], [ 1.61803 , -0.618034 , 1. ], [-0.0361373, 0.536137 , 2.38982 ]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f % c == 0: for e in range(0, f, c): g21 = 2 * e + e * e / float(c) if g21 % f == 0: for d in range(0, f, c): g11 = 2 * d + d * e / float(c) if g11 % f == 0: for b in range(c): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def base_mono_43(n): """Finds the symmetry preserving HNFs for the base centered monoclinic lattices with a determinant of n. Assuming A = [[-0.39716, -0.34718, 2.49434], [ 2.64194, -0.14194, 0. ], [-1.39716, -1.34718, 1.49434]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f % c == 0: for e in range(0, f, c): g22 = 2 * e - e * e / float(c) if g22 % f == 0: for d in range(f): b12 = a + d g12 = 2 * a + 2 * d - b12 * e / float(c) if b12 % c == 0 and g12 % f == 0: for b in range(c): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def base_mono_28(n): """Finds the symmetry preserving HNFs for the base centered monoclinic lattices with a determinant of n. Assuming A = [[-1.44896 , 0.948958, -1. ], [-1. , -1. , 0. ], [ 0.342424, -1.342424, -2.02006 ]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f % c == 0: for e in range(0, f, c): g21 = 2 * e + e * e / float(c) if g21 % f == 0: for d in range(0, f, c): g11 = 2 * d + d * e / float(c) if g11 % f == 0: for b in range(c): HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs
def hex_22(n): """Finds the symmetry preserving HNFs for the hexagonal lattices with a determinant of n. Assuming A = [[0,0,-0.5],[1,0,0],[-0.5,0.8660254037844386,0]]. Args: n (int): The determinant of the HNFs. Returns: spHNFs (list of lists): The symmetry preserving HNFs. """ from opf_python.universal import get_HNF_diagonals diags = get_HNF_diagonals(n) spHNFs = [] for diag in diags: a = diag[0] c = diag[1] f = diag[2] if f % c == 0: for e in range(0, f, c): g21 = -c + 2 * e g22 = -c + e - e * e / float(c) if g21 % f == 0 and g22 % f == 0 and e % c == 0: for b in range(c): for d in range(0, f, c): g11 = -b + 2 * d g12 = -b + d - d * e / float(c) if g11 % f == 0 and g12 % f == 0: HNF = [[a, 0, 0], [b, c, 0], [d, e, f]] spHNFs.append(HNF) return spHNFs