0.1.174
This commit is contained in:
		| @@ -1,7 +1,7 @@ | |||||||
| [metadata] | [metadata] | ||||||
| # replace with your username: | # replace with your username: | ||||||
| name = guan | name = guan | ||||||
| version = 0.1.173 | version = 0.1.174 | ||||||
| author = guanjihuan | author = guanjihuan | ||||||
| author_email = guanjihuan@163.com | author_email = guanjihuan@163.com | ||||||
| description = An open source python package | description = An open source python package | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| Metadata-Version: 2.4 | Metadata-Version: 2.4 | ||||||
| Name: guan | Name: guan | ||||||
| Version: 0.1.173 | Version: 0.1.174 | ||||||
| Summary: An open source python package | Summary: An open source python package | ||||||
| Home-page: https://py.guanjihuan.com | Home-page: https://py.guanjihuan.com | ||||||
| Author: guanjihuan | Author: guanjihuan | ||||||
|   | |||||||
| @@ -67,6 +67,7 @@ def dimension_of_array(array): | |||||||
| # 检查矩阵是否为厄米矩阵(相对误差为1e-5) | # 检查矩阵是否为厄米矩阵(相对误差为1e-5) | ||||||
| def is_hermitian(matrix): | def is_hermitian(matrix): | ||||||
|     import numpy as np |     import numpy as np | ||||||
|  |     matrix = np.array(matrix) | ||||||
|     if matrix.shape[0] != matrix.shape[1]: |     if matrix.shape[0] != matrix.shape[1]: | ||||||
|         return False |         return False | ||||||
|     return np.allclose(matrix, np.conj(matrix.T)) |     return np.allclose(matrix, np.conj(matrix.T)) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user