This commit is contained in:
guanjihuan 2025-03-02 19:49:50 +08:00
parent 4d87f89519
commit 9ddb69dc61
3 changed files with 18 additions and 2 deletions

View File

@ -1,7 +1,7 @@
[metadata]
# replace with your username:
name = guan
version = 0.1.159
version = 0.1.160
author = guanjihuan
author_email = guanjihuan@163.com
description = An open source python package

View File

@ -1,6 +1,6 @@
Metadata-Version: 2.2
Name: guan
Version: 0.1.159
Version: 0.1.160
Summary: An open source python package
Home-page: https://py.guanjihuan.com
Author: guanjihuan

View File

@ -9,6 +9,22 @@ def get_coordinate_array_from_atom_object_list(atom_object_list):
coordinate_array.append([x, y])
return coordinate_array
# 从原子对象列表中获取 x 和 y 的最大值和最小值
def get_max_min_x_y_from_atom_object_list(atom_object_list):
import guan
coordinate_array = guan.get_coordinate_array_from_atom_object_list(atom_object_list)
x_array = []
for coordinate in coordinate_array:
x_array.append(coordinate[0])
y_array = []
for coordinate in coordinate_array:
y_array.append(coordinate[1])
max_x = max(x_array)
min_x = min(x_array)
max_y = max(y_array)
min_y = min(y_array)
return max_x, min_x, max_y, min_y
# 根据原子对象列表来初始化哈密顿量
def initialize_hamiltonian_from_atom_object_list(atom_object_list):
import numpy as np