UnitfulAtomic.jl
An extension of Unitful.jl for working with atomic units
Install / Use
/learn @sostock/UnitfulAtomic.jlREADME
UnitfulAtomic
This package extends the Unitful.jl package to facilitate working with atomic units.
Functions
This package provides three functions that enable easy conversion from and to Hartree atomic units:
aunit(x)returns the appropriate atomic unit forx, wherexcan be aUnitful.Quantity,Unitful.Units, orUnitful.Dimensions:julia> aunit(2.3u"cm") a₀ julia> aunit(u"T") ħ a₀^-2 e^-1auconvertcan be used to convert from and to atomic units. It has two methods:auconvert(x::Unitful.Quantity)converts a quantity to the appropriate atomic unit:julia> auconvert(13.6u"eV") 0.499790781587053 Eₕ julia> auconvert(20u"nm") 377.94522492515404 a₀auconvert(u::Unitful.Units, x::Number)interpretsxas a quantity in atomic units and converts it to the unitu:julia> auconvert(u"eV", 1) # convert 1 Eₕ to eV 27.211386246088992 eV julia> auconvert(u"m", 1) # convert 1 a₀ to m 5.29177210903e-11 m
austrip(x::Unitful.Quantity)converts a quantity to the appropriate atomic unit and then strips the units. This is equivalent toUnitful.ustrip(auconvert(x)):julia> austrip(13.6u"eV") 0.499790781587053 julia> austrip(20u"nm") 377.94522492515404
Defined units
The package defines the following atomic units (suffixed with _au), from which all other
atomic units are derived:
me_au(printed asmₑ): the electron rest mass.e_au(printed ase): the elementary charge.ħ_au(printed asħ): the reduced Planck constant.k_au(printed ask): the Boltzmann constant.a0_au(printed asa₀): the Bohr radius. The aliasbohrcan be used instead ofa0_au.Eh_au(printed asEₕ): the Hartree energy. The aliashartreecan be used instead ofEh_au.
Furthermore, this package defines some units that are not atomic units, but are common in atomic physics:
Ry: the Rydberg energyRy = h*c*R∞ = Eₕ/2, see Rydberg constant.μ_N: the nuclear magneton.
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
