@@ -0,0 +1,981 @@
+from pymatgen.io.vasp import Poscar%0A# from pymatgen import *%0Afrom numpy import pi%0Afrom numpy import arccos, dot  # pi%0Afrom numpy.linalg import norm%0Aimport numpy as np%0A%0Ayourfile = input('Choose a file: ')%0Ap = Poscar.from_file(yourfile)%0A%0A%0A# Fe1 = p.structure.frac_coords%5B2%5D%0A# print(Fe1)%0A# O1_Fe = p.structure.frac_coords%5B9%5D%0A# print(O1_Fe)%0A# O2_Fe = p.structure.frac_coords%5B8%5D%0A# print(O2_Fe)%0A# a = Fe1 - O1_Fe%0A# b = Fe1 - O2_Fe%0A#%0A#%0A# theta_rad = arccos(dot(a,b)/(norm(a)*norm(b)))  #in radians%0A# #print(theta_rad)%0A# theta_deg = theta_rad*180./pi%0A# print(theta_deg)%0A%0Alattice_vector_R = p.structure.lattice.matrix%0Aprint(lattice_vector_R)%0Alattice_a = lattice_vector_R%5B0%5D%5B0%5D%0Alattice_c = lattice_vector_R%5B2%5D%5B2%5D%0Aca_ratio = lattice_c/lattice_a%0A# print(lattice_a)%0A# print(lattice_c)%0Aprint(ca_ratio)%0A%0A# high_symmetry= np.array(%5B0.5, 0.5, 0.5%5D)%0A# relative_disp_frac = Fe1-high_symmetry%5B0%5D%0A# relative_disp_cart = relative_disp_frac%5B1%5D*lattice_c_hexagonal%0A# print(relative_disp_cart,' angstrom')%0A

determine c/a for BaTiO3