physicskit#
physicskit is a unified scientific toolkit for computational physics, spanning 14 domains – from stellar dynamics to quantum entanglement – under one NumPy-based API. It’s built for physics students working through a textbook problem, curious learners exploring a topic on their own, and educators building a demonstration: every subpackage is called, tested, and visualized the same way, so moving from classical mechanics to condensed matter to general relativity means picking up new physics, not a new set of conventions. Units stay native to the field instead: \(G=1\) for orbits, \(\hbar=1\) for quantum states, \(k_B=1\) for statistical mechanics, matching how the papers you’re checking against actually write it, rather than forcing everything through SI.
Every subpackage is grounded in the physics it implements, not just coded against it: public functions carry runnable, CI-checked examples, and each subpackage’s history page traces the breakthroughs behind it – from Huygens’ 1690 wave construction to the 2017 GW170817 neutron-star chirp – each one linked to the code that reproduces it. The goal is a toolkit you can trust to move between domains without re-deriving the plumbing every time:
physicskit.astro– stellar structure, N-body dynamics, orbital mechanics, galactic dynamicsphysicskit.chaos– chaotic dynamical systems and 2D quantum billiardsphysicskit.classical– classical (Newtonian/Lagrangian/Hamiltonian) mechanicsphysicskit.condensed– tight-binding models, topological band theory, superconductivityphysicskit.fields– electrodynamics (FDTD), solitons, BEC vortex latticesphysicskit.fluids– potential flow, viscous flow, vortex dynamics, instabilities, compressible flow, Navier-Stokesphysicskit.optics– ray/wave/Gaussian-beam optics, Wigner functions, Jaynes-Cummings dynamicsphysicskit.particle– relativistic kinematics, two-body decays, scattering, nuclear physicsphysicskit.plasma– single-particle motion, magnetohydrodynamics, cold-plasma waves, kinetic theoryphysicskit.quantum– quantum mechanics: wave packets, potentials, entanglementphysicskit.relativity– numerical general relativity: black holes, lensing, gravitational wavesphysicskit.rmt– random matrix theory, organized around Dyson’s threefold wayphysicskit.semiclassical– WKB/EBK quantization, semiclassical propagators, the Gutzwiller trace formula, and quantum scarringphysicskit.statphys– statistical mechanics: lattice models, molecular dynamics, criticality
Conventionally imported as pk:
import physicskit as pk
import numpy as np
H = lambda k1, k2: pk.condensed.haldane_model(k1, k2, phi=np.pi / 2)
chern_numbers = pk.condensed.compute_chern_number(H, grid_size=30)
print(chern_numbers) # [1, -1]