This commit is contained in:
2026-01-14 13:20:06 +08:00
parent 4986a0d617
commit 752fc921a5
3 changed files with 23 additions and 2 deletions

View File

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

View File

@@ -6,6 +6,27 @@ def test():
current_version = guan.get_current_version('guan')
print(f'Congratulations on successfully installing Guan package! The installed version is guan-{current_version}.')
# 基本常数
def fundamental_constants():
constants = {}
constants['c'] = 2.99792458e8 # 真空光速,单位:m/s(米每秒)
constants['h'] = 6.62607015e-34 # 普朗克常数,单位:J·s(焦耳·秒)
constants['hbar'] = 1.054571817e-34 # 约化普朗克常数 ħ = h / (2π),单位:J·s(焦耳·秒)
constants['q'] = 1.602176634e-19 # 基本电荷(元电荷),单位:C(库仑)
constants['eV'] = 1.602176634e-19 # 1 电子伏特(eV)对应的焦耳值,即 1 eV = q J
constants['k'] = 1.380649e-23 # 玻尔兹曼常数,单位:J/K(焦耳每开尔文)
constants['NA'] = 6.02214076e23 # 阿伏伽德罗常数,单位:mol⁻¹(每摩尔的粒子数)
constants['G'] = 6.67430e-11 # 万有引力常数,单位:m³/(kg·s²)
constants['mu0'] = 1.25663706212e-6 # 真空磁导率 μ₀ ≈ 4π × 10⁻⁷,单位:H/m(亨利每米)
constants['eps0'] = 8.8541878128e-12 # 真空介电常数 ε₀ = 1 / (μ₀ c²),单位:F/m(法拉每米)
constants['me'] = 9.1093837015e-31 # 电子静止质量,单位:kg(千克)
constants['mp'] = 1.67262192595e-27 # 质子静止质量,单位:kg(千克)
constants['mn'] = 1.67492749804e-27 # 中子静止质量,单位:kg(千克)
constants['alpha'] = 7.2973525693e-3 # 精细结构常数 α = e² / (4π ε₀ ħ c) ≈ 1/137,无量纲
constants['a0'] = 5.29177210903e-11 # 玻尔半径,单位:m
constants['T0'] = 273.15 # 标准温度参考点(0°C 对应的开尔文温度偏移),单位:K(开尔文)
return constants
# 泡利矩阵
def sigma_0():
import numpy as np