0.1.174
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -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)) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user