From 69ba5d6213c229a21a9b3c412861405bbacb9109 Mon Sep 17 00:00:00 2001 From: guanjihuan <34735497+guanjihuan@users.noreply.github.com> Date: Fri, 27 Aug 2021 22:54:57 +0800 Subject: [PATCH] version 0.0.19 --- PyPI/setup.cfg | 2 +- PyPI/src/guan/calculate_reciprocal_lattice_vectors.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index 509dccb..256fc98 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.0.18 +version = 0.0.19 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan/calculate_reciprocal_lattice_vectors.py b/PyPI/src/guan/calculate_reciprocal_lattice_vectors.py index fb25225..f33c740 100644 --- a/PyPI/src/guan/calculate_reciprocal_lattice_vectors.py +++ b/PyPI/src/guan/calculate_reciprocal_lattice_vectors.py @@ -3,7 +3,6 @@ # calculate reciprocal lattice vectors import numpy as np -import sympy from math import * def calculate_one_dimensional_reciprocal_lattice_vector(a1): @@ -32,10 +31,12 @@ def calculate_three_dimensional_reciprocal_lattice_vectors(a1, a2, a3): return b1, b2, b3 def calculate_one_dimensional_reciprocal_lattice_vector_with_sympy(a1): + import sympy b1 = 2*sympy.pi/a1 return b1 def calculate_two_dimensional_reciprocal_lattice_vectors_with_sympy(a1, a2): + import sympy a1 = sympy.Matrix(1, 3, [a1[0], a1[1], 0]) a2 = sympy.Matrix(1, 3, [a2[0], a2[1], 0]) a3 = sympy.Matrix(1, 3, [0, 0, 1]) @@ -48,6 +49,7 @@ def calculate_two_dimensional_reciprocal_lattice_vectors_with_sympy(a1, a2): return b1, b2 def calculate_three_dimensional_reciprocal_lattice_vectors_with_sympy(a1, a2, a3): + import sympy cross_a2_a3 = a2.cross(a3) cross_a3_a1 = a3.cross(a1) cross_a1_a2 = a1.cross(a2)