Expand description
§use-quantum
Small quantum physics scalar helpers for RustUse.
§Install
[dependencies]
use-quantum = "0.0.1"§Foundation
use-quantum provides small quantum physics scalar helpers for photon energy, matter waves,
uncertainty estimates, simple Bohr-model relations, and quantum number validation.
Inputs are expected to be SI-style numeric values unless a function name explicitly says electron volts.
The crate keeps only a few local convenience constants. Broader physical constants belong in the
top-level use-constants set. Unit abstractions belong in use-units. Wave abstractions belong
in use-wave. Particle classification belongs in use-particle.
§Example
use use_quantum::{Photon, QuantumNumbers, RYDBERG_ENERGY_EV, hydrogen_energy_level_ev};
let photon = Photon::from_wavelength(500.0e-9).ok_or("expected valid wavelength")?;
let quantum_numbers = QuantumNumbers::new(2, 1, 0, 1).ok_or("expected valid quantum numbers")?;
assert!(photon.energy_joules() > 0.0);
assert_eq!(quantum_numbers.spin_projection(), 0.5);
assert_eq!(hydrogen_energy_level_ev(1), Some(-RYDBERG_ENERGY_EV));§When to use directly
Choose use-quantum when you only need small reusable scalar quantum formulas or validation
helpers.
§Scope
- APIs stay
f64-first and unit-agnostic. - This crate is not a quantum simulator, quantum computing library, Hilbert-space library, matrix mechanics library, optics system, wave system, unit system, or full atomic physics package.
- General constants belong in
use-constants. - Unit abstractions belong in
use-units. - Wave abstractions belong in
use-wave. - Particle classification belongs in
use-particle.
§Status
use-quantum is a pre-1.0 crate with a deliberately small scalar API.
Small quantum physics scalar helpers.
Modules§
Structs§
- Matter
Wave - A lightweight matter-wave wrapper stored by momentum magnitude.
- Photon
- A lightweight photon wrapper stored by energy in joules.
- Quantum
Numbers - Quantum numbers for a single-electron atomic-state style validation helper.
Constants§
- BOHR_
RADIUS - Bohr radius
a0, in meters. - ELECTRON_
MASS - Electron rest mass, in kilograms.
- ELEMENTARY_
CHARGE - Elementary charge, in coulombs.
- PLANCK_
CONSTANT - Planck constant
h, in joule seconds. - REDUCED_
PLANCK_ CONSTANT - Reduced Planck constant
hbar, in joule seconds. - RYDBERG_
ENERGY_ EV - Hydrogen Rydberg energy magnitude, in electron volts.
- SPEED_
OF_ LIGHT - Speed of light in vacuum, in meters per second.
Functions§
- angular_
frequency_ from_ energy - Computes angular frequency from energy using
omega = E / hbar. - bohr_
orbit_ radius - Computes the hydrogen-like Bohr orbit radius for
Z = 1usingr_n = a0 * n^2. - de_
broglie_ wavelength - Computes de Broglie wavelength from momentum magnitude using
lambda = h / p. - de_
broglie_ wavelength_ from_ mass_ velocity - Computes de Broglie wavelength from mass and velocity using
lambda = h / (m * |v|). - electron_
volts_ to_ joules - Converts electron volts to joules using
J = eV * e. - energy_
from_ angular_ frequency - Computes energy from angular frequency using
E = hbar * omega. - frequency_
from_ photon_ energy - Computes frequency from photon energy using
f = E / h. - hydrogen_
energy_ level_ ev - Computes the hydrogen energy level in electron volts using
E_n = -Ry / n^2. - hydrogen_
transition_ energy_ ev - Computes the absolute transition energy between two hydrogen energy levels in electron volts.
- hydrogen_
transition_ wavelength - Computes the photon wavelength for a hydrogen transition in meters.
- is_
valid_ azimuthal_ quantum_ number - Returns
truewhenn >= 1andl < n. - is_
valid_ magnetic_ quantum_ number - Returns
truewhen-l <= m_l <= l. - is_
valid_ principal_ quantum_ number - Returns
truewhenn >= 1. - is_
valid_ quantum_ numbers - Returns
truewhen the supplied quantum-number combination is valid. - is_
valid_ spin_ twice - Returns
truewhen the spin projection is one of-1or1. - joules_
to_ electron_ volts - Converts joules to electron volts using
eV = J / e. - minimum_
energy_ uncertainty - Computes the minimum energy uncertainty estimate from
delta E >= hbar / (2 * delta t). - minimum_
momentum_ uncertainty - Computes the minimum momentum uncertainty estimate from
delta p >= hbar / (2 * delta x). - minimum_
position_ uncertainty - Computes the minimum position uncertainty estimate from
delta x >= hbar / (2 * delta p). - minimum_
time_ uncertainty - Computes the minimum time uncertainty estimate from
delta t >= hbar / (2 * delta E). - momentum_
from_ de_ broglie_ wavelength - Computes momentum magnitude from a de Broglie wavelength using
p = h / lambda. - photon_
energy_ from_ frequency - Computes photon energy from frequency using
E = h * f. - photon_
energy_ from_ wavelength - Computes photon energy from wavelength using
E = h * c / lambda. - photon_
momentum_ from_ energy - Computes photon momentum from energy using
p = E / c. - photon_
momentum_ from_ wavelength - Computes photon momentum from wavelength using
p = h / lambda. - wavelength_
from_ photon_ energy - Computes wavelength from photon energy using
lambda = h * c / E.