physicskit 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- physicskit-0.3.0/LICENSE +21 -0
- physicskit-0.3.0/PKG-INFO +298 -0
- physicskit-0.3.0/README.md +239 -0
- physicskit-0.3.0/physicskit/__init__.py +61 -0
- physicskit-0.3.0/physicskit/astro/__init__.py +66 -0
- physicskit-0.3.0/physicskit/astro/cosmic_web.py +395 -0
- physicskit-0.3.0/physicskit/astro/galactic_dynamics.py +137 -0
- physicskit-0.3.0/physicskit/astro/nbody.py +208 -0
- physicskit-0.3.0/physicskit/astro/orbital_mechanics.py +220 -0
- physicskit-0.3.0/physicskit/astro/stellar_dynamo.py +628 -0
- physicskit-0.3.0/physicskit/astro/stellar_structure.py +216 -0
- physicskit-0.3.0/physicskit/astro/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/astro/tests/conftest.py +7 -0
- physicskit-0.3.0/physicskit/astro/tests/test_cosmic_web.py +159 -0
- physicskit-0.3.0/physicskit/astro/tests/test_galactic_dynamics.py +46 -0
- physicskit-0.3.0/physicskit/astro/tests/test_nbody.py +81 -0
- physicskit-0.3.0/physicskit/astro/tests/test_orbital_mechanics.py +73 -0
- physicskit-0.3.0/physicskit/astro/tests/test_stellar_dynamo.py +198 -0
- physicskit-0.3.0/physicskit/astro/tests/test_stellar_structure.py +69 -0
- physicskit-0.3.0/physicskit/astro/tests/test_visualizers.py +159 -0
- physicskit-0.3.0/physicskit/astro/visualizers.py +628 -0
- physicskit-0.3.0/physicskit/chaos/__init__.py +58 -0
- physicskit-0.3.0/physicskit/chaos/core/__init__.py +3 -0
- physicskit-0.3.0/physicskit/chaos/core/base_system.py +342 -0
- physicskit-0.3.0/physicskit/chaos/core/integrators.py +40 -0
- physicskit-0.3.0/physicskit/chaos/exceptions.py +24 -0
- physicskit-0.3.0/physicskit/chaos/quantum/__init__.py +38 -0
- physicskit-0.3.0/physicskit/chaos/quantum/billiards.py +274 -0
- physicskit-0.3.0/physicskit/chaos/quantum/husimi.py +88 -0
- physicskit-0.3.0/physicskit/chaos/quantum/maps.py +368 -0
- physicskit-0.3.0/physicskit/chaos/systems/__init__.py +40 -0
- physicskit-0.3.0/physicskit/chaos/systems/billiards.py +1131 -0
- physicskit-0.3.0/physicskit/chaos/systems/continuous.py +1522 -0
- physicskit-0.3.0/physicskit/chaos/systems/maps.py +823 -0
- physicskit-0.3.0/physicskit/chaos/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/chaos/tests/conftest.py +16 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_basins.py +76 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_bifurcation.py +132 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_billiards.py +115 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_continuous.py +293 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_dimension.py +69 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_divergence.py +91 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_dynamic_plots.py +291 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_integrators.py +96 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_io.py +41 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_maps.py +169 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_metrics.py +115 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_phase_space.py +73 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_properties.py +116 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_quantum_billiards.py +94 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_quantum_maps.py +157 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_recurrence.py +51 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_repr_and_api_consistency.py +135 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_section.py +49 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_spectral.py +48 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_streamlit_app.py +45 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_timeseries.py +131 -0
- physicskit-0.3.0/physicskit/chaos/tests/test_viewer3d.py +41 -0
- physicskit-0.3.0/physicskit/chaos/utils/__init__.py +46 -0
- physicskit-0.3.0/physicskit/chaos/utils/dimension.py +139 -0
- physicskit-0.3.0/physicskit/chaos/utils/io.py +95 -0
- physicskit-0.3.0/physicskit/chaos/utils/metrics.py +304 -0
- physicskit-0.3.0/physicskit/chaos/utils/recurrence.py +122 -0
- physicskit-0.3.0/physicskit/chaos/utils/spectral.py +69 -0
- physicskit-0.3.0/physicskit/chaos/utils/timeseries.py +303 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/__init__.py +87 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/basins.py +186 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/bifurcation.py +273 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/divergence.py +374 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/dynamic_plots.py +1498 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/phase_space.py +133 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/quantum.py +299 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/recurrence.py +91 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/section.py +161 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/theme.py +31 -0
- physicskit-0.3.0/physicskit/chaos/visualizers/viewer3d.py +82 -0
- physicskit-0.3.0/physicskit/classical/__init__.py +55 -0
- physicskit-0.3.0/physicskit/classical/core/__init__.py +17 -0
- physicskit-0.3.0/physicskit/classical/core/base_system.py +510 -0
- physicskit-0.3.0/physicskit/classical/core/integrators.py +397 -0
- physicskit-0.3.0/physicskit/classical/systems/__init__.py +32 -0
- physicskit-0.3.0/physicskit/classical/systems/chains.py +338 -0
- physicskit-0.3.0/physicskit/classical/systems/hamiltonian.py +215 -0
- physicskit-0.3.0/physicskit/classical/systems/lagrangian.py +308 -0
- physicskit-0.3.0/physicskit/classical/systems/newtonian.py +536 -0
- physicskit-0.3.0/physicskit/classical/systems/rotations.py +614 -0
- physicskit-0.3.0/physicskit/classical/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/classical/tests/conftest.py +7 -0
- physicskit-0.3.0/physicskit/classical/tests/test_base_system.py +113 -0
- physicskit-0.3.0/physicskit/classical/tests/test_chains.py +84 -0
- physicskit-0.3.0/physicskit/classical/tests/test_conservation.py +244 -0
- physicskit-0.3.0/physicskit/classical/tests/test_conservation_utils.py +47 -0
- physicskit-0.3.0/physicskit/classical/tests/test_hamiltonian.py +44 -0
- physicskit-0.3.0/physicskit/classical/tests/test_integrators.py +123 -0
- physicskit-0.3.0/physicskit/classical/tests/test_lagrangian.py +69 -0
- physicskit-0.3.0/physicskit/classical/tests/test_newtonian.py +45 -0
- physicskit-0.3.0/physicskit/classical/tests/test_rotations.py +160 -0
- physicskit-0.3.0/physicskit/classical/tests/test_stepsize.py +149 -0
- physicskit-0.3.0/physicskit/classical/tests/test_symbolic.py +125 -0
- physicskit-0.3.0/physicskit/classical/tests/test_visualizers.py +172 -0
- physicskit-0.3.0/physicskit/classical/utils/__init__.py +20 -0
- physicskit-0.3.0/physicskit/classical/utils/conservation.py +126 -0
- physicskit-0.3.0/physicskit/classical/utils/stepsize.py +187 -0
- physicskit-0.3.0/physicskit/classical/utils/symbolic.py +235 -0
- physicskit-0.3.0/physicskit/classical/visualizers/__init__.py +25 -0
- physicskit-0.3.0/physicskit/classical/visualizers/animations.py +512 -0
- physicskit-0.3.0/physicskit/classical/visualizers/interactive.py +113 -0
- physicskit-0.3.0/physicskit/classical/visualizers/modal_analysis.py +97 -0
- physicskit-0.3.0/physicskit/classical/visualizers/phase_space.py +214 -0
- physicskit-0.3.0/physicskit/condensed/__init__.py +182 -0
- physicskit-0.3.0/physicskit/condensed/anderson_localization.py +155 -0
- physicskit-0.3.0/physicskit/condensed/correlated.py +284 -0
- physicskit-0.3.0/physicskit/condensed/ginzburg_landau.py +220 -0
- physicskit-0.3.0/physicskit/condensed/landau_levels.py +246 -0
- physicskit-0.3.0/physicskit/condensed/laughlin.py +239 -0
- physicskit-0.3.0/physicskit/condensed/models.py +633 -0
- physicskit-0.3.0/physicskit/condensed/phonons.py +318 -0
- physicskit-0.3.0/physicskit/condensed/spin_chains.py +651 -0
- physicskit-0.3.0/physicskit/condensed/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/condensed/tests/test_condensed.py +520 -0
- physicskit-0.3.0/physicskit/condensed/tests/test_phonons.py +112 -0
- physicskit-0.3.0/physicskit/condensed/tests/test_spin_chains.py +173 -0
- physicskit-0.3.0/physicskit/condensed/tests/test_transport.py +92 -0
- physicskit-0.3.0/physicskit/condensed/tests/test_visualizers.py +87 -0
- physicskit-0.3.0/physicskit/condensed/tight_binding.py +445 -0
- physicskit-0.3.0/physicskit/condensed/topological_insulator_3d.py +178 -0
- physicskit-0.3.0/physicskit/condensed/topology.py +217 -0
- physicskit-0.3.0/physicskit/condensed/transport.py +302 -0
- physicskit-0.3.0/physicskit/condensed/visualizers.py +296 -0
- physicskit-0.3.0/physicskit/condensed/weyl.py +180 -0
- physicskit-0.3.0/physicskit/constants.py +186 -0
- physicskit-0.3.0/physicskit/fields/__init__.py +160 -0
- physicskit-0.3.0/physicskit/fields/electrodynamics.py +677 -0
- physicskit-0.3.0/physicskit/fields/electrostatics.py +807 -0
- physicskit-0.3.0/physicskit/fields/magnetostatics.py +351 -0
- physicskit-0.3.0/physicskit/fields/quantum_fields.py +510 -0
- physicskit-0.3.0/physicskit/fields/solitons.py +527 -0
- physicskit-0.3.0/physicskit/fields/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/fields/tests/conftest.py +7 -0
- physicskit-0.3.0/physicskit/fields/tests/test_electrostatics.py +297 -0
- physicskit-0.3.0/physicskit/fields/tests/test_field_animations.py +154 -0
- physicskit-0.3.0/physicskit/fields/tests/test_fields.py +451 -0
- physicskit-0.3.0/physicskit/fields/tests/test_magnetostatics.py +90 -0
- physicskit-0.3.0/physicskit/fields/tests/test_visualizers.py +101 -0
- physicskit-0.3.0/physicskit/fields/visualizers.py +503 -0
- physicskit-0.3.0/physicskit/fluids/__init__.py +207 -0
- physicskit-0.3.0/physicskit/fluids/core/__init__.py +23 -0
- physicskit-0.3.0/physicskit/fluids/core/grid.py +165 -0
- physicskit-0.3.0/physicskit/fluids/core/timestepping.py +231 -0
- physicskit-0.3.0/physicskit/fluids/exceptions.py +26 -0
- physicskit-0.3.0/physicskit/fluids/systems/__init__.py +130 -0
- physicskit-0.3.0/physicskit/fluids/systems/acoustics.py +415 -0
- physicskit-0.3.0/physicskit/fluids/systems/compressible_flow.py +284 -0
- physicskit-0.3.0/physicskit/fluids/systems/elasticity.py +484 -0
- physicskit-0.3.0/physicskit/fluids/systems/heat_equation.py +309 -0
- physicskit-0.3.0/physicskit/fluids/systems/instabilities.py +343 -0
- physicskit-0.3.0/physicskit/fluids/systems/lattice_boltzmann.py +295 -0
- physicskit-0.3.0/physicskit/fluids/systems/navier_stokes.py +221 -0
- physicskit-0.3.0/physicskit/fluids/systems/potential_flow.py +444 -0
- physicskit-0.3.0/physicskit/fluids/systems/viscous_flow.py +425 -0
- physicskit-0.3.0/physicskit/fluids/systems/vortex_dynamics.py +307 -0
- physicskit-0.3.0/physicskit/fluids/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/fluids/tests/conftest.py +7 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_acoustics.py +85 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_compressible_flow.py +77 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_elasticity.py +119 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_heat_equation.py +78 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_instabilities.py +115 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_lattice_boltzmann.py +109 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_navier_stokes.py +67 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_potential_flow.py +92 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_static_visualizers.py +91 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_utils.py +111 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_viscous_flow.py +110 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_visualizers.py +34 -0
- physicskit-0.3.0/physicskit/fluids/tests/test_vortex_dynamics.py +101 -0
- physicskit-0.3.0/physicskit/fluids/utils/__init__.py +18 -0
- physicskit-0.3.0/physicskit/fluids/utils/dimensionless.py +239 -0
- physicskit-0.3.0/physicskit/fluids/utils/spectral_analysis.py +145 -0
- physicskit-0.3.0/physicskit/fluids/visualizers/__init__.py +14 -0
- physicskit-0.3.0/physicskit/fluids/visualizers/compressible.py +39 -0
- physicskit-0.3.0/physicskit/fluids/visualizers/flow_fields.py +252 -0
- physicskit-0.3.0/physicskit/fluids/visualizers/potential_flow.py +51 -0
- physicskit-0.3.0/physicskit/fluids/visualizers/spectra.py +62 -0
- physicskit-0.3.0/physicskit/fluids/visualizers/theme.py +38 -0
- physicskit-0.3.0/physicskit/integrators/__init__.py +73 -0
- physicskit-0.3.0/physicskit/integrators/adaptive.py +229 -0
- physicskit-0.3.0/physicskit/integrators/fixed_step.py +372 -0
- physicskit-0.3.0/physicskit/integrators/stochastic.py +475 -0
- physicskit-0.3.0/physicskit/integrators/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/integrators/tests/test_integrators.py +143 -0
- physicskit-0.3.0/physicskit/integrators/tests/test_stochastic.py +155 -0
- physicskit-0.3.0/physicskit/io.py +221 -0
- physicskit-0.3.0/physicskit/optics/__init__.py +131 -0
- physicskit-0.3.0/physicskit/optics/_compat.py +5 -0
- physicskit-0.3.0/physicskit/optics/gaussian.py +382 -0
- physicskit-0.3.0/physicskit/optics/lasers.py +331 -0
- physicskit-0.3.0/physicskit/optics/quantum_optics.py +428 -0
- physicskit-0.3.0/physicskit/optics/ray.py +472 -0
- physicskit-0.3.0/physicskit/optics/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/optics/tests/test_diffraction_animation.py +38 -0
- physicskit-0.3.0/physicskit/optics/tests/test_gaussian.py +170 -0
- physicskit-0.3.0/physicskit/optics/tests/test_lasers.py +123 -0
- physicskit-0.3.0/physicskit/optics/tests/test_quantum_optics.py +160 -0
- physicskit-0.3.0/physicskit/optics/tests/test_ray.py +177 -0
- physicskit-0.3.0/physicskit/optics/tests/test_visualizers.py +59 -0
- physicskit-0.3.0/physicskit/optics/tests/test_wave.py +146 -0
- physicskit-0.3.0/physicskit/optics/visualizers.py +278 -0
- physicskit-0.3.0/physicskit/optics/wave.py +365 -0
- physicskit-0.3.0/physicskit/particle/__init__.py +166 -0
- physicskit-0.3.0/physicskit/particle/collider.py +384 -0
- physicskit-0.3.0/physicskit/particle/confinement.py +125 -0
- physicskit-0.3.0/physicskit/particle/decays.py +357 -0
- physicskit-0.3.0/physicskit/particle/electroweak.py +300 -0
- physicskit-0.3.0/physicskit/particle/kinematics.py +271 -0
- physicskit-0.3.0/physicskit/particle/lattice_gauge.py +359 -0
- physicskit-0.3.0/physicskit/particle/neutrinos.py +84 -0
- physicskit-0.3.0/physicskit/particle/nuclear.py +100 -0
- physicskit-0.3.0/physicskit/particle/scattering.py +159 -0
- physicskit-0.3.0/physicskit/particle/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/particle/tests/conftest.py +7 -0
- physicskit-0.3.0/physicskit/particle/tests/test_collider.py +135 -0
- physicskit-0.3.0/physicskit/particle/tests/test_confinement.py +42 -0
- physicskit-0.3.0/physicskit/particle/tests/test_decays.py +112 -0
- physicskit-0.3.0/physicskit/particle/tests/test_electroweak.py +97 -0
- physicskit-0.3.0/physicskit/particle/tests/test_kinematics.py +138 -0
- physicskit-0.3.0/physicskit/particle/tests/test_lattice_gauge.py +80 -0
- physicskit-0.3.0/physicskit/particle/tests/test_neutrinos.py +36 -0
- physicskit-0.3.0/physicskit/particle/tests/test_nuclear.py +45 -0
- physicskit-0.3.0/physicskit/particle/tests/test_scattering.py +64 -0
- physicskit-0.3.0/physicskit/particle/tests/test_visualizers.py +214 -0
- physicskit-0.3.0/physicskit/particle/visualizers/__init__.py +38 -0
- physicskit-0.3.0/physicskit/particle/visualizers/animations.py +705 -0
- physicskit-0.3.0/physicskit/particle/visualizers/static.py +101 -0
- physicskit-0.3.0/physicskit/plasma/__init__.py +176 -0
- physicskit-0.3.0/physicskit/plasma/acceleration.py +152 -0
- physicskit-0.3.0/physicskit/plasma/instabilities.py +421 -0
- physicskit-0.3.0/physicskit/plasma/kinetic.py +589 -0
- physicskit-0.3.0/physicskit/plasma/mhd.py +463 -0
- physicskit-0.3.0/physicskit/plasma/single_particle.py +562 -0
- physicskit-0.3.0/physicskit/plasma/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/plasma/tests/conftest.py +7 -0
- physicskit-0.3.0/physicskit/plasma/tests/test_new_time_domain_features.py +222 -0
- physicskit-0.3.0/physicskit/plasma/tests/test_plasma.py +232 -0
- physicskit-0.3.0/physicskit/plasma/tests/test_visualizers.py +79 -0
- physicskit-0.3.0/physicskit/plasma/turbulence.py +221 -0
- physicskit-0.3.0/physicskit/plasma/visualizers.py +868 -0
- physicskit-0.3.0/physicskit/plasma/waves.py +549 -0
- physicskit-0.3.0/physicskit/py.typed +0 -0
- physicskit-0.3.0/physicskit/quantum/__init__.py +281 -0
- physicskit-0.3.0/physicskit/quantum/_compat.py +20 -0
- physicskit-0.3.0/physicskit/quantum/chapters/__init__.py +0 -0
- physicskit-0.3.0/physicskit/quantum/chapters/entanglement.py +489 -0
- physicskit-0.3.0/physicskit/quantum/chapters/harmonic_spin.py +528 -0
- physicskit-0.3.0/physicskit/quantum/chapters/hartree_fock.py +430 -0
- physicskit-0.3.0/physicskit/quantum/chapters/hydrogen_am.py +292 -0
- physicskit-0.3.0/physicskit/quantum/chapters/open_systems.py +652 -0
- physicskit-0.3.0/physicskit/quantum/chapters/perturbation.py +350 -0
- physicskit-0.3.0/physicskit/quantum/chapters/potentials.py +1008 -0
- physicskit-0.3.0/physicskit/quantum/chapters/relativistic.py +426 -0
- physicskit-0.3.0/physicskit/quantum/chapters/scattering.py +390 -0
- physicskit-0.3.0/physicskit/quantum/chapters/spin.py +306 -0
- physicskit-0.3.0/physicskit/quantum/chapters/wave_packets.py +545 -0
- physicskit-0.3.0/physicskit/quantum/core/__init__.py +0 -0
- physicskit-0.3.0/physicskit/quantum/core/eigensolvers.py +311 -0
- physicskit-0.3.0/physicskit/quantum/core/operators.py +296 -0
- physicskit-0.3.0/physicskit/quantum/core/solvers.py +271 -0
- physicskit-0.3.0/physicskit/quantum/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/quantum/tests/conftest.py +7 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_animations.py +239 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_compat.py +43 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_eigensolvers.py +24 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_entanglement.py +126 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_harmonic_spin.py +152 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_hartree_fock.py +119 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_hydrogen_am.py +48 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_measure.py +110 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_open_systems.py +152 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_operators.py +105 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_perturbation.py +134 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_physics_checks.py +131 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_potentials.py +190 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_relativistic.py +139 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_scattering.py +101 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_solvers.py +70 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_spin.py +22 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_unitarity.py +84 -0
- physicskit-0.3.0/physicskit/quantum/tests/test_wave_packets.py +65 -0
- physicskit-0.3.0/physicskit/quantum/utils/__init__.py +0 -0
- physicskit-0.3.0/physicskit/quantum/utils/measure.py +253 -0
- physicskit-0.3.0/physicskit/quantum/visualizers/__init__.py +0 -0
- physicskit-0.3.0/physicskit/quantum/visualizers/bloch_sphere.py +205 -0
- physicskit-0.3.0/physicskit/quantum/visualizers/entanglement.py +58 -0
- physicskit-0.3.0/physicskit/quantum/visualizers/orbitals.py +187 -0
- physicskit-0.3.0/physicskit/quantum/visualizers/phase_space.py +179 -0
- physicskit-0.3.0/physicskit/quantum/visualizers/wavefunctions.py +230 -0
- physicskit-0.3.0/physicskit/relativity/__init__.py +61 -0
- physicskit-0.3.0/physicskit/relativity/chapters/__init__.py +33 -0
- physicskit-0.3.0/physicskit/relativity/chapters/cosmology.py +223 -0
- physicskit-0.3.0/physicskit/relativity/chapters/gw_merger.py +399 -0
- physicskit-0.3.0/physicskit/relativity/chapters/kerr.py +375 -0
- physicskit-0.3.0/physicskit/relativity/chapters/lensing.py +196 -0
- physicskit-0.3.0/physicskit/relativity/chapters/neutron_star.py +149 -0
- physicskit-0.3.0/physicskit/relativity/chapters/schwarzschild.py +412 -0
- physicskit-0.3.0/physicskit/relativity/chapters/timekeeping.py +133 -0
- physicskit-0.3.0/physicskit/relativity/core/__init__.py +12 -0
- physicskit-0.3.0/physicskit/relativity/core/geodesics.py +216 -0
- physicskit-0.3.0/physicskit/relativity/core/kerr_raytracer.py +259 -0
- physicskit-0.3.0/physicskit/relativity/core/raytracer.py +241 -0
- physicskit-0.3.0/physicskit/relativity/core/tensors.py +468 -0
- physicskit-0.3.0/physicskit/relativity/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/relativity/tests/conftest.py +16 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_conservations.py +54 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_constants.py +34 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_cosmology.py +72 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_gw_merger.py +117 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_kerr.py +128 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_kerr_raytracer.py +103 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_lensing.py +75 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_neutron_star.py +48 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_raytracer.py +67 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_schwarzschild.py +126 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_shadow_render.py +81 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_tensors.py +86 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_timekeeping.py +51 -0
- physicskit-0.3.0/physicskit/relativity/tests/test_visualizers_misc.py +130 -0
- physicskit-0.3.0/physicskit/relativity/utils/__init__.py +1 -0
- physicskit-0.3.0/physicskit/relativity/utils/constants.py +232 -0
- physicskit-0.3.0/physicskit/relativity/visualizers/__init__.py +46 -0
- physicskit-0.3.0/physicskit/relativity/visualizers/interactive.py +127 -0
- physicskit-0.3.0/physicskit/relativity/visualizers/shadow_render.py +367 -0
- physicskit-0.3.0/physicskit/relativity/visualizers/spacetime_3d.py +92 -0
- physicskit-0.3.0/physicskit/relativity/visualizers/spacetime_diagrams.py +198 -0
- physicskit-0.3.0/physicskit/relativity/visualizers/wave_plots.py +185 -0
- physicskit-0.3.0/physicskit/results.py +467 -0
- physicskit-0.3.0/physicskit/rmt/__init__.py +8 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/__init__.py +108 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/banded.py +118 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/base.py +137 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/bdg.py +218 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/chiral.py +311 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/circular.py +104 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/crossover.py +84 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/density_matrix.py +151 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/effective_hamiltonian.py +233 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/embedded.py +210 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/gaussian.py +155 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/ginibre.py +110 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/girko.py +198 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/graph_laplacian.py +95 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/haar.py +57 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/jacobi.py +184 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/poisson.py +77 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/polynomial.py +143 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/pt_symmetric.py +122 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/single_ring.py +175 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/sparse.py +95 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/syk.py +178 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/truncated_unitary.py +82 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/universality.py +96 -0
- physicskit-0.3.0/physicskit/rmt/ensembles/wishart.py +90 -0
- physicskit-0.3.0/physicskit/rmt/py.typed +0 -0
- physicskit-0.3.0/physicskit/rmt/spectrum.py +82 -0
- physicskit-0.3.0/physicskit/rmt/stats/__init__.py +160 -0
- physicskit-0.3.0/physicskit/rmt/stats/characteristic_polynomial.py +77 -0
- physicskit-0.3.0/physicskit/rmt/stats/circular_law.py +54 -0
- physicskit-0.3.0/physicskit/rmt/stats/correlations.py +162 -0
- physicskit-0.3.0/physicskit/rmt/stats/density.py +70 -0
- physicskit-0.3.0/physicskit/rmt/stats/entanglement.py +36 -0
- physicskit-0.3.0/physicskit/rmt/stats/free_probability.py +202 -0
- physicskit-0.3.0/physicskit/rmt/stats/localization.py +344 -0
- physicskit-0.3.0/physicskit/rmt/stats/marchenko_pastur.py +55 -0
- physicskit-0.3.0/physicskit/rmt/stats/pt_symmetric.py +265 -0
- physicskit-0.3.0/physicskit/rmt/stats/ratios.py +110 -0
- physicskit-0.3.0/physicskit/rmt/stats/real_ginibre.py +136 -0
- physicskit-0.3.0/physicskit/rmt/stats/rigidity.py +274 -0
- physicskit-0.3.0/physicskit/rmt/stats/single_ring.py +95 -0
- physicskit-0.3.0/physicskit/rmt/stats/spacing.py +150 -0
- physicskit-0.3.0/physicskit/rmt/stats/tracy_widom.py +176 -0
- physicskit-0.3.0/physicskit/rmt/stats/truncated_unitary.py +40 -0
- physicskit-0.3.0/physicskit/rmt/stats/unfolding.py +37 -0
- physicskit-0.3.0/physicskit/rmt/stats/wachter.py +67 -0
- physicskit-0.3.0/physicskit/rmt/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/rmt/tests/cache_utils.py +107 -0
- physicskit-0.3.0/physicskit/rmt/tests/conftest.py +8 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_banded.py +86 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_base.py +29 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_bdg.py +133 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_characteristic_polynomial.py +50 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_chiral.py +273 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_circular.py +225 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_crossover.py +72 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_density.py +23 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_density_matrix.py +181 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_effective_hamiltonian.py +140 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_embedded.py +169 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_free_probability.py +81 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_gaussian_ensembles.py +22 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_gaussian_semicircle.py +127 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_ginibre_circular_law.py +131 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_girko.py +178 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_graph_laplacian.py +102 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_haar.py +118 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_jacobi_wachter.py +136 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_localization.py +240 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_poisson.py +149 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_polynomial.py +107 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_pt_symmetric.py +178 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_random_state.py +19 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_real_ginibre.py +112 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_rigidity_universality.py +167 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_single_ring.py +132 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_spacing_and_ratios.py +122 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_sparse.py +71 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_spectrum.py +27 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_syk.py +136 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_tracy_widom.py +127 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_tridiagonal.py +41 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_truncated_unitary.py +80 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_validation_base.py +25 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_validation_misc.py +80 -0
- physicskit-0.3.0/physicskit/rmt/tests/test_wishart_marchenko_pastur.py +120 -0
- physicskit-0.3.0/physicskit/rmt/utils/__init__.py +0 -0
- physicskit-0.3.0/physicskit/rmt/utils/haar.py +133 -0
- physicskit-0.3.0/physicskit/rmt/utils/random_state.py +24 -0
- physicskit-0.3.0/physicskit/rmt/utils/tridiagonal.py +170 -0
- physicskit-0.3.0/physicskit/rmt/validation/__init__.py +36 -0
- physicskit-0.3.0/physicskit/rmt/validation/base.py +126 -0
- physicskit-0.3.0/physicskit/rmt/validation/circular_law.py +80 -0
- physicskit-0.3.0/physicskit/rmt/validation/marchenko_pastur.py +53 -0
- physicskit-0.3.0/physicskit/rmt/validation/ratio_distribution.py +53 -0
- physicskit-0.3.0/physicskit/rmt/validation/real_ginibre.py +60 -0
- physicskit-0.3.0/physicskit/rmt/validation/sine_kernel.py +57 -0
- physicskit-0.3.0/physicskit/rmt/validation/single_ring.py +76 -0
- physicskit-0.3.0/physicskit/rmt/validation/tracy_widom.py +89 -0
- physicskit-0.3.0/physicskit/rmt/validation/universality.py +122 -0
- physicskit-0.3.0/physicskit/rmt/validation/wachter.py +52 -0
- physicskit-0.3.0/physicskit/rmt/validation/wigner_semicircle.py +40 -0
- physicskit-0.3.0/physicskit/rmt/validation/wigner_surmise.py +58 -0
- physicskit-0.3.0/physicskit/semiclassical/__init__.py +94 -0
- physicskit-0.3.0/physicskit/semiclassical/_compat.py +5 -0
- physicskit-0.3.0/physicskit/semiclassical/core/__init__.py +41 -0
- physicskit-0.3.0/physicskit/semiclassical/core/gutzwiller.py +215 -0
- physicskit-0.3.0/physicskit/semiclassical/core/path_integral.py +598 -0
- physicskit-0.3.0/physicskit/semiclassical/core/propagators.py +585 -0
- physicskit-0.3.0/physicskit/semiclassical/core/wkb.py +308 -0
- physicskit-0.3.0/physicskit/semiclassical/systems/__init__.py +13 -0
- physicskit-0.3.0/physicskit/semiclassical/systems/scarring.py +278 -0
- physicskit-0.3.0/physicskit/semiclassical/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/semiclassical/tests/test_gutzwiller.py +35 -0
- physicskit-0.3.0/physicskit/semiclassical/tests/test_path_integral.py +199 -0
- physicskit-0.3.0/physicskit/semiclassical/tests/test_propagators.py +109 -0
- physicskit-0.3.0/physicskit/semiclassical/tests/test_scarring.py +43 -0
- physicskit-0.3.0/physicskit/semiclassical/tests/test_visualizers.py +89 -0
- physicskit-0.3.0/physicskit/semiclassical/tests/test_wkb.py +30 -0
- physicskit-0.3.0/physicskit/semiclassical/visualizers/__init__.py +17 -0
- physicskit-0.3.0/physicskit/semiclassical/visualizers/gutzwiller.py +55 -0
- physicskit-0.3.0/physicskit/semiclassical/visualizers/path_integral.py +195 -0
- physicskit-0.3.0/physicskit/semiclassical/visualizers/propagators.py +89 -0
- physicskit-0.3.0/physicskit/semiclassical/visualizers/scarring.py +146 -0
- physicskit-0.3.0/physicskit/semiclassical/visualizers/wkb.py +55 -0
- physicskit-0.3.0/physicskit/statphys/__init__.py +98 -0
- physicskit-0.3.0/physicskit/statphys/chapters/__init__.py +49 -0
- physicskit-0.3.0/physicskit/statphys/chapters/ehrenfest_urn.py +112 -0
- physicskit-0.3.0/physicskit/statphys/chapters/ising_lattice.py +431 -0
- physicskit-0.3.0/physicskit/statphys/chapters/kpz_growth.py +129 -0
- physicskit-0.3.0/physicskit/statphys/chapters/langevin.py +633 -0
- physicskit-0.3.0/physicskit/statphys/chapters/molecular_dynamics.py +264 -0
- physicskit-0.3.0/physicskit/statphys/chapters/nonequilibrium_work.py +146 -0
- physicskit-0.3.0/physicskit/statphys/chapters/percolation.py +305 -0
- physicskit-0.3.0/physicskit/statphys/chapters/random_walk.py +142 -0
- physicskit-0.3.0/physicskit/statphys/chapters/renormalization.py +148 -0
- physicskit-0.3.0/physicskit/statphys/chapters/sandpile.py +109 -0
- physicskit-0.3.0/physicskit/statphys/chapters/spin_glass.py +275 -0
- physicskit-0.3.0/physicskit/statphys/core/__init__.py +10 -0
- physicskit-0.3.0/physicskit/statphys/core/kpz_engine.py +53 -0
- physicskit-0.3.0/physicskit/statphys/core/md_engine.py +157 -0
- physicskit-0.3.0/physicskit/statphys/core/monte_carlo.py +462 -0
- physicskit-0.3.0/physicskit/statphys/core/random_walk_engine.py +68 -0
- physicskit-0.3.0/physicskit/statphys/core/sandpile_engine.py +52 -0
- physicskit-0.3.0/physicskit/statphys/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_dynamics.py +66 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_ehrenfest_urn.py +44 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_finite_size_scaling.py +62 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_fokker_planck.py +82 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_interactive.py +33 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_ising.py +68 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_kpz.py +55 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_landau_theory.py +49 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_langevin.py +119 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_md_engine.py +31 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_molecular_dynamics.py +72 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_nonequilibrium_work.py +33 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_partition_function.py +26 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_percolation.py +145 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_potts_model.py +46 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_random_walk.py +50 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_renormalization.py +44 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_sandpile.py +44 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_spin_glass.py +73 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_thermodynamics.py +121 -0
- physicskit-0.3.0/physicskit/statphys/tests/test_xy_model.py +45 -0
- physicskit-0.3.0/physicskit/statphys/utils/__init__.py +1 -0
- physicskit-0.3.0/physicskit/statphys/utils/dynamics.py +103 -0
- physicskit-0.3.0/physicskit/statphys/utils/finite_size_scaling.py +171 -0
- physicskit-0.3.0/physicskit/statphys/utils/fokker_planck.py +208 -0
- physicskit-0.3.0/physicskit/statphys/utils/landau_theory.py +152 -0
- physicskit-0.3.0/physicskit/statphys/utils/partition_function.py +109 -0
- physicskit-0.3.0/physicskit/statphys/utils/thermodynamics.py +360 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/__init__.py +87 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/interactive.py +161 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/jarzynski_render.py +44 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/kpz_render.py +65 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/lattice_render.py +212 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/particle_render.py +121 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/random_walk_render.py +106 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/rg_render.py +45 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/sandpile_render.py +65 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/spin_glass_render.py +40 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/urn_render.py +38 -0
- physicskit-0.3.0/physicskit/statphys/visualizers/vortex_render.py +84 -0
- physicskit-0.3.0/physicskit/tests/__init__.py +0 -0
- physicskit-0.3.0/physicskit/tests/test_constants.py +38 -0
- physicskit-0.3.0/physicskit/tests/test_io.py +162 -0
- physicskit-0.3.0/physicskit/tests/test_package.py +18 -0
- physicskit-0.3.0/physicskit/tests/test_results.py +216 -0
- physicskit-0.3.0/physicskit/tests/test_units.py +247 -0
- physicskit-0.3.0/physicskit/units.py +761 -0
- physicskit-0.3.0/physicskit.egg-info/PKG-INFO +298 -0
- physicskit-0.3.0/physicskit.egg-info/SOURCES.txt +533 -0
- physicskit-0.3.0/physicskit.egg-info/dependency_links.txt +1 -0
- physicskit-0.3.0/physicskit.egg-info/requires.txt +37 -0
- physicskit-0.3.0/physicskit.egg-info/top_level.txt +1 -0
- physicskit-0.3.0/pyproject.toml +209 -0
- physicskit-0.3.0/setup.cfg +4 -0
physicskit-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 physicskit contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: physicskit
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Unified scientific toolkit for computational physics: General Relativity, Quantum Mechanics, Chaos, Random Matrix Theory, Statistical Mechanics, Classical Dynamics, and Condensed Matter.
|
|
5
|
+
Author-email: Charles Poli <cpoli374@gmail.com>
|
|
6
|
+
Maintainer-email: Charles Poli <cpoli374@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/cpoli/physicskit
|
|
9
|
+
Project-URL: Issues, https://github.com/cpoli/physicskit/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/cpoli/physicskit/blob/main/CHANGELOG.md
|
|
11
|
+
Project-URL: Documentation, https://cpoli.github.io/physicskit/
|
|
12
|
+
Keywords: physics,condensed-matter,general-relativity,quantum-mechanics,chaos,random-matrix-theory,statistical-mechanics,classical-mechanics
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
|
+
Classifier: Typing :: Typed
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: numpy>=1.24
|
|
28
|
+
Requires-Dist: scipy>=1.10
|
|
29
|
+
Requires-Dist: matplotlib>=3.6
|
|
30
|
+
Requires-Dist: numba>=0.58
|
|
31
|
+
Requires-Dist: plotly>=5.15
|
|
32
|
+
Requires-Dist: sympy>=1.11
|
|
33
|
+
Requires-Dist: tqdm>=4.65
|
|
34
|
+
Provides-Extra: test
|
|
35
|
+
Requires-Dist: pytest>=7.0; extra == "test"
|
|
36
|
+
Requires-Dist: pytest-cov; extra == "test"
|
|
37
|
+
Requires-Dist: pytest-xdist>=3.0; extra == "test"
|
|
38
|
+
Requires-Dist: hypothesis>=6.90; extra == "test"
|
|
39
|
+
Requires-Dist: pillow>=9.0; extra == "test"
|
|
40
|
+
Provides-Extra: docs
|
|
41
|
+
Requires-Dist: sphinx>=7.0; extra == "docs"
|
|
42
|
+
Requires-Dist: pydata-sphinx-theme>=0.15; extra == "docs"
|
|
43
|
+
Requires-Dist: sphinx-autodoc-typehints>=1.25; extra == "docs"
|
|
44
|
+
Requires-Dist: myst-parser>=2.0; extra == "docs"
|
|
45
|
+
Requires-Dist: sphinx-gallery>=0.15; extra == "docs"
|
|
46
|
+
Requires-Dist: sphinx-design>=0.6; extra == "docs"
|
|
47
|
+
Provides-Extra: units
|
|
48
|
+
Requires-Dist: pint>=0.23; extra == "units"
|
|
49
|
+
Provides-Extra: hdf5
|
|
50
|
+
Requires-Dist: h5py>=3.8; extra == "hdf5"
|
|
51
|
+
Provides-Extra: bench
|
|
52
|
+
Requires-Dist: pytest-benchmark>=4.0; extra == "bench"
|
|
53
|
+
Provides-Extra: dev
|
|
54
|
+
Requires-Dist: physicskit[bench,docs,hdf5,test,units]; extra == "dev"
|
|
55
|
+
Requires-Dist: ruff>=0.6; extra == "dev"
|
|
56
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
57
|
+
Requires-Dist: pre-commit>=3.7; extra == "dev"
|
|
58
|
+
Dynamic: license-file
|
|
59
|
+
|
|
60
|
+
# physicskit
|
|
61
|
+
|
|
62
|
+
| | |
|
|
63
|
+
|:--|:-:|
|
|
64
|
+
| Package | [](https://pypi.org/project/physicskit/) [](https://pypi.org/project/physicskit/) |
|
|
65
|
+
| Quality | [](https://github.com/cpoli/physicskit/blob/main/LICENSE) [](https://github.com/cpoli/physicskit/actions/workflows/ci.yml) [](https://codecov.io/gh/cpoli/physicskit) [](#coverage) |
|
|
66
|
+
| Documentation | [](https://cpoli.github.io/physicskit/) |
|
|
67
|
+
| Code style | [](https://github.com/astral-sh/ruff) |
|
|
68
|
+
| Downloads | [](https://pepy.tech/project/physicskit) [](https://pepy.tech/project/physicskit) |
|
|
69
|
+
| Community | [](https://github.com/cpoli/physicskit) [](https://github.com/cpoli/physicskit) [](https://github.com/cpoli/physicskit/graphs/contributors) [](https://github.com/cpoli/physicskit/commits/main) |
|
|
70
|
+
|
|
71
|
+
**Watch the laws of physics play out.**
|
|
72
|
+
physicskit is a Python toolkit for learning and teaching computational
|
|
73
|
+
physics, spanning the field end to end: the quantum mechanics of a single
|
|
74
|
+
hydrogen atom, the numerical relativity of colliding black holes, turbulent
|
|
75
|
+
fluid instabilities, topological insulators, magnetically confined plasmas,
|
|
76
|
+
and chaotic quantum billiards. Every simulation keeps its full trajectory,
|
|
77
|
+
every domain ships plotting and animation helpers, and each domain's docs
|
|
78
|
+
walk through the field's breakthroughs in historical order, each one linked
|
|
79
|
+
to runnable code that reproduces it.
|
|
80
|
+
|
|
81
|
+

|
|
82
|
+
|
|
83
|
+
- **For students:** send a wave packet through a double slit, watch edge
|
|
84
|
+
states cross a topological band gap, trace light around a black hole,
|
|
85
|
+
all in a few lines each.
|
|
86
|
+
- **For instructors:** 14 domains, one consistent API, and over 300
|
|
87
|
+
gallery examples, each downloadable as a Python script or Jupyter
|
|
88
|
+
notebook, ready to hand out as course material.
|
|
89
|
+
- **Built on numpy/scipy:** library routines under the hood, numba-compiled
|
|
90
|
+
inner loops where the physics is time-stepped, and algorithms hand-rolled
|
|
91
|
+
only where the steps themselves are what you're learning (see
|
|
92
|
+
[Design](#design)).
|
|
93
|
+
|
|
94
|
+
physicskit is part of a family of packages -- **physicskit**,
|
|
95
|
+
[mathematicskit](https://github.com/cpoli/mathematicskit) and
|
|
96
|
+
[chemistrykit](https://github.com/cpoli/chemistrykit) -- that share the
|
|
97
|
+
same architecture, API conventions, and history-driven documentation.
|
|
98
|
+
For tight-binding models beyond `physicskit.condensed` -- arbitrary
|
|
99
|
+
finite lattices, ribbons and defects, non-Hermitian bands, Landauer
|
|
100
|
+
transport, and the kernel polynomial method for very large samples --
|
|
101
|
+
see the dedicated package [tbkit](https://github.com/cpoli/tbkit).
|
|
102
|
+
|
|
103
|
+
## Install
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
pip install physicskit
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Then `import physicskit as pk`. Runtime dependencies are numpy, scipy,
|
|
110
|
+
matplotlib, [numba](https://numba.pydata.org/) (which compiles the shared
|
|
111
|
+
integrators and the time-stepping loops of `chaos`, `classical`, `fluids`,
|
|
112
|
+
`plasma`, `relativity`, and `statphys`), plotly, sympy, and tqdm. The
|
|
113
|
+
interactive 3D viewer in `physicskit.chaos.visualizers.viewer3d`
|
|
114
|
+
additionally needs `pip install pyvista`.
|
|
115
|
+
|
|
116
|
+
For development: `pip install -e ".[dev]"` (see [CONTRIBUTING.md](CONTRIBUTING.md)).
|
|
117
|
+
|
|
118
|
+
## Quick start
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
import numpy as np
|
|
122
|
+
import matplotlib.pyplot as plt
|
|
123
|
+
import physicskit as pk
|
|
124
|
+
|
|
125
|
+
# The Haldane model's two bands carry Chern numbers +1 and -1...
|
|
126
|
+
H = lambda k1, k2: pk.condensed.haldane_model(k1, k2, phi=np.pi / 2)
|
|
127
|
+
print(pk.condensed.compute_chern_number(H, grid_size=30)) # [1, -1]
|
|
128
|
+
|
|
129
|
+
# ...so a finite ribbon has chiral edge states crossing the bulk gap
|
|
130
|
+
bulk = pk.condensed.haldane_lattice_hamiltonian(t2=0.2, phi=np.pi / 2)
|
|
131
|
+
ribbon = pk.condensed.build_ribbon(bulk, open_direction=1, n_cells=20)
|
|
132
|
+
k = np.linspace(0, 2 * np.pi, 200)
|
|
133
|
+
plt.plot(k, [np.linalg.eigvalsh(ribbon([kk])) for kk in k], color="C0", lw=0.8)
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Every subpackage below links to its worked examples, or browse the docs
|
|
137
|
+
at <https://cpoli.github.io/physicskit/>.
|
|
138
|
+
|
|
139
|
+
## Subpackages
|
|
140
|
+
|
|
141
|
+
Domain subpackages, each with runnable examples linked below:
|
|
142
|
+
|
|
143
|
+
- [`physicskit.astro`](https://cpoli.github.io/physicskit/api/gallery/astro/) -- stellar structure (Lane-Emden polytropes, Tolman-Oppenheimer-Volkoff, the Chandrasekhar limit), N-body dynamics with symplectic integrators (including the figure-eight choreography), Keplerian orbital mechanics and Hohmann transfers, galactic rotation curves and NFW dark-matter halos, Zel'dovich cosmic-web formation (`numpy.fft`), and stellar convection with an alpha-omega magnetic dynamo.
|
|
144
|
+
|
|
145
|
+

|
|
146
|
+
|
|
147
|
+
- [`physicskit.chaos`](https://cpoli.github.io/physicskit/api/gallery/chaos/) -- chaotic dynamical systems: continuous flows (Lorenz, Rössler, Duffing, Chua, double and magnetic pendulums), discrete maps (logistic, Hénon, standard, baker's, Smale horseshoe), classical billiards (circle, ellipse, stadium, Sinai), Lyapunov spectra by Benettin's QR method, fractal dimensions and recurrence analysis, and 2D quantum billiards and kicked rotors (numba-compiled flows and maps; quantum billiard eigenstates via `scipy.sparse.linalg.eigsh`).
|
|
148
|
+
|
|
149
|
+

|
|
150
|
+
|
|
151
|
+
- [`physicskit.classical`](https://cpoli.github.io/physicskit/api/gallery/classical/) -- classical mechanics: Newtonian, Lagrangian (with a symbolic equations-of-motion engine), Hamiltonian, lattice, and rigid-body dynamics -- the FPUT recurrence, Hénon-Heiles and KAM tori, the double and elastic pendulums, the Foucault pendulum, and the Dzhanibekov effect, Euler's disk, and the rattleback (numba-compiled symplectic and implicit-midpoint integrators).
|
|
152
|
+
|
|
153
|
+

|
|
154
|
+
|
|
155
|
+
- [`physicskit.condensed`](https://cpoli.github.io/physicskit/api/gallery/condensed/) -- tight-binding models (Bloch bands, Slater-Koster, Peierls substitution and the Hofstadter butterfly), topological band theory (Chern numbers, Zak phase, Z2 invariants, the tenfold way, SSH/Haldane/Kane-Mele/Kitaev/Weyl edge and surface states), Anderson localization, Landau levels and the quantum Hall effects, correlated electrons (BCS, Hubbard, Ginzburg-Landau), exact diagonalization of quantum spin chains (Bethe ansatz, transverse-field Ising, entanglement scaling), phonons and the Debye heat capacity, and Drude/Boltzmann transport (diagonalization via `numpy.linalg.eigh`).
|
|
156
|
+
|
|
157
|
+

|
|
158
|
+
|
|
159
|
+
- [`physicskit.fields`](https://cpoli.github.io/physicskit/api/gallery/fields/) -- electrostatics (Poisson solvers, the method of images, multipole expansions) and Biot-Savart magnetostatics, FDTD electrodynamics on the Yee grid with perfectly matched layers, KdV/NLS/Sine-Gordon solitons (split-step spectral methods via `numpy.fft`), and Gross-Pitaevskii Bose-Einstein condensates with quantized vortices and vortex lattices.
|
|
160
|
+
|
|
161
|
+

|
|
162
|
+
|
|
163
|
+
- [`physicskit.fluids`](https://cpoli.github.io/physicskit/api/gallery/fluids/) -- potential flow (sources, doublets, Kutta-Joukowski lift), viscous exact solutions (Couette, Poiseuille, Blasius, Stokes drag), point-vortex dynamics and the von Kármán street, Kelvin-Helmholtz and Rayleigh-Taylor instabilities, compressible shocks (the Sod shock tube), the 2D incompressible Navier-Stokes solver underlying them (pseudo-spectral via `numpy.fft`, numba-compiled vortex kernels), linear continuum mechanics (heat equation, acoustics, 2D elasticity), and a D2Q9 lattice Boltzmann solver.
|
|
164
|
+
|
|
165
|
+

|
|
166
|
+
|
|
167
|
+
- [`physicskit.optics`](https://cpoli.github.io/physicskit/api/gallery/optics/) -- ray optics and ABCD matrices, Fresnel/Fraunhofer wave optics (`numpy.fft`), Gaussian and Laguerre-Gauss beams (`scipy.special`), and quantum optics (coherent and squeezed states, photon statistics, the Jaynes-Cummings model, Wigner functions), and lasers (rate equations and Maxwell-Bloch dynamics).
|
|
168
|
+
|
|
169
|
+

|
|
170
|
+
|
|
171
|
+
- [`physicskit.particle`](https://cpoli.github.io/physicskit/api/gallery/particle/) -- relativistic kinematics (four-vectors, boosts, Mandelstam variables), particle decays and scattering, detector signatures and resonance searches (from the J/psi to the Higgs), weak interactions and neutrino oscillations, radioactive decay chains, nuclear physics (Rutherford scattering, the semi-empirical mass formula, fission), and U(1) lattice gauge theory with Wilson loops.
|
|
172
|
+
|
|
173
|
+

|
|
174
|
+
|
|
175
|
+
- [`physicskit.plasma`](https://cpoli.github.io/physicskit/api/gallery/plasma/) -- Boris-pusher single-particle motion, guiding-center drifts and magnetic mirrors, Grad-Shafranov MHD equilibrium, magnetic reconnection, cold-plasma wave dispersion and the CMA diagram, particle-in-cell Vlasov-Poisson kinetics (Landau damping, two-stream and Weibel instabilities), and Hasegawa-Mima drift-wave turbulence (numba-compiled particle pushers, spectral field solves via `numpy.fft`).
|
|
176
|
+
|
|
177
|
+

|
|
178
|
+
|
|
179
|
+
- [`physicskit.quantum`](https://cpoli.github.io/physicskit/api/gallery/quantum/) -- quantum mechanics: wave packets (split-operator propagation via `numpy.fft`), potentials and tunneling (matrix Numerov and sparse eigensolvers via `scipy.sparse.linalg.eigsh`), hydrogen and angular momentum, entanglement and Bell inequalities, measurement (Born rule, Stern-Gerlach, the double slit), perturbation and Floquet theory, open systems (Lindblad, quantum trajectories), the Dirac and Klein-Gordon equations, Born and partial-wave scattering, and Hartree-Fock.
|
|
180
|
+
|
|
181
|
+

|
|
182
|
+
|
|
183
|
+
- [`physicskit.relativity`](https://cpoli.github.io/physicskit/api/gallery/relativity/) -- numerical general relativity: Schwarzschild and Kerr geodesics (numba-compiled), ray-traced black hole shadows, gravitational lensing, gravitational waves from binary inspiral to merger and ringdown, neutron stars (TOV), FLRW cosmology, and a numerical curvature engine validated against Einstein's vacuum field equations, with ADM initial data.
|
|
184
|
+
|
|
185
|
+

|
|
186
|
+
|
|
187
|
+
- [`physicskit.rmt`](https://cpoli.github.io/physicskit/api/gallery/rmt/) -- random matrix theory, organized around Dyson's threefold way: Gaussian, circular, Ginibre, Wishart, and Bogoliubov-de Gennes ensembles, with each classic law (semicircle, Wigner surmise, Tracy-Widom, Marchenko-Pastur, circular law, ...) validated against its closed form (`numpy.linalg` eigensolvers, `scipy.stats` Kolmogorov-Smirnov tests).
|
|
188
|
+
|
|
189
|
+

|
|
190
|
+
|
|
191
|
+
- [`physicskit.semiclassical`](https://cpoli.github.io/physicskit/api/gallery/semiclassical/) -- WKB/EBK quantization and Maslov indices, Van Vleck/Herman-Kluk semiclassical propagators, Feynman's path integral and its classical limit, the Gutzwiller and Berry-Tabor trace formulas, and quantum scarring.
|
|
192
|
+
|
|
193
|
+

|
|
194
|
+
|
|
195
|
+
- [`physicskit.statphys`](https://cpoli.github.io/physicskit/api/gallery/statphys/) -- statistical mechanics: Ising, Potts, and XY lattice models (numba-compiled Metropolis and Wolff cluster updates), molecular dynamics, criticality and the renormalization group, percolation, self-organized criticality, KPZ growth, spin glasses, Lee-Yang zeros, nonequilibrium work relations, Langevin/Brownian dynamics, the Ornstein-Uhlenbeck process, and a 1D Fokker-Planck solver.
|
|
196
|
+
|
|
197
|
+

|
|
198
|
+
|
|
199
|
+
Shared infrastructure, used across the subpackages above rather than
|
|
200
|
+
standalone toolkits:
|
|
201
|
+
|
|
202
|
+
- `physicskit.constants` -- SI physical constants shared across subpackages, plus a few well-defined unit conversions (energy/temperature, eV/joules, gravitational G=1 unit systems).
|
|
203
|
+
- `physicskit.integrators` -- shared numerical ODE integrators (RK4, leapfrog, Yoshida4, adaptive Dormand-Prince) and SDE integrators (Euler-Maruyama, Milstein, BAOAB Langevin) used across the other subpackages.
|
|
204
|
+
- `physicskit.units` -- explicit natural-unit systems (G=1, G=c=1, hbar=1, k_B=1, or any combination) with user-chosen scales, SI conversion, and optional pint interop.
|
|
205
|
+
- `physicskit.results` / `physicskit.io` -- a shared, unit-aware `Result` container with adapters for existing subpackage outputs, saved to `.npz` or HDF5.
|
|
206
|
+
|
|
207
|
+
## Design
|
|
208
|
+
|
|
209
|
+
physicskit calls `numpy`/`scipy` directly for anything they already
|
|
210
|
+
implement (FFTs, dense and sparse eigensolvers, quadrature, special
|
|
211
|
+
functions, statistical tests), and hand-rolls an algorithm only where the
|
|
212
|
+
algorithm's own steps are the pedagogical subject (symplectic and Boris
|
|
213
|
+
integrators, particle-in-cell, FDTD, Metropolis and Wolff updates,
|
|
214
|
+
geodesic ray tracing) or where no `numpy`/`scipy` equivalent exists (e.g.
|
|
215
|
+
topological invariants, billiard maps). Time-stepped inner loops are
|
|
216
|
+
numba-compiled, and the ODE integrators are shared across domains. Each
|
|
217
|
+
subpackage computes in its field's natural units (`astro`: G = 1;
|
|
218
|
+
`relativity`: G = c = 1; `quantum`: ħ = 1; `statphys`: k_B = 1), while
|
|
219
|
+
`physicskit.constants` holds the SI values.
|
|
220
|
+
|
|
221
|
+
## Test
|
|
222
|
+
|
|
223
|
+
Tests live alongside each subpackage, at `physicskit/<name>/tests/`.
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
pytest # everything
|
|
227
|
+
pytest physicskit/rmt/tests # a single subpackage
|
|
228
|
+
|
|
229
|
+
# docstring examples, across every subpackage (pyvista's 3D viewer is
|
|
230
|
+
# optional and skipped rather than installed as a hard test dependency):
|
|
231
|
+
MPLBACKEND=Agg pytest --doctest-modules physicskit \
|
|
232
|
+
--ignore-glob="*/tests/*" \
|
|
233
|
+
--ignore=physicskit/chaos/visualizers/viewer3d.py
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Both commands, plus `ruff check`/`ruff format --check`, run in CI on
|
|
237
|
+
every PR (`.github/workflows/ci.yml`) across Python 3.10-3.14 on Linux and
|
|
238
|
+
macOS, as does `mypy` on the typed core (`constants`, `integrators`,
|
|
239
|
+
`units`, `results`, `io`). See [CONTRIBUTING.md](CONTRIBUTING.md) before
|
|
240
|
+
opening a PR.
|
|
241
|
+
|
|
242
|
+
Performance benchmarks for the shared integrators and three representative
|
|
243
|
+
solvers live in [`benchmarks/`](benchmarks/README.md):
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
pip install -e ".[bench]"
|
|
247
|
+
pytest benchmarks
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Coverage
|
|
251
|
+
|
|
252
|
+
```bash
|
|
253
|
+
MPLBACKEND=Agg pytest -q -n auto --cov=physicskit --cov-report=term
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
CI measures coverage on every push and PR and uploads it to
|
|
257
|
+
[Codecov](https://codecov.io/gh/cpoli/physicskit), which drives the badge
|
|
258
|
+
above; the per-file table is also written to each CI run's job summary.
|
|
259
|
+
Modules outside `visualizers/` aim for full line coverage. `visualizers/`
|
|
260
|
+
modules are smoke-tested only (correct return type/shape, or that
|
|
261
|
+
`anim.save()` succeeds) rather than covered line-by-line, per the testing
|
|
262
|
+
convention in [CLAUDE.md](CLAUDE.md), so subpackages with large visualizer
|
|
263
|
+
modules (`chaos`, `quantum`, `statphys`) report lower overall numbers.
|
|
264
|
+
`@njit`-compiled lines are excluded from coverage entirely
|
|
265
|
+
(`pyproject.toml`, `[tool.coverage.report]`) since `coverage.py` cannot
|
|
266
|
+
trace into numba-compiled native code.
|
|
267
|
+
|
|
268
|
+
## Docs
|
|
269
|
+
|
|
270
|
+
Built docs are hosted at <https://cpoli.github.io/physicskit/>, served from
|
|
271
|
+
the `gh-pages` branch. To build locally:
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
pip install -e ".[docs]"
|
|
275
|
+
cd docs && make html
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
See `docs/source/history/` for a chronology of each field's foundational
|
|
279
|
+
breakthroughs, linked to the corresponding implementation at each step.
|
|
280
|
+
The README figures are regenerated with `python docs/make_readme_figure.py`
|
|
281
|
+
and `python docs/make_readme_subpackage_figures.py`.
|
|
282
|
+
|
|
283
|
+
Long-form tutorials, including a "Units and conventions" guide to each
|
|
284
|
+
subpackage's natural units, are in `docs/source/tutorials/`.
|
|
285
|
+
|
|
286
|
+
## Citation
|
|
287
|
+
|
|
288
|
+
If you use physicskit in your research, please cite it — see
|
|
289
|
+
[CITATION.cff](CITATION.cff).
|
|
290
|
+
|
|
291
|
+
## Contributing
|
|
292
|
+
|
|
293
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Please note that this project
|
|
294
|
+
follows the [Contributor Covenant](CODE_OF_CONDUCT.md).
|
|
295
|
+
|
|
296
|
+
## License
|
|
297
|
+
|
|
298
|
+
MIT -- see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# physicskit
|
|
2
|
+
|
|
3
|
+
| | |
|
|
4
|
+
|:--|:-:|
|
|
5
|
+
| Package | [](https://pypi.org/project/physicskit/) [](https://pypi.org/project/physicskit/) |
|
|
6
|
+
| Quality | [](https://github.com/cpoli/physicskit/blob/main/LICENSE) [](https://github.com/cpoli/physicskit/actions/workflows/ci.yml) [](https://codecov.io/gh/cpoli/physicskit) [](#coverage) |
|
|
7
|
+
| Documentation | [](https://cpoli.github.io/physicskit/) |
|
|
8
|
+
| Code style | [](https://github.com/astral-sh/ruff) |
|
|
9
|
+
| Downloads | [](https://pepy.tech/project/physicskit) [](https://pepy.tech/project/physicskit) |
|
|
10
|
+
| Community | [](https://github.com/cpoli/physicskit) [](https://github.com/cpoli/physicskit) [](https://github.com/cpoli/physicskit/graphs/contributors) [](https://github.com/cpoli/physicskit/commits/main) |
|
|
11
|
+
|
|
12
|
+
**Watch the laws of physics play out.**
|
|
13
|
+
physicskit is a Python toolkit for learning and teaching computational
|
|
14
|
+
physics, spanning the field end to end: the quantum mechanics of a single
|
|
15
|
+
hydrogen atom, the numerical relativity of colliding black holes, turbulent
|
|
16
|
+
fluid instabilities, topological insulators, magnetically confined plasmas,
|
|
17
|
+
and chaotic quantum billiards. Every simulation keeps its full trajectory,
|
|
18
|
+
every domain ships plotting and animation helpers, and each domain's docs
|
|
19
|
+
walk through the field's breakthroughs in historical order, each one linked
|
|
20
|
+
to runnable code that reproduces it.
|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
- **For students:** send a wave packet through a double slit, watch edge
|
|
25
|
+
states cross a topological band gap, trace light around a black hole,
|
|
26
|
+
all in a few lines each.
|
|
27
|
+
- **For instructors:** 14 domains, one consistent API, and over 300
|
|
28
|
+
gallery examples, each downloadable as a Python script or Jupyter
|
|
29
|
+
notebook, ready to hand out as course material.
|
|
30
|
+
- **Built on numpy/scipy:** library routines under the hood, numba-compiled
|
|
31
|
+
inner loops where the physics is time-stepped, and algorithms hand-rolled
|
|
32
|
+
only where the steps themselves are what you're learning (see
|
|
33
|
+
[Design](#design)).
|
|
34
|
+
|
|
35
|
+
physicskit is part of a family of packages -- **physicskit**,
|
|
36
|
+
[mathematicskit](https://github.com/cpoli/mathematicskit) and
|
|
37
|
+
[chemistrykit](https://github.com/cpoli/chemistrykit) -- that share the
|
|
38
|
+
same architecture, API conventions, and history-driven documentation.
|
|
39
|
+
For tight-binding models beyond `physicskit.condensed` -- arbitrary
|
|
40
|
+
finite lattices, ribbons and defects, non-Hermitian bands, Landauer
|
|
41
|
+
transport, and the kernel polynomial method for very large samples --
|
|
42
|
+
see the dedicated package [tbkit](https://github.com/cpoli/tbkit).
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install physicskit
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then `import physicskit as pk`. Runtime dependencies are numpy, scipy,
|
|
51
|
+
matplotlib, [numba](https://numba.pydata.org/) (which compiles the shared
|
|
52
|
+
integrators and the time-stepping loops of `chaos`, `classical`, `fluids`,
|
|
53
|
+
`plasma`, `relativity`, and `statphys`), plotly, sympy, and tqdm. The
|
|
54
|
+
interactive 3D viewer in `physicskit.chaos.visualizers.viewer3d`
|
|
55
|
+
additionally needs `pip install pyvista`.
|
|
56
|
+
|
|
57
|
+
For development: `pip install -e ".[dev]"` (see [CONTRIBUTING.md](CONTRIBUTING.md)).
|
|
58
|
+
|
|
59
|
+
## Quick start
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
import numpy as np
|
|
63
|
+
import matplotlib.pyplot as plt
|
|
64
|
+
import physicskit as pk
|
|
65
|
+
|
|
66
|
+
# The Haldane model's two bands carry Chern numbers +1 and -1...
|
|
67
|
+
H = lambda k1, k2: pk.condensed.haldane_model(k1, k2, phi=np.pi / 2)
|
|
68
|
+
print(pk.condensed.compute_chern_number(H, grid_size=30)) # [1, -1]
|
|
69
|
+
|
|
70
|
+
# ...so a finite ribbon has chiral edge states crossing the bulk gap
|
|
71
|
+
bulk = pk.condensed.haldane_lattice_hamiltonian(t2=0.2, phi=np.pi / 2)
|
|
72
|
+
ribbon = pk.condensed.build_ribbon(bulk, open_direction=1, n_cells=20)
|
|
73
|
+
k = np.linspace(0, 2 * np.pi, 200)
|
|
74
|
+
plt.plot(k, [np.linalg.eigvalsh(ribbon([kk])) for kk in k], color="C0", lw=0.8)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Every subpackage below links to its worked examples, or browse the docs
|
|
78
|
+
at <https://cpoli.github.io/physicskit/>.
|
|
79
|
+
|
|
80
|
+
## Subpackages
|
|
81
|
+
|
|
82
|
+
Domain subpackages, each with runnable examples linked below:
|
|
83
|
+
|
|
84
|
+
- [`physicskit.astro`](https://cpoli.github.io/physicskit/api/gallery/astro/) -- stellar structure (Lane-Emden polytropes, Tolman-Oppenheimer-Volkoff, the Chandrasekhar limit), N-body dynamics with symplectic integrators (including the figure-eight choreography), Keplerian orbital mechanics and Hohmann transfers, galactic rotation curves and NFW dark-matter halos, Zel'dovich cosmic-web formation (`numpy.fft`), and stellar convection with an alpha-omega magnetic dynamo.
|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
- [`physicskit.chaos`](https://cpoli.github.io/physicskit/api/gallery/chaos/) -- chaotic dynamical systems: continuous flows (Lorenz, Rössler, Duffing, Chua, double and magnetic pendulums), discrete maps (logistic, Hénon, standard, baker's, Smale horseshoe), classical billiards (circle, ellipse, stadium, Sinai), Lyapunov spectra by Benettin's QR method, fractal dimensions and recurrence analysis, and 2D quantum billiards and kicked rotors (numba-compiled flows and maps; quantum billiard eigenstates via `scipy.sparse.linalg.eigsh`).
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
- [`physicskit.classical`](https://cpoli.github.io/physicskit/api/gallery/classical/) -- classical mechanics: Newtonian, Lagrangian (with a symbolic equations-of-motion engine), Hamiltonian, lattice, and rigid-body dynamics -- the FPUT recurrence, Hénon-Heiles and KAM tori, the double and elastic pendulums, the Foucault pendulum, and the Dzhanibekov effect, Euler's disk, and the rattleback (numba-compiled symplectic and implicit-midpoint integrators).
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
- [`physicskit.condensed`](https://cpoli.github.io/physicskit/api/gallery/condensed/) -- tight-binding models (Bloch bands, Slater-Koster, Peierls substitution and the Hofstadter butterfly), topological band theory (Chern numbers, Zak phase, Z2 invariants, the tenfold way, SSH/Haldane/Kane-Mele/Kitaev/Weyl edge and surface states), Anderson localization, Landau levels and the quantum Hall effects, correlated electrons (BCS, Hubbard, Ginzburg-Landau), exact diagonalization of quantum spin chains (Bethe ansatz, transverse-field Ising, entanglement scaling), phonons and the Debye heat capacity, and Drude/Boltzmann transport (diagonalization via `numpy.linalg.eigh`).
|
|
97
|
+
|
|
98
|
+

|
|
99
|
+
|
|
100
|
+
- [`physicskit.fields`](https://cpoli.github.io/physicskit/api/gallery/fields/) -- electrostatics (Poisson solvers, the method of images, multipole expansions) and Biot-Savart magnetostatics, FDTD electrodynamics on the Yee grid with perfectly matched layers, KdV/NLS/Sine-Gordon solitons (split-step spectral methods via `numpy.fft`), and Gross-Pitaevskii Bose-Einstein condensates with quantized vortices and vortex lattices.
|
|
101
|
+
|
|
102
|
+

|
|
103
|
+
|
|
104
|
+
- [`physicskit.fluids`](https://cpoli.github.io/physicskit/api/gallery/fluids/) -- potential flow (sources, doublets, Kutta-Joukowski lift), viscous exact solutions (Couette, Poiseuille, Blasius, Stokes drag), point-vortex dynamics and the von Kármán street, Kelvin-Helmholtz and Rayleigh-Taylor instabilities, compressible shocks (the Sod shock tube), the 2D incompressible Navier-Stokes solver underlying them (pseudo-spectral via `numpy.fft`, numba-compiled vortex kernels), linear continuum mechanics (heat equation, acoustics, 2D elasticity), and a D2Q9 lattice Boltzmann solver.
|
|
105
|
+
|
|
106
|
+

|
|
107
|
+
|
|
108
|
+
- [`physicskit.optics`](https://cpoli.github.io/physicskit/api/gallery/optics/) -- ray optics and ABCD matrices, Fresnel/Fraunhofer wave optics (`numpy.fft`), Gaussian and Laguerre-Gauss beams (`scipy.special`), and quantum optics (coherent and squeezed states, photon statistics, the Jaynes-Cummings model, Wigner functions), and lasers (rate equations and Maxwell-Bloch dynamics).
|
|
109
|
+
|
|
110
|
+

|
|
111
|
+
|
|
112
|
+
- [`physicskit.particle`](https://cpoli.github.io/physicskit/api/gallery/particle/) -- relativistic kinematics (four-vectors, boosts, Mandelstam variables), particle decays and scattering, detector signatures and resonance searches (from the J/psi to the Higgs), weak interactions and neutrino oscillations, radioactive decay chains, nuclear physics (Rutherford scattering, the semi-empirical mass formula, fission), and U(1) lattice gauge theory with Wilson loops.
|
|
113
|
+
|
|
114
|
+

|
|
115
|
+
|
|
116
|
+
- [`physicskit.plasma`](https://cpoli.github.io/physicskit/api/gallery/plasma/) -- Boris-pusher single-particle motion, guiding-center drifts and magnetic mirrors, Grad-Shafranov MHD equilibrium, magnetic reconnection, cold-plasma wave dispersion and the CMA diagram, particle-in-cell Vlasov-Poisson kinetics (Landau damping, two-stream and Weibel instabilities), and Hasegawa-Mima drift-wave turbulence (numba-compiled particle pushers, spectral field solves via `numpy.fft`).
|
|
117
|
+
|
|
118
|
+

|
|
119
|
+
|
|
120
|
+
- [`physicskit.quantum`](https://cpoli.github.io/physicskit/api/gallery/quantum/) -- quantum mechanics: wave packets (split-operator propagation via `numpy.fft`), potentials and tunneling (matrix Numerov and sparse eigensolvers via `scipy.sparse.linalg.eigsh`), hydrogen and angular momentum, entanglement and Bell inequalities, measurement (Born rule, Stern-Gerlach, the double slit), perturbation and Floquet theory, open systems (Lindblad, quantum trajectories), the Dirac and Klein-Gordon equations, Born and partial-wave scattering, and Hartree-Fock.
|
|
121
|
+
|
|
122
|
+

|
|
123
|
+
|
|
124
|
+
- [`physicskit.relativity`](https://cpoli.github.io/physicskit/api/gallery/relativity/) -- numerical general relativity: Schwarzschild and Kerr geodesics (numba-compiled), ray-traced black hole shadows, gravitational lensing, gravitational waves from binary inspiral to merger and ringdown, neutron stars (TOV), FLRW cosmology, and a numerical curvature engine validated against Einstein's vacuum field equations, with ADM initial data.
|
|
125
|
+
|
|
126
|
+

|
|
127
|
+
|
|
128
|
+
- [`physicskit.rmt`](https://cpoli.github.io/physicskit/api/gallery/rmt/) -- random matrix theory, organized around Dyson's threefold way: Gaussian, circular, Ginibre, Wishart, and Bogoliubov-de Gennes ensembles, with each classic law (semicircle, Wigner surmise, Tracy-Widom, Marchenko-Pastur, circular law, ...) validated against its closed form (`numpy.linalg` eigensolvers, `scipy.stats` Kolmogorov-Smirnov tests).
|
|
129
|
+
|
|
130
|
+

|
|
131
|
+
|
|
132
|
+
- [`physicskit.semiclassical`](https://cpoli.github.io/physicskit/api/gallery/semiclassical/) -- WKB/EBK quantization and Maslov indices, Van Vleck/Herman-Kluk semiclassical propagators, Feynman's path integral and its classical limit, the Gutzwiller and Berry-Tabor trace formulas, and quantum scarring.
|
|
133
|
+
|
|
134
|
+

|
|
135
|
+
|
|
136
|
+
- [`physicskit.statphys`](https://cpoli.github.io/physicskit/api/gallery/statphys/) -- statistical mechanics: Ising, Potts, and XY lattice models (numba-compiled Metropolis and Wolff cluster updates), molecular dynamics, criticality and the renormalization group, percolation, self-organized criticality, KPZ growth, spin glasses, Lee-Yang zeros, nonequilibrium work relations, Langevin/Brownian dynamics, the Ornstein-Uhlenbeck process, and a 1D Fokker-Planck solver.
|
|
137
|
+
|
|
138
|
+

|
|
139
|
+
|
|
140
|
+
Shared infrastructure, used across the subpackages above rather than
|
|
141
|
+
standalone toolkits:
|
|
142
|
+
|
|
143
|
+
- `physicskit.constants` -- SI physical constants shared across subpackages, plus a few well-defined unit conversions (energy/temperature, eV/joules, gravitational G=1 unit systems).
|
|
144
|
+
- `physicskit.integrators` -- shared numerical ODE integrators (RK4, leapfrog, Yoshida4, adaptive Dormand-Prince) and SDE integrators (Euler-Maruyama, Milstein, BAOAB Langevin) used across the other subpackages.
|
|
145
|
+
- `physicskit.units` -- explicit natural-unit systems (G=1, G=c=1, hbar=1, k_B=1, or any combination) with user-chosen scales, SI conversion, and optional pint interop.
|
|
146
|
+
- `physicskit.results` / `physicskit.io` -- a shared, unit-aware `Result` container with adapters for existing subpackage outputs, saved to `.npz` or HDF5.
|
|
147
|
+
|
|
148
|
+
## Design
|
|
149
|
+
|
|
150
|
+
physicskit calls `numpy`/`scipy` directly for anything they already
|
|
151
|
+
implement (FFTs, dense and sparse eigensolvers, quadrature, special
|
|
152
|
+
functions, statistical tests), and hand-rolls an algorithm only where the
|
|
153
|
+
algorithm's own steps are the pedagogical subject (symplectic and Boris
|
|
154
|
+
integrators, particle-in-cell, FDTD, Metropolis and Wolff updates,
|
|
155
|
+
geodesic ray tracing) or where no `numpy`/`scipy` equivalent exists (e.g.
|
|
156
|
+
topological invariants, billiard maps). Time-stepped inner loops are
|
|
157
|
+
numba-compiled, and the ODE integrators are shared across domains. Each
|
|
158
|
+
subpackage computes in its field's natural units (`astro`: G = 1;
|
|
159
|
+
`relativity`: G = c = 1; `quantum`: ħ = 1; `statphys`: k_B = 1), while
|
|
160
|
+
`physicskit.constants` holds the SI values.
|
|
161
|
+
|
|
162
|
+
## Test
|
|
163
|
+
|
|
164
|
+
Tests live alongside each subpackage, at `physicskit/<name>/tests/`.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
pytest # everything
|
|
168
|
+
pytest physicskit/rmt/tests # a single subpackage
|
|
169
|
+
|
|
170
|
+
# docstring examples, across every subpackage (pyvista's 3D viewer is
|
|
171
|
+
# optional and skipped rather than installed as a hard test dependency):
|
|
172
|
+
MPLBACKEND=Agg pytest --doctest-modules physicskit \
|
|
173
|
+
--ignore-glob="*/tests/*" \
|
|
174
|
+
--ignore=physicskit/chaos/visualizers/viewer3d.py
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Both commands, plus `ruff check`/`ruff format --check`, run in CI on
|
|
178
|
+
every PR (`.github/workflows/ci.yml`) across Python 3.10-3.14 on Linux and
|
|
179
|
+
macOS, as does `mypy` on the typed core (`constants`, `integrators`,
|
|
180
|
+
`units`, `results`, `io`). See [CONTRIBUTING.md](CONTRIBUTING.md) before
|
|
181
|
+
opening a PR.
|
|
182
|
+
|
|
183
|
+
Performance benchmarks for the shared integrators and three representative
|
|
184
|
+
solvers live in [`benchmarks/`](benchmarks/README.md):
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
pip install -e ".[bench]"
|
|
188
|
+
pytest benchmarks
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Coverage
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
MPLBACKEND=Agg pytest -q -n auto --cov=physicskit --cov-report=term
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
CI measures coverage on every push and PR and uploads it to
|
|
198
|
+
[Codecov](https://codecov.io/gh/cpoli/physicskit), which drives the badge
|
|
199
|
+
above; the per-file table is also written to each CI run's job summary.
|
|
200
|
+
Modules outside `visualizers/` aim for full line coverage. `visualizers/`
|
|
201
|
+
modules are smoke-tested only (correct return type/shape, or that
|
|
202
|
+
`anim.save()` succeeds) rather than covered line-by-line, per the testing
|
|
203
|
+
convention in [CLAUDE.md](CLAUDE.md), so subpackages with large visualizer
|
|
204
|
+
modules (`chaos`, `quantum`, `statphys`) report lower overall numbers.
|
|
205
|
+
`@njit`-compiled lines are excluded from coverage entirely
|
|
206
|
+
(`pyproject.toml`, `[tool.coverage.report]`) since `coverage.py` cannot
|
|
207
|
+
trace into numba-compiled native code.
|
|
208
|
+
|
|
209
|
+
## Docs
|
|
210
|
+
|
|
211
|
+
Built docs are hosted at <https://cpoli.github.io/physicskit/>, served from
|
|
212
|
+
the `gh-pages` branch. To build locally:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
pip install -e ".[docs]"
|
|
216
|
+
cd docs && make html
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
See `docs/source/history/` for a chronology of each field's foundational
|
|
220
|
+
breakthroughs, linked to the corresponding implementation at each step.
|
|
221
|
+
The README figures are regenerated with `python docs/make_readme_figure.py`
|
|
222
|
+
and `python docs/make_readme_subpackage_figures.py`.
|
|
223
|
+
|
|
224
|
+
Long-form tutorials, including a "Units and conventions" guide to each
|
|
225
|
+
subpackage's natural units, are in `docs/source/tutorials/`.
|
|
226
|
+
|
|
227
|
+
## Citation
|
|
228
|
+
|
|
229
|
+
If you use physicskit in your research, please cite it — see
|
|
230
|
+
[CITATION.cff](CITATION.cff).
|
|
231
|
+
|
|
232
|
+
## Contributing
|
|
233
|
+
|
|
234
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). Please note that this project
|
|
235
|
+
follows the [Contributor Covenant](CODE_OF_CONDUCT.md).
|
|
236
|
+
|
|
237
|
+
## License
|
|
238
|
+
|
|
239
|
+
MIT -- see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""physicskit: unified scientific toolkit for computational physics.
|
|
2
|
+
|
|
3
|
+
Import as ``pk`` by convention::
|
|
4
|
+
|
|
5
|
+
import physicskit as pk
|
|
6
|
+
pk.condensed.compute_chern_number(...)
|
|
7
|
+
pk.chaos.systems.maps.LogisticMap(...)
|
|
8
|
+
pk.fields.nls_dark_soliton(...)
|
|
9
|
+
pk.optics.GaussianBeam(wavelength=1.064e-3, w0=0.05)
|
|
10
|
+
pk.particle.FourVector(E=1.0, px=0.0, py=0.0, pz=0.6)
|
|
11
|
+
pk.astro.PolytropicStar(n=1.5, K=1.0, rho_c=1.0)
|
|
12
|
+
pk.plasma.alfven_speed(B=1.0, rho=1e-6)
|
|
13
|
+
pk.fluids.reynolds_number(velocity=1.0, length=0.01, nu=1e-6)
|
|
14
|
+
pk.units.geometrized_units(mass_kg=pk.constants.SOLAR_MASS_KG).scale("length")
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
from physicskit import (
|
|
18
|
+
astro,
|
|
19
|
+
chaos,
|
|
20
|
+
classical,
|
|
21
|
+
condensed,
|
|
22
|
+
constants,
|
|
23
|
+
fields,
|
|
24
|
+
fluids,
|
|
25
|
+
integrators,
|
|
26
|
+
io,
|
|
27
|
+
optics,
|
|
28
|
+
particle,
|
|
29
|
+
plasma,
|
|
30
|
+
quantum,
|
|
31
|
+
relativity,
|
|
32
|
+
results,
|
|
33
|
+
rmt,
|
|
34
|
+
semiclassical,
|
|
35
|
+
statphys,
|
|
36
|
+
units,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
__version__ = "0.3.0"
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"astro",
|
|
43
|
+
"chaos",
|
|
44
|
+
"classical",
|
|
45
|
+
"condensed",
|
|
46
|
+
"constants",
|
|
47
|
+
"fields",
|
|
48
|
+
"fluids",
|
|
49
|
+
"integrators",
|
|
50
|
+
"io",
|
|
51
|
+
"optics",
|
|
52
|
+
"particle",
|
|
53
|
+
"plasma",
|
|
54
|
+
"quantum",
|
|
55
|
+
"relativity",
|
|
56
|
+
"results",
|
|
57
|
+
"rmt",
|
|
58
|
+
"semiclassical",
|
|
59
|
+
"statphys",
|
|
60
|
+
"units",
|
|
61
|
+
]
|