This commit is contained in:
guanjihuan 2025-03-24 17:49:26 +08:00
parent 0de9394118
commit 83601c45af
3 changed files with 3 additions and 2 deletions

View File

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

View File

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

View File

@ -67,6 +67,7 @@ def dimension_of_array(array):
# 检查矩阵是否为厄米矩阵相对误差为1e-5)
def is_hermitian(matrix):
import numpy as np
matrix = np.array(matrix)
if matrix.shape[0] != matrix.shape[1]:
return False
return np.allclose(matrix, np.conj(matrix.T))