physicskit 0.1.0__py3-none-any.whl
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/__init__.py +51 -0
- physicskit/astro/__init__.py +66 -0
- physicskit/astro/cosmic_web.py +395 -0
- physicskit/astro/galactic_dynamics.py +137 -0
- physicskit/astro/nbody.py +208 -0
- physicskit/astro/orbital_mechanics.py +220 -0
- physicskit/astro/stellar_dynamo.py +628 -0
- physicskit/astro/stellar_structure.py +198 -0
- physicskit/astro/tests/__init__.py +0 -0
- physicskit/astro/tests/conftest.py +7 -0
- physicskit/astro/tests/test_cosmic_web.py +159 -0
- physicskit/astro/tests/test_galactic_dynamics.py +46 -0
- physicskit/astro/tests/test_nbody.py +81 -0
- physicskit/astro/tests/test_orbital_mechanics.py +73 -0
- physicskit/astro/tests/test_stellar_dynamo.py +198 -0
- physicskit/astro/tests/test_stellar_structure.py +52 -0
- physicskit/astro/tests/test_visualizers.py +159 -0
- physicskit/astro/visualizers.py +628 -0
- physicskit/chaos/__init__.py +55 -0
- physicskit/chaos/core/__init__.py +3 -0
- physicskit/chaos/core/base_system.py +342 -0
- physicskit/chaos/core/integrators.py +40 -0
- physicskit/chaos/exceptions.py +24 -0
- physicskit/chaos/quantum/__init__.py +38 -0
- physicskit/chaos/quantum/billiards.py +274 -0
- physicskit/chaos/quantum/husimi.py +85 -0
- physicskit/chaos/quantum/maps.py +366 -0
- physicskit/chaos/systems/__init__.py +38 -0
- physicskit/chaos/systems/billiards.py +1131 -0
- physicskit/chaos/systems/continuous.py +1276 -0
- physicskit/chaos/systems/maps.py +557 -0
- physicskit/chaos/tests/__init__.py +0 -0
- physicskit/chaos/tests/test_basins.py +76 -0
- physicskit/chaos/tests/test_bifurcation.py +132 -0
- physicskit/chaos/tests/test_billiards.py +115 -0
- physicskit/chaos/tests/test_continuous.py +224 -0
- physicskit/chaos/tests/test_dimension.py +69 -0
- physicskit/chaos/tests/test_divergence.py +90 -0
- physicskit/chaos/tests/test_dynamic_plots.py +269 -0
- physicskit/chaos/tests/test_integrators.py +96 -0
- physicskit/chaos/tests/test_io.py +41 -0
- physicskit/chaos/tests/test_maps.py +110 -0
- physicskit/chaos/tests/test_metrics.py +115 -0
- physicskit/chaos/tests/test_phase_space.py +73 -0
- physicskit/chaos/tests/test_properties.py +116 -0
- physicskit/chaos/tests/test_quantum_billiards.py +94 -0
- physicskit/chaos/tests/test_quantum_maps.py +144 -0
- physicskit/chaos/tests/test_recurrence.py +51 -0
- physicskit/chaos/tests/test_repr_and_api_consistency.py +134 -0
- physicskit/chaos/tests/test_section.py +49 -0
- physicskit/chaos/tests/test_spectral.py +48 -0
- physicskit/chaos/tests/test_streamlit_app.py +45 -0
- physicskit/chaos/tests/test_timeseries.py +131 -0
- physicskit/chaos/tests/test_viewer3d.py +41 -0
- physicskit/chaos/utils/__init__.py +46 -0
- physicskit/chaos/utils/dimension.py +139 -0
- physicskit/chaos/utils/io.py +95 -0
- physicskit/chaos/utils/metrics.py +304 -0
- physicskit/chaos/utils/recurrence.py +122 -0
- physicskit/chaos/utils/spectral.py +69 -0
- physicskit/chaos/utils/timeseries.py +303 -0
- physicskit/chaos/visualizers/__init__.py +85 -0
- physicskit/chaos/visualizers/basins.py +185 -0
- physicskit/chaos/visualizers/bifurcation.py +273 -0
- physicskit/chaos/visualizers/divergence.py +374 -0
- physicskit/chaos/visualizers/dynamic_plots.py +1372 -0
- physicskit/chaos/visualizers/phase_space.py +133 -0
- physicskit/chaos/visualizers/quantum.py +299 -0
- physicskit/chaos/visualizers/recurrence.py +91 -0
- physicskit/chaos/visualizers/section.py +161 -0
- physicskit/chaos/visualizers/theme.py +31 -0
- physicskit/chaos/visualizers/viewer3d.py +82 -0
- physicskit/classical/__init__.py +55 -0
- physicskit/classical/core/__init__.py +17 -0
- physicskit/classical/core/base_system.py +510 -0
- physicskit/classical/core/integrators.py +397 -0
- physicskit/classical/systems/__init__.py +32 -0
- physicskit/classical/systems/chains.py +334 -0
- physicskit/classical/systems/hamiltonian.py +215 -0
- physicskit/classical/systems/lagrangian.py +308 -0
- physicskit/classical/systems/newtonian.py +536 -0
- physicskit/classical/systems/rotations.py +614 -0
- physicskit/classical/tests/__init__.py +0 -0
- physicskit/classical/tests/conftest.py +7 -0
- physicskit/classical/tests/test_base_system.py +113 -0
- physicskit/classical/tests/test_chains.py +84 -0
- physicskit/classical/tests/test_conservation.py +244 -0
- physicskit/classical/tests/test_conservation_utils.py +47 -0
- physicskit/classical/tests/test_hamiltonian.py +44 -0
- physicskit/classical/tests/test_integrators.py +123 -0
- physicskit/classical/tests/test_lagrangian.py +69 -0
- physicskit/classical/tests/test_newtonian.py +45 -0
- physicskit/classical/tests/test_rotations.py +160 -0
- physicskit/classical/tests/test_stepsize.py +149 -0
- physicskit/classical/tests/test_symbolic.py +125 -0
- physicskit/classical/tests/test_visualizers.py +172 -0
- physicskit/classical/utils/__init__.py +20 -0
- physicskit/classical/utils/conservation.py +126 -0
- physicskit/classical/utils/stepsize.py +187 -0
- physicskit/classical/utils/symbolic.py +235 -0
- physicskit/classical/visualizers/__init__.py +25 -0
- physicskit/classical/visualizers/animations.py +508 -0
- physicskit/classical/visualizers/interactive.py +113 -0
- physicskit/classical/visualizers/modal_analysis.py +97 -0
- physicskit/classical/visualizers/phase_space.py +214 -0
- physicskit/condensed/__init__.py +122 -0
- physicskit/condensed/anderson_localization.py +155 -0
- physicskit/condensed/correlated.py +284 -0
- physicskit/condensed/ginzburg_landau.py +220 -0
- physicskit/condensed/landau_levels.py +246 -0
- physicskit/condensed/laughlin.py +229 -0
- physicskit/condensed/models.py +627 -0
- physicskit/condensed/tests/__init__.py +0 -0
- physicskit/condensed/tests/test_condensed.py +518 -0
- physicskit/condensed/tests/test_visualizers.py +87 -0
- physicskit/condensed/tight_binding.py +445 -0
- physicskit/condensed/topological_insulator_3d.py +178 -0
- physicskit/condensed/topology.py +217 -0
- physicskit/condensed/visualizers.py +296 -0
- physicskit/condensed/weyl.py +180 -0
- physicskit/constants.py +184 -0
- physicskit/fields/__init__.py +111 -0
- physicskit/fields/electrodynamics.py +671 -0
- physicskit/fields/quantum_fields.py +510 -0
- physicskit/fields/solitons.py +527 -0
- physicskit/fields/tests/__init__.py +0 -0
- physicskit/fields/tests/conftest.py +7 -0
- physicskit/fields/tests/test_field_animations.py +154 -0
- physicskit/fields/tests/test_fields.py +439 -0
- physicskit/fields/tests/test_visualizers.py +101 -0
- physicskit/fields/visualizers.py +503 -0
- physicskit/fluids/__init__.py +134 -0
- physicskit/fluids/core/__init__.py +23 -0
- physicskit/fluids/core/grid.py +165 -0
- physicskit/fluids/core/timestepping.py +231 -0
- physicskit/fluids/exceptions.py +26 -0
- physicskit/fluids/systems/__init__.py +70 -0
- physicskit/fluids/systems/compressible_flow.py +281 -0
- physicskit/fluids/systems/instabilities.py +343 -0
- physicskit/fluids/systems/navier_stokes.py +221 -0
- physicskit/fluids/systems/potential_flow.py +440 -0
- physicskit/fluids/systems/viscous_flow.py +425 -0
- physicskit/fluids/systems/vortex_dynamics.py +304 -0
- physicskit/fluids/tests/__init__.py +0 -0
- physicskit/fluids/tests/conftest.py +7 -0
- physicskit/fluids/tests/test_compressible_flow.py +66 -0
- physicskit/fluids/tests/test_instabilities.py +115 -0
- physicskit/fluids/tests/test_navier_stokes.py +67 -0
- physicskit/fluids/tests/test_potential_flow.py +92 -0
- physicskit/fluids/tests/test_static_visualizers.py +91 -0
- physicskit/fluids/tests/test_utils.py +100 -0
- physicskit/fluids/tests/test_viscous_flow.py +110 -0
- physicskit/fluids/tests/test_visualizers.py +34 -0
- physicskit/fluids/tests/test_vortex_dynamics.py +88 -0
- physicskit/fluids/utils/__init__.py +18 -0
- physicskit/fluids/utils/dimensionless.py +239 -0
- physicskit/fluids/utils/spectral_analysis.py +142 -0
- physicskit/fluids/visualizers/__init__.py +14 -0
- physicskit/fluids/visualizers/compressible.py +39 -0
- physicskit/fluids/visualizers/flow_fields.py +252 -0
- physicskit/fluids/visualizers/potential_flow.py +51 -0
- physicskit/fluids/visualizers/spectra.py +62 -0
- physicskit/fluids/visualizers/theme.py +38 -0
- physicskit/integrators/__init__.py +52 -0
- physicskit/integrators/adaptive.py +199 -0
- physicskit/integrators/fixed_step.py +360 -0
- physicskit/integrators/tests/__init__.py +0 -0
- physicskit/integrators/tests/test_integrators.py +101 -0
- physicskit/optics/__init__.py +124 -0
- physicskit/optics/_compat.py +5 -0
- physicskit/optics/gaussian.py +382 -0
- physicskit/optics/quantum_optics.py +428 -0
- physicskit/optics/ray.py +469 -0
- physicskit/optics/tests/__init__.py +0 -0
- physicskit/optics/tests/test_diffraction_animation.py +38 -0
- physicskit/optics/tests/test_gaussian.py +170 -0
- physicskit/optics/tests/test_quantum_optics.py +147 -0
- physicskit/optics/tests/test_ray.py +177 -0
- physicskit/optics/tests/test_visualizers.py +58 -0
- physicskit/optics/tests/test_wave.py +146 -0
- physicskit/optics/visualizers.py +264 -0
- physicskit/optics/wave.py +365 -0
- physicskit/particle/__init__.py +152 -0
- physicskit/particle/collider.py +382 -0
- physicskit/particle/confinement.py +125 -0
- physicskit/particle/decays.py +357 -0
- physicskit/particle/electroweak.py +300 -0
- physicskit/particle/kinematics.py +271 -0
- physicskit/particle/neutrinos.py +84 -0
- physicskit/particle/nuclear.py +100 -0
- physicskit/particle/scattering.py +159 -0
- physicskit/particle/tests/__init__.py +0 -0
- physicskit/particle/tests/conftest.py +7 -0
- physicskit/particle/tests/test_collider.py +119 -0
- physicskit/particle/tests/test_confinement.py +42 -0
- physicskit/particle/tests/test_decays.py +112 -0
- physicskit/particle/tests/test_electroweak.py +97 -0
- physicskit/particle/tests/test_kinematics.py +138 -0
- physicskit/particle/tests/test_neutrinos.py +36 -0
- physicskit/particle/tests/test_nuclear.py +45 -0
- physicskit/particle/tests/test_scattering.py +64 -0
- physicskit/particle/tests/test_visualizers.py +214 -0
- physicskit/particle/visualizers/__init__.py +38 -0
- physicskit/particle/visualizers/animations.py +705 -0
- physicskit/particle/visualizers/static.py +101 -0
- physicskit/plasma/__init__.py +176 -0
- physicskit/plasma/acceleration.py +152 -0
- physicskit/plasma/instabilities.py +417 -0
- physicskit/plasma/kinetic.py +588 -0
- physicskit/plasma/mhd.py +463 -0
- physicskit/plasma/single_particle.py +562 -0
- physicskit/plasma/tests/__init__.py +0 -0
- physicskit/plasma/tests/conftest.py +7 -0
- physicskit/plasma/tests/test_new_time_domain_features.py +222 -0
- physicskit/plasma/tests/test_plasma.py +232 -0
- physicskit/plasma/tests/test_visualizers.py +79 -0
- physicskit/plasma/turbulence.py +219 -0
- physicskit/plasma/visualizers.py +868 -0
- physicskit/plasma/waves.py +549 -0
- physicskit/quantum/__init__.py +180 -0
- physicskit/quantum/_compat.py +20 -0
- physicskit/quantum/chapters/__init__.py +0 -0
- physicskit/quantum/chapters/entanglement.py +489 -0
- physicskit/quantum/chapters/harmonic_spin.py +517 -0
- physicskit/quantum/chapters/hydrogen_am.py +292 -0
- physicskit/quantum/chapters/perturbation.py +350 -0
- physicskit/quantum/chapters/potentials.py +997 -0
- physicskit/quantum/chapters/spin.py +306 -0
- physicskit/quantum/chapters/wave_packets.py +541 -0
- physicskit/quantum/core/__init__.py +0 -0
- physicskit/quantum/core/eigensolvers.py +311 -0
- physicskit/quantum/core/operators.py +296 -0
- physicskit/quantum/core/solvers.py +271 -0
- physicskit/quantum/tests/__init__.py +0 -0
- physicskit/quantum/tests/conftest.py +7 -0
- physicskit/quantum/tests/test_animations.py +225 -0
- physicskit/quantum/tests/test_compat.py +43 -0
- physicskit/quantum/tests/test_eigensolvers.py +24 -0
- physicskit/quantum/tests/test_entanglement.py +127 -0
- physicskit/quantum/tests/test_harmonic_spin.py +140 -0
- physicskit/quantum/tests/test_hydrogen_am.py +48 -0
- physicskit/quantum/tests/test_measure.py +110 -0
- physicskit/quantum/tests/test_operators.py +105 -0
- physicskit/quantum/tests/test_perturbation.py +112 -0
- physicskit/quantum/tests/test_physics_checks.py +131 -0
- physicskit/quantum/tests/test_potentials.py +191 -0
- physicskit/quantum/tests/test_solvers.py +70 -0
- physicskit/quantum/tests/test_spin.py +22 -0
- physicskit/quantum/tests/test_unitarity.py +84 -0
- physicskit/quantum/tests/test_wave_packets.py +53 -0
- physicskit/quantum/utils/__init__.py +0 -0
- physicskit/quantum/utils/measure.py +253 -0
- physicskit/quantum/visualizers/__init__.py +0 -0
- physicskit/quantum/visualizers/bloch_sphere.py +205 -0
- physicskit/quantum/visualizers/entanglement.py +58 -0
- physicskit/quantum/visualizers/orbitals.py +187 -0
- physicskit/quantum/visualizers/phase_space.py +179 -0
- physicskit/quantum/visualizers/wavefunctions.py +230 -0
- physicskit/relativity/__init__.py +61 -0
- physicskit/relativity/chapters/__init__.py +33 -0
- physicskit/relativity/chapters/cosmology.py +190 -0
- physicskit/relativity/chapters/gw_merger.py +399 -0
- physicskit/relativity/chapters/kerr.py +371 -0
- physicskit/relativity/chapters/lensing.py +196 -0
- physicskit/relativity/chapters/neutron_star.py +149 -0
- physicskit/relativity/chapters/schwarzschild.py +412 -0
- physicskit/relativity/chapters/timekeeping.py +133 -0
- physicskit/relativity/core/__init__.py +12 -0
- physicskit/relativity/core/geodesics.py +216 -0
- physicskit/relativity/core/kerr_raytracer.py +259 -0
- physicskit/relativity/core/raytracer.py +241 -0
- physicskit/relativity/core/tensors.py +468 -0
- physicskit/relativity/tests/__init__.py +0 -0
- physicskit/relativity/tests/test_conservations.py +54 -0
- physicskit/relativity/tests/test_constants.py +34 -0
- physicskit/relativity/tests/test_cosmology.py +61 -0
- physicskit/relativity/tests/test_gw_merger.py +117 -0
- physicskit/relativity/tests/test_kerr.py +116 -0
- physicskit/relativity/tests/test_kerr_raytracer.py +103 -0
- physicskit/relativity/tests/test_lensing.py +75 -0
- physicskit/relativity/tests/test_neutron_star.py +48 -0
- physicskit/relativity/tests/test_raytracer.py +67 -0
- physicskit/relativity/tests/test_schwarzschild.py +126 -0
- physicskit/relativity/tests/test_shadow_render.py +81 -0
- physicskit/relativity/tests/test_tensors.py +86 -0
- physicskit/relativity/tests/test_timekeeping.py +51 -0
- physicskit/relativity/tests/test_visualizers_misc.py +115 -0
- physicskit/relativity/utils/__init__.py +1 -0
- physicskit/relativity/utils/constants.py +232 -0
- physicskit/relativity/visualizers/__init__.py +46 -0
- physicskit/relativity/visualizers/interactive.py +127 -0
- physicskit/relativity/visualizers/shadow_render.py +367 -0
- physicskit/relativity/visualizers/spacetime_3d.py +92 -0
- physicskit/relativity/visualizers/spacetime_diagrams.py +198 -0
- physicskit/relativity/visualizers/wave_plots.py +185 -0
- physicskit/rmt/__init__.py +8 -0
- physicskit/rmt/ensembles/__init__.py +108 -0
- physicskit/rmt/ensembles/banded.py +114 -0
- physicskit/rmt/ensembles/base.py +135 -0
- physicskit/rmt/ensembles/bdg.py +218 -0
- physicskit/rmt/ensembles/chiral.py +308 -0
- physicskit/rmt/ensembles/circular.py +104 -0
- physicskit/rmt/ensembles/crossover.py +82 -0
- physicskit/rmt/ensembles/density_matrix.py +148 -0
- physicskit/rmt/ensembles/effective_hamiltonian.py +230 -0
- physicskit/rmt/ensembles/embedded.py +207 -0
- physicskit/rmt/ensembles/gaussian.py +153 -0
- physicskit/rmt/ensembles/ginibre.py +110 -0
- physicskit/rmt/ensembles/girko.py +190 -0
- physicskit/rmt/ensembles/graph_laplacian.py +92 -0
- physicskit/rmt/ensembles/haar.py +57 -0
- physicskit/rmt/ensembles/jacobi.py +182 -0
- physicskit/rmt/ensembles/poisson.py +77 -0
- physicskit/rmt/ensembles/polynomial.py +139 -0
- physicskit/rmt/ensembles/pt_symmetric.py +120 -0
- physicskit/rmt/ensembles/single_ring.py +170 -0
- physicskit/rmt/ensembles/sparse.py +95 -0
- physicskit/rmt/ensembles/syk.py +170 -0
- physicskit/rmt/ensembles/truncated_unitary.py +80 -0
- physicskit/rmt/ensembles/universality.py +92 -0
- physicskit/rmt/ensembles/wishart.py +88 -0
- physicskit/rmt/py.typed +0 -0
- physicskit/rmt/spectrum.py +82 -0
- physicskit/rmt/stats/__init__.py +160 -0
- physicskit/rmt/stats/characteristic_polynomial.py +77 -0
- physicskit/rmt/stats/circular_law.py +54 -0
- physicskit/rmt/stats/correlations.py +162 -0
- physicskit/rmt/stats/density.py +70 -0
- physicskit/rmt/stats/entanglement.py +36 -0
- physicskit/rmt/stats/free_probability.py +202 -0
- physicskit/rmt/stats/localization.py +338 -0
- physicskit/rmt/stats/marchenko_pastur.py +55 -0
- physicskit/rmt/stats/pt_symmetric.py +265 -0
- physicskit/rmt/stats/ratios.py +110 -0
- physicskit/rmt/stats/real_ginibre.py +134 -0
- physicskit/rmt/stats/rigidity.py +272 -0
- physicskit/rmt/stats/single_ring.py +95 -0
- physicskit/rmt/stats/spacing.py +150 -0
- physicskit/rmt/stats/tracy_widom.py +175 -0
- physicskit/rmt/stats/truncated_unitary.py +40 -0
- physicskit/rmt/stats/unfolding.py +37 -0
- physicskit/rmt/stats/wachter.py +67 -0
- physicskit/rmt/tests/__init__.py +0 -0
- physicskit/rmt/tests/cache_utils.py +107 -0
- physicskit/rmt/tests/conftest.py +8 -0
- physicskit/rmt/tests/test_banded.py +86 -0
- physicskit/rmt/tests/test_base.py +29 -0
- physicskit/rmt/tests/test_bdg.py +133 -0
- physicskit/rmt/tests/test_characteristic_polynomial.py +50 -0
- physicskit/rmt/tests/test_chiral.py +273 -0
- physicskit/rmt/tests/test_circular.py +225 -0
- physicskit/rmt/tests/test_crossover.py +72 -0
- physicskit/rmt/tests/test_density.py +23 -0
- physicskit/rmt/tests/test_density_matrix.py +181 -0
- physicskit/rmt/tests/test_effective_hamiltonian.py +140 -0
- physicskit/rmt/tests/test_embedded.py +169 -0
- physicskit/rmt/tests/test_free_probability.py +81 -0
- physicskit/rmt/tests/test_gaussian_ensembles.py +22 -0
- physicskit/rmt/tests/test_gaussian_semicircle.py +127 -0
- physicskit/rmt/tests/test_ginibre_circular_law.py +131 -0
- physicskit/rmt/tests/test_girko.py +178 -0
- physicskit/rmt/tests/test_graph_laplacian.py +102 -0
- physicskit/rmt/tests/test_haar.py +118 -0
- physicskit/rmt/tests/test_jacobi_wachter.py +136 -0
- physicskit/rmt/tests/test_localization.py +240 -0
- physicskit/rmt/tests/test_poisson.py +149 -0
- physicskit/rmt/tests/test_polynomial.py +107 -0
- physicskit/rmt/tests/test_pt_symmetric.py +178 -0
- physicskit/rmt/tests/test_random_state.py +19 -0
- physicskit/rmt/tests/test_real_ginibre.py +112 -0
- physicskit/rmt/tests/test_rigidity_universality.py +167 -0
- physicskit/rmt/tests/test_single_ring.py +132 -0
- physicskit/rmt/tests/test_spacing_and_ratios.py +122 -0
- physicskit/rmt/tests/test_sparse.py +71 -0
- physicskit/rmt/tests/test_spectrum.py +27 -0
- physicskit/rmt/tests/test_syk.py +136 -0
- physicskit/rmt/tests/test_tracy_widom.py +113 -0
- physicskit/rmt/tests/test_tridiagonal.py +41 -0
- physicskit/rmt/tests/test_truncated_unitary.py +80 -0
- physicskit/rmt/tests/test_validation_base.py +25 -0
- physicskit/rmt/tests/test_validation_misc.py +67 -0
- physicskit/rmt/tests/test_wishart_marchenko_pastur.py +120 -0
- physicskit/rmt/utils/__init__.py +0 -0
- physicskit/rmt/utils/haar.py +128 -0
- physicskit/rmt/utils/random_state.py +24 -0
- physicskit/rmt/utils/tridiagonal.py +167 -0
- physicskit/rmt/validation/__init__.py +36 -0
- physicskit/rmt/validation/base.py +126 -0
- physicskit/rmt/validation/circular_law.py +80 -0
- physicskit/rmt/validation/marchenko_pastur.py +53 -0
- physicskit/rmt/validation/ratio_distribution.py +53 -0
- physicskit/rmt/validation/real_ginibre.py +60 -0
- physicskit/rmt/validation/sine_kernel.py +57 -0
- physicskit/rmt/validation/single_ring.py +68 -0
- physicskit/rmt/validation/tracy_widom.py +89 -0
- physicskit/rmt/validation/universality.py +100 -0
- physicskit/rmt/validation/wachter.py +52 -0
- physicskit/rmt/validation/wigner_semicircle.py +40 -0
- physicskit/rmt/validation/wigner_surmise.py +58 -0
- physicskit/semiclassical/__init__.py +94 -0
- physicskit/semiclassical/_compat.py +5 -0
- physicskit/semiclassical/core/__init__.py +41 -0
- physicskit/semiclassical/core/gutzwiller.py +215 -0
- physicskit/semiclassical/core/path_integral.py +594 -0
- physicskit/semiclassical/core/propagators.py +579 -0
- physicskit/semiclassical/core/wkb.py +308 -0
- physicskit/semiclassical/systems/__init__.py +13 -0
- physicskit/semiclassical/systems/scarring.py +278 -0
- physicskit/semiclassical/tests/__init__.py +0 -0
- physicskit/semiclassical/tests/test_gutzwiller.py +35 -0
- physicskit/semiclassical/tests/test_path_integral.py +194 -0
- physicskit/semiclassical/tests/test_propagators.py +82 -0
- physicskit/semiclassical/tests/test_scarring.py +43 -0
- physicskit/semiclassical/tests/test_visualizers.py +89 -0
- physicskit/semiclassical/tests/test_wkb.py +30 -0
- physicskit/semiclassical/visualizers/__init__.py +17 -0
- physicskit/semiclassical/visualizers/gutzwiller.py +55 -0
- physicskit/semiclassical/visualizers/path_integral.py +195 -0
- physicskit/semiclassical/visualizers/propagators.py +89 -0
- physicskit/semiclassical/visualizers/scarring.py +146 -0
- physicskit/semiclassical/visualizers/wkb.py +55 -0
- physicskit/statphys/__init__.py +80 -0
- physicskit/statphys/chapters/__init__.py +43 -0
- physicskit/statphys/chapters/ehrenfest_urn.py +112 -0
- physicskit/statphys/chapters/ising_lattice.py +431 -0
- physicskit/statphys/chapters/kpz_growth.py +129 -0
- physicskit/statphys/chapters/molecular_dynamics.py +258 -0
- physicskit/statphys/chapters/nonequilibrium_work.py +146 -0
- physicskit/statphys/chapters/percolation.py +305 -0
- physicskit/statphys/chapters/random_walk.py +142 -0
- physicskit/statphys/chapters/renormalization.py +148 -0
- physicskit/statphys/chapters/sandpile.py +109 -0
- physicskit/statphys/chapters/spin_glass.py +275 -0
- physicskit/statphys/core/__init__.py +10 -0
- physicskit/statphys/core/kpz_engine.py +53 -0
- physicskit/statphys/core/md_engine.py +157 -0
- physicskit/statphys/core/monte_carlo.py +462 -0
- physicskit/statphys/core/random_walk_engine.py +68 -0
- physicskit/statphys/core/sandpile_engine.py +52 -0
- physicskit/statphys/tests/__init__.py +0 -0
- physicskit/statphys/tests/test_dynamics.py +66 -0
- physicskit/statphys/tests/test_ehrenfest_urn.py +44 -0
- physicskit/statphys/tests/test_finite_size_scaling.py +62 -0
- physicskit/statphys/tests/test_interactive.py +33 -0
- physicskit/statphys/tests/test_ising.py +68 -0
- physicskit/statphys/tests/test_kpz.py +55 -0
- physicskit/statphys/tests/test_landau_theory.py +49 -0
- physicskit/statphys/tests/test_md_engine.py +31 -0
- physicskit/statphys/tests/test_molecular_dynamics.py +72 -0
- physicskit/statphys/tests/test_nonequilibrium_work.py +33 -0
- physicskit/statphys/tests/test_partition_function.py +26 -0
- physicskit/statphys/tests/test_percolation.py +116 -0
- physicskit/statphys/tests/test_potts_model.py +46 -0
- physicskit/statphys/tests/test_random_walk.py +50 -0
- physicskit/statphys/tests/test_renormalization.py +44 -0
- physicskit/statphys/tests/test_sandpile.py +44 -0
- physicskit/statphys/tests/test_spin_glass.py +73 -0
- physicskit/statphys/tests/test_thermodynamics.py +121 -0
- physicskit/statphys/tests/test_xy_model.py +45 -0
- physicskit/statphys/utils/__init__.py +1 -0
- physicskit/statphys/utils/dynamics.py +100 -0
- physicskit/statphys/utils/finite_size_scaling.py +171 -0
- physicskit/statphys/utils/landau_theory.py +151 -0
- physicskit/statphys/utils/partition_function.py +109 -0
- physicskit/statphys/utils/thermodynamics.py +356 -0
- physicskit/statphys/visualizers/__init__.py +87 -0
- physicskit/statphys/visualizers/interactive.py +161 -0
- physicskit/statphys/visualizers/jarzynski_render.py +44 -0
- physicskit/statphys/visualizers/kpz_render.py +65 -0
- physicskit/statphys/visualizers/lattice_render.py +212 -0
- physicskit/statphys/visualizers/particle_render.py +121 -0
- physicskit/statphys/visualizers/random_walk_render.py +106 -0
- physicskit/statphys/visualizers/rg_render.py +45 -0
- physicskit/statphys/visualizers/sandpile_render.py +65 -0
- physicskit/statphys/visualizers/spin_glass_render.py +40 -0
- physicskit/statphys/visualizers/urn_render.py +38 -0
- physicskit/statphys/visualizers/vortex_render.py +84 -0
- physicskit/tests/__init__.py +0 -0
- physicskit/tests/test_constants.py +38 -0
- physicskit-0.1.0.dist-info/METADATA +196 -0
- physicskit-0.1.0.dist-info/RECORD +484 -0
- physicskit-0.1.0.dist-info/WHEEL +5 -0
- physicskit-0.1.0.dist-info/licenses/LICENSE +21 -0
- physicskit-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
"""Correlated-electron models: Bogoliubov-de Gennes superconductivity and the Hubbard model.
|
|
2
|
+
|
|
3
|
+
Provides a mean-field BCS/Bogoliubov-de Gennes (BdG) solver for
|
|
4
|
+
s-wave superconductivity, and small-cluster exact diagonalization (ED) of
|
|
5
|
+
the 1D Fermi-Hubbard model.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from itertools import combinations
|
|
11
|
+
|
|
12
|
+
import numpy as np
|
|
13
|
+
|
|
14
|
+
__all__ = ["bdg_bcs_hamiltonian", "bdg_spectrum", "hubbard_1d_exact_diagonalization", "hubbard_spin_correlations"]
|
|
15
|
+
|
|
16
|
+
_TAU_X = np.array([[0, 1], [1, 0]], dtype=complex)
|
|
17
|
+
_TAU_Y = np.array([[0, -1j], [1j, 0]], dtype=complex)
|
|
18
|
+
_TAU_Z = np.array([[1, 0], [0, -1]], dtype=complex)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def bdg_bcs_hamiltonian(k: float, mu: float = 0.0, t: float = 1.0, delta: complex = 0.5) -> np.ndarray:
|
|
22
|
+
"""Mean-field Bogoliubov-de Gennes Hamiltonian for a 1D s-wave BCS superconductor.
|
|
23
|
+
|
|
24
|
+
Parameters
|
|
25
|
+
----------
|
|
26
|
+
k : float
|
|
27
|
+
Reduced crystal momentum, periodic on :math:`[0, 2\\pi)`.
|
|
28
|
+
mu : float, default=0.0
|
|
29
|
+
Chemical potential.
|
|
30
|
+
t : float, default=1.0
|
|
31
|
+
Nearest-neighbor hopping amplitude (sets the normal-state band
|
|
32
|
+
:math:`\\xi(k) = -2t\\cos k - \\mu`).
|
|
33
|
+
delta : complex, default=0.5
|
|
34
|
+
s-wave (momentum-independent) pairing amplitude.
|
|
35
|
+
|
|
36
|
+
Returns
|
|
37
|
+
-------
|
|
38
|
+
ndarray, shape (2, 2)
|
|
39
|
+
BdG Hamiltonian :math:`H(k) = \\xi(k)\\tau_z + \\mathrm{Re}(\\Delta)\\tau_x - \\mathrm{Im}(\\Delta)\\tau_y`
|
|
40
|
+
in the Nambu basis :math:`(c_k, c_{-k}^\\dagger)`.
|
|
41
|
+
|
|
42
|
+
See Also
|
|
43
|
+
--------
|
|
44
|
+
bdg_spectrum : Quasiparticle energies over a grid of k, exposing the gap.
|
|
45
|
+
|
|
46
|
+
Examples
|
|
47
|
+
--------
|
|
48
|
+
>>> import numpy as np
|
|
49
|
+
>>> H = bdg_bcs_hamiltonian(k=np.pi / 2, mu=0.0, t=1.0, delta=0.5)
|
|
50
|
+
>>> np.round(np.linalg.eigvalsh(H), 8)
|
|
51
|
+
array([-0.5, 0.5])
|
|
52
|
+
"""
|
|
53
|
+
xi = -2 * t * np.cos(k) - mu
|
|
54
|
+
return xi * _TAU_Z + np.real(delta) * _TAU_X - np.imag(delta) * _TAU_Y
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def bdg_spectrum(mu: float = 0.0, t: float = 1.0, delta: complex = 0.5, n_k: int = 200) -> tuple:
|
|
58
|
+
"""Quasiparticle (positive-energy) BdG spectrum over the 1D Brillouin zone.
|
|
59
|
+
|
|
60
|
+
Parameters
|
|
61
|
+
----------
|
|
62
|
+
mu : float, default=0.0
|
|
63
|
+
Chemical potential.
|
|
64
|
+
t : float, default=1.0
|
|
65
|
+
Nearest-neighbor hopping amplitude.
|
|
66
|
+
delta : complex, default=0.5
|
|
67
|
+
s-wave pairing amplitude.
|
|
68
|
+
n_k : int, default=200
|
|
69
|
+
Number of momentum points.
|
|
70
|
+
|
|
71
|
+
Returns
|
|
72
|
+
-------
|
|
73
|
+
k_grid : ndarray, shape (n_k,)
|
|
74
|
+
Momentum grid over :math:`[0, 2\\pi)`.
|
|
75
|
+
energies : ndarray, shape (n_k,)
|
|
76
|
+
Positive quasiparticle branch :math:`E(k) = \\sqrt{\\xi(k)^2 + |\\Delta|^2}`.
|
|
77
|
+
|
|
78
|
+
Examples
|
|
79
|
+
--------
|
|
80
|
+
The minimum quasiparticle energy equals the pairing gap :math:`|\\Delta|`:
|
|
81
|
+
|
|
82
|
+
>>> k, E = bdg_spectrum(mu=0.0, t=1.0, delta=0.5, n_k=400)
|
|
83
|
+
>>> round(float(E.min()), 3)
|
|
84
|
+
0.5
|
|
85
|
+
"""
|
|
86
|
+
k_grid = np.linspace(0, 2 * np.pi, n_k, endpoint=False)
|
|
87
|
+
energies = np.array([np.linalg.eigvalsh(bdg_bcs_hamiltonian(k, mu, t, delta)).max() for k in k_grid])
|
|
88
|
+
return k_grid, energies
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
# -- 1D Fermi-Hubbard exact diagonalization ----------------------------------
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def _sector_states(n_sites: int, n_particles: int) -> list:
|
|
95
|
+
"""All occupation bitmasks with exactly ``n_particles`` set bits among ``n_sites``."""
|
|
96
|
+
states = []
|
|
97
|
+
for occ in combinations(range(n_sites), n_particles):
|
|
98
|
+
mask = 0
|
|
99
|
+
for site in occ:
|
|
100
|
+
mask |= 1 << site
|
|
101
|
+
states.append(mask)
|
|
102
|
+
return sorted(states)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _fermion_sign(mask: int, site: int) -> int:
|
|
106
|
+
"""Jordan-Wigner sign from anticommuting a fermion operator past occupied sites below ``site``."""
|
|
107
|
+
below = mask & ((1 << site) - 1)
|
|
108
|
+
return -1 if bin(below).count("1") % 2 else 1
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
def _hopping_sector_hamiltonian(n_sites: int, n_particles: int, t: float, pbc: bool) -> tuple:
|
|
112
|
+
"""Single-spin-species kinetic-energy matrix :math:`-t\\sum_{\\langle ij\\rangle} c_i^\\dagger c_j + \\text{h.c.}`."""
|
|
113
|
+
states = _sector_states(n_sites, n_particles)
|
|
114
|
+
index = {s: i for i, s in enumerate(states)}
|
|
115
|
+
dim = len(states)
|
|
116
|
+
H = np.zeros((dim, dim))
|
|
117
|
+
bonds = [(i, i + 1) for i in range(n_sites - 1)]
|
|
118
|
+
if pbc and n_sites > 2:
|
|
119
|
+
bonds.append((n_sites - 1, 0))
|
|
120
|
+
for n, mask in enumerate(states):
|
|
121
|
+
for i, j in bonds:
|
|
122
|
+
for src, dst in ((i, j), (j, i)):
|
|
123
|
+
if (mask >> src) & 1 and not (mask >> dst) & 1:
|
|
124
|
+
sign = _fermion_sign(mask, src)
|
|
125
|
+
m1 = mask & ~(1 << src)
|
|
126
|
+
sign *= _fermion_sign(m1, dst)
|
|
127
|
+
m2 = m1 | (1 << dst)
|
|
128
|
+
H[index[m2], n] += -t * sign
|
|
129
|
+
return H, states, index
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def hubbard_1d_exact_diagonalization(
|
|
133
|
+
n_sites: int, n_up: int, n_dn: int, t: float = 1.0, U: float = 4.0, pbc: bool = False, return_eigenvectors: bool = False
|
|
134
|
+
) -> dict:
|
|
135
|
+
"""Exact diagonalization of the 1D Fermi-Hubbard model on a small cluster.
|
|
136
|
+
|
|
137
|
+
.. math::
|
|
138
|
+
|
|
139
|
+
H = -t \\sum_{\\langle ij\\rangle, \\sigma} c_{i\\sigma}^\\dagger c_{j\\sigma}
|
|
140
|
+
+ U \\sum_i n_{i\\uparrow} n_{i\\downarrow}
|
|
141
|
+
|
|
142
|
+
Builds the Fock-space Hamiltonian in the fixed :math:`(n_\\uparrow, n_\\downarrow)`
|
|
143
|
+
sector via full (dense) diagonalization; suitable for small clusters
|
|
144
|
+
(:math:`n_{sites} \\lesssim 8`).
|
|
145
|
+
|
|
146
|
+
Parameters
|
|
147
|
+
----------
|
|
148
|
+
n_sites : int
|
|
149
|
+
Number of lattice sites.
|
|
150
|
+
n_up, n_dn : int
|
|
151
|
+
Number of spin-up and spin-down electrons.
|
|
152
|
+
t : float, default=1.0
|
|
153
|
+
Nearest-neighbor hopping amplitude.
|
|
154
|
+
U : float, default=4.0
|
|
155
|
+
Onsite Coulomb repulsion.
|
|
156
|
+
pbc : bool, default=False
|
|
157
|
+
Periodic (``True``) or open (``False``) boundary conditions.
|
|
158
|
+
return_eigenvectors : bool, default=False
|
|
159
|
+
If ``True``, also return the ground-state vector and the occupation-
|
|
160
|
+
number bases it is expanded in, e.g. for
|
|
161
|
+
:func:`hubbard_spin_correlations`.
|
|
162
|
+
|
|
163
|
+
Returns
|
|
164
|
+
-------
|
|
165
|
+
dict
|
|
166
|
+
``{"ground_state_energy": float, "eigenvalues": ndarray, "dimension": int}``,
|
|
167
|
+
plus ``{"ground_state_vector": ndarray, "states_up": list, "states_dn": list}``
|
|
168
|
+
when ``return_eigenvectors=True``. ``ground_state_vector[a * len(states_dn) + b]``
|
|
169
|
+
is the amplitude of the product basis state ``(states_up[a], states_dn[b])``,
|
|
170
|
+
each an integer bitmask with bit ``i`` set if site ``i`` is occupied.
|
|
171
|
+
|
|
172
|
+
Notes
|
|
173
|
+
-----
|
|
174
|
+
In the large-\\ :math:`U` limit at half filling, double occupancy is
|
|
175
|
+
suppressed and the ground state approaches the Mott-insulating,
|
|
176
|
+
singly-occupied regime characteristic of spin-charge separation in 1D.
|
|
177
|
+
|
|
178
|
+
Examples
|
|
179
|
+
--------
|
|
180
|
+
The 2-site Hubbard dimer at half filling has the exact ground-state
|
|
181
|
+
energy :math:`E_0 = \\tfrac{1}{2}\\big(U - \\sqrt{U^2 + 16t^2}\\big)`:
|
|
182
|
+
|
|
183
|
+
>>> import numpy as np
|
|
184
|
+
>>> result = hubbard_1d_exact_diagonalization(n_sites=2, n_up=1, n_dn=1, t=1.0, U=4.0)
|
|
185
|
+
>>> E_exact = 0.5 * (4.0 - np.sqrt(4.0**2 + 16 * 1.0**2))
|
|
186
|
+
>>> bool(round(result["ground_state_energy"], 8) == round(E_exact, 8))
|
|
187
|
+
True
|
|
188
|
+
"""
|
|
189
|
+
H_up, states_up, _ = _hopping_sector_hamiltonian(n_sites, n_up, t, pbc)
|
|
190
|
+
H_dn, states_dn, _ = _hopping_sector_hamiltonian(n_sites, n_dn, t, pbc)
|
|
191
|
+
dim_up, dim_dn = len(states_up), len(states_dn)
|
|
192
|
+
dim = dim_up * dim_dn
|
|
193
|
+
|
|
194
|
+
H = np.kron(H_up, np.eye(dim_dn)) + np.kron(np.eye(dim_up), H_dn)
|
|
195
|
+
|
|
196
|
+
interaction = np.zeros(dim)
|
|
197
|
+
for a, mask_up in enumerate(states_up):
|
|
198
|
+
for b, mask_dn in enumerate(states_dn):
|
|
199
|
+
n_double = bin(mask_up & mask_dn).count("1")
|
|
200
|
+
interaction[a * dim_dn + b] = U * n_double
|
|
201
|
+
H += np.diag(interaction)
|
|
202
|
+
|
|
203
|
+
if return_eigenvectors:
|
|
204
|
+
eigenvalues, eigenvectors = np.linalg.eigh(H)
|
|
205
|
+
return {
|
|
206
|
+
"ground_state_energy": float(eigenvalues[0]),
|
|
207
|
+
"eigenvalues": eigenvalues,
|
|
208
|
+
"dimension": dim,
|
|
209
|
+
"ground_state_vector": eigenvectors[:, 0],
|
|
210
|
+
"states_up": states_up,
|
|
211
|
+
"states_dn": states_dn,
|
|
212
|
+
}
|
|
213
|
+
eigenvalues = np.linalg.eigvalsh(H)
|
|
214
|
+
return {"ground_state_energy": float(eigenvalues[0]), "eigenvalues": eigenvalues, "dimension": dim}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
def hubbard_spin_correlations(n_sites: int, ground_state_vector: np.ndarray, states_up: list, states_dn: list) -> np.ndarray:
|
|
218
|
+
"""Equal-time z-spin correlations :math:`\\langle S_i^z S_j^z\\rangle` from a Hubbard ground state.
|
|
219
|
+
|
|
220
|
+
:math:`S_i^z = \\tfrac{1}{2}(n_{i\\uparrow} - n_{i\\downarrow})` is diagonal
|
|
221
|
+
in the occupation-number basis
|
|
222
|
+
:func:`hubbard_1d_exact_diagonalization` builds its Hamiltonian in, so
|
|
223
|
+
:math:`\\langle S_i^z S_j^z\\rangle` reduces to a weighted sum over basis-state
|
|
224
|
+
probabilities, :math:`\\sum_\\alpha |\\psi_\\alpha|^2\\, s_i(\\alpha)\\, s_j(\\alpha)`,
|
|
225
|
+
with no off-diagonal matrix elements to track.
|
|
226
|
+
|
|
227
|
+
Parameters
|
|
228
|
+
----------
|
|
229
|
+
n_sites : int
|
|
230
|
+
Number of lattice sites.
|
|
231
|
+
ground_state_vector : ndarray
|
|
232
|
+
Ground-state amplitudes, as returned by
|
|
233
|
+
:func:`hubbard_1d_exact_diagonalization` with ``return_eigenvectors=True``.
|
|
234
|
+
states_up, states_dn : list of int
|
|
235
|
+
Occupation-number bases for each spin species, as returned alongside
|
|
236
|
+
``ground_state_vector``.
|
|
237
|
+
|
|
238
|
+
Returns
|
|
239
|
+
-------
|
|
240
|
+
ndarray, shape (n_sites,)
|
|
241
|
+
``correlations[r]`` is :math:`\\langle S_i^z S_j^z\\rangle` averaged
|
|
242
|
+
over every site pair with :math:`|i-j|=r`; ``correlations[0]`` is the
|
|
243
|
+
onsite :math:`\\langle (S_i^z)^2\\rangle`, suppressed toward 0 by
|
|
244
|
+
double/empty occupancy and toward its :math:`1/4` ceiling by strong
|
|
245
|
+
onsite repulsion.
|
|
246
|
+
|
|
247
|
+
Notes
|
|
248
|
+
-----
|
|
249
|
+
A Mott-insulating antiferromagnet's short-range Neel order shows up as
|
|
250
|
+
``correlations`` alternating in sign with ``r`` -- negative
|
|
251
|
+
(antialigned) at odd separations, positive (aligned) at even ones --
|
|
252
|
+
the same short-range magnetic correlations believed to survive doping
|
|
253
|
+
into the cuprate superconductors' metallic phase.
|
|
254
|
+
|
|
255
|
+
Examples
|
|
256
|
+
--------
|
|
257
|
+
At half filling and strong coupling, nearest-neighbor spins are
|
|
258
|
+
antialigned:
|
|
259
|
+
|
|
260
|
+
>>> import numpy as np
|
|
261
|
+
>>> result = hubbard_1d_exact_diagonalization(n_sites=6, n_up=3, n_dn=3, t=1.0, U=8.0, pbc=True, return_eigenvectors=True)
|
|
262
|
+
>>> corr = hubbard_spin_correlations(6, result["ground_state_vector"], result["states_up"], result["states_dn"])
|
|
263
|
+
>>> bool(corr[1] < 0)
|
|
264
|
+
True
|
|
265
|
+
"""
|
|
266
|
+
dim_dn = len(states_dn)
|
|
267
|
+
weights = np.abs(np.asarray(ground_state_vector)) ** 2
|
|
268
|
+
sz = np.zeros((len(weights), n_sites))
|
|
269
|
+
for a, mask_up in enumerate(states_up):
|
|
270
|
+
for b, mask_dn in enumerate(states_dn):
|
|
271
|
+
idx = a * dim_dn + b
|
|
272
|
+
for site in range(n_sites):
|
|
273
|
+
n_up_site = (mask_up >> site) & 1
|
|
274
|
+
n_dn_site = (mask_dn >> site) & 1
|
|
275
|
+
sz[idx, site] = 0.5 * (n_up_site - n_dn_site)
|
|
276
|
+
|
|
277
|
+
correlations = np.zeros(n_sites)
|
|
278
|
+
counts = np.zeros(n_sites)
|
|
279
|
+
for i in range(n_sites):
|
|
280
|
+
for j in range(n_sites):
|
|
281
|
+
r = abs(i - j)
|
|
282
|
+
correlations[r] += np.sum(weights * sz[:, i] * sz[:, j])
|
|
283
|
+
counts[r] += 1
|
|
284
|
+
return correlations / counts
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
r"""Ginzburg-Landau theory: the 1950 phenomenological theory of continuous phase transitions.
|
|
2
|
+
|
|
3
|
+
Landau and Ginzburg proposed that a superconductor (or any system undergoing
|
|
4
|
+
a continuous symmetry-breaking transition) is described entirely by a
|
|
5
|
+
complex order parameter :math:`\psi(\mathbf{r})` -- here, the Cooper-pair
|
|
6
|
+
condensate wavefunction -- through a free-energy functional expanded in
|
|
7
|
+
powers of :math:`\psi` and its gradient,
|
|
8
|
+
|
|
9
|
+
.. math::
|
|
10
|
+
|
|
11
|
+
f[\psi] = a|\psi|^2 + \frac{b}{2}|\psi|^4
|
|
12
|
+
+ \frac{\hbar^2}{2m}|\nabla\psi|^2,
|
|
13
|
+
|
|
14
|
+
built from symmetry alone, with no reference to the microscopic pairing
|
|
15
|
+
mechanism BCS would supply seven years later. Minimizing :math:`f` gives a
|
|
16
|
+
uniform condensate density :math:`|\psi_0|^2 = -a/b` below the transition
|
|
17
|
+
(:math:`a<0`) and two emergent length scales -- the coherence length
|
|
18
|
+
:math:`\xi` over which :math:`\psi` heals back from a boundary, and the
|
|
19
|
+
magnetic penetration depth :math:`\lambda` -- whose ratio
|
|
20
|
+
:math:`\kappa=\lambda/\xi` (the Ginzburg-Landau parameter) alone decides
|
|
21
|
+
whether a superconductor is Type I or Type II.
|
|
22
|
+
|
|
23
|
+
Uses the same natural-unit convention (:math:`\hbar=e=1`, and here also
|
|
24
|
+
:math:`\mu_0=1`) as the rest of :mod:`physicskit.condensed`.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
from __future__ import annotations
|
|
28
|
+
|
|
29
|
+
import numpy as np
|
|
30
|
+
|
|
31
|
+
__all__ = [
|
|
32
|
+
"gl_free_energy_density",
|
|
33
|
+
"gl_equilibrium_order_parameter",
|
|
34
|
+
"gl_coherence_length",
|
|
35
|
+
"gl_penetration_depth",
|
|
36
|
+
"ginzburg_landau_parameter",
|
|
37
|
+
"gl_order_parameter_profile",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def gl_free_energy_density(psi, a: float, b: float, grad_psi=0.0, hbar: float = 1.0, m: float = 1.0):
|
|
42
|
+
r"""Ginzburg-Landau free energy density :math:`f = a|\psi|^2 + \tfrac{b}{2}|\psi|^4 + \tfrac{\hbar^2}{2m}|\nabla\psi|^2`.
|
|
43
|
+
|
|
44
|
+
Parameters
|
|
45
|
+
----------
|
|
46
|
+
psi : complex or array_like
|
|
47
|
+
Order parameter value(s).
|
|
48
|
+
a : float
|
|
49
|
+
Quadratic coefficient. Changes sign at the transition (``a < 0``
|
|
50
|
+
in the ordered phase, ``a > 0`` in the disordered phase).
|
|
51
|
+
b : float
|
|
52
|
+
Quartic coefficient, ``b > 0`` for stability.
|
|
53
|
+
grad_psi : complex or array_like, default=0.0
|
|
54
|
+
Gradient :math:`\nabla\psi`, same shape as ``psi``.
|
|
55
|
+
hbar : float, default=1.0
|
|
56
|
+
Reduced Planck constant.
|
|
57
|
+
m : float, default=1.0
|
|
58
|
+
Effective mass of the condensate.
|
|
59
|
+
|
|
60
|
+
Returns
|
|
61
|
+
-------
|
|
62
|
+
float or ndarray
|
|
63
|
+
|
|
64
|
+
Examples
|
|
65
|
+
--------
|
|
66
|
+
>>> gl_free_energy_density(psi=0.0, a=-1.0, b=1.0)
|
|
67
|
+
0.0
|
|
68
|
+
>>> psi0 = gl_equilibrium_order_parameter(a=-1.0, b=1.0)
|
|
69
|
+
>>> round(gl_free_energy_density(psi0, a=-1.0, b=1.0), 6)
|
|
70
|
+
-0.5
|
|
71
|
+
"""
|
|
72
|
+
psi = np.asarray(psi, dtype=complex)
|
|
73
|
+
grad_psi = np.asarray(grad_psi, dtype=complex)
|
|
74
|
+
f = a * np.abs(psi) ** 2 + 0.5 * b * np.abs(psi) ** 4 + (hbar**2 / (2 * m)) * np.abs(grad_psi) ** 2
|
|
75
|
+
return float(f) if f.ndim == 0 else f
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def gl_equilibrium_order_parameter(a: float, b: float) -> float:
|
|
79
|
+
r"""Equilibrium (uniform, field-free) order parameter magnitude :math:`|\psi_0|=\sqrt{-a/b}`.
|
|
80
|
+
|
|
81
|
+
Parameters
|
|
82
|
+
----------
|
|
83
|
+
a : float
|
|
84
|
+
Quadratic coefficient.
|
|
85
|
+
b : float
|
|
86
|
+
Quartic coefficient, ``b > 0``.
|
|
87
|
+
|
|
88
|
+
Returns
|
|
89
|
+
-------
|
|
90
|
+
float
|
|
91
|
+
:math:`\sqrt{-a/b}` if ``a < 0`` (ordered phase), else ``0.0``
|
|
92
|
+
(disordered phase, only the normal state minimizes :math:`f`).
|
|
93
|
+
|
|
94
|
+
Examples
|
|
95
|
+
--------
|
|
96
|
+
>>> gl_equilibrium_order_parameter(a=-2.0, b=2.0)
|
|
97
|
+
1.0
|
|
98
|
+
>>> gl_equilibrium_order_parameter(a=1.0, b=2.0)
|
|
99
|
+
0.0
|
|
100
|
+
"""
|
|
101
|
+
return float(np.sqrt(-a / b)) if a < 0 else 0.0
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def gl_coherence_length(a: float, hbar: float = 1.0, m: float = 1.0) -> float:
|
|
105
|
+
r"""Ginzburg-Landau coherence length :math:`\xi = \hbar/\sqrt{2m|a|}`.
|
|
106
|
+
|
|
107
|
+
The length scale over which the order parameter heals back to its bulk
|
|
108
|
+
value after being suppressed at a boundary or a vortex core.
|
|
109
|
+
|
|
110
|
+
Parameters
|
|
111
|
+
----------
|
|
112
|
+
a : float
|
|
113
|
+
Quadratic coefficient (only its magnitude matters).
|
|
114
|
+
hbar : float, default=1.0
|
|
115
|
+
Reduced Planck constant.
|
|
116
|
+
m : float, default=1.0
|
|
117
|
+
Effective mass of the condensate.
|
|
118
|
+
|
|
119
|
+
Returns
|
|
120
|
+
-------
|
|
121
|
+
float
|
|
122
|
+
|
|
123
|
+
Examples
|
|
124
|
+
--------
|
|
125
|
+
>>> gl_coherence_length(a=-0.5)
|
|
126
|
+
1.0
|
|
127
|
+
"""
|
|
128
|
+
return float(hbar / np.sqrt(2 * m * abs(a)))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def gl_penetration_depth(psi0: float, e: float = 1.0, m: float = 1.0) -> float:
|
|
132
|
+
r"""London penetration depth :math:`\lambda = \sqrt{m/(e^2|\psi_0|^2)}`.
|
|
133
|
+
|
|
134
|
+
The length scale over which an external magnetic field is screened
|
|
135
|
+
from a superconductor's interior by the supercurrent it induces in the
|
|
136
|
+
condensate of density :math:`|\psi_0|^2`.
|
|
137
|
+
|
|
138
|
+
Parameters
|
|
139
|
+
----------
|
|
140
|
+
psi0 : float
|
|
141
|
+
Equilibrium order parameter magnitude (see
|
|
142
|
+
:func:`gl_equilibrium_order_parameter`).
|
|
143
|
+
e : float, default=1.0
|
|
144
|
+
Cooper-pair charge magnitude.
|
|
145
|
+
m : float, default=1.0
|
|
146
|
+
Effective mass of the condensate.
|
|
147
|
+
|
|
148
|
+
Returns
|
|
149
|
+
-------
|
|
150
|
+
float
|
|
151
|
+
|
|
152
|
+
Examples
|
|
153
|
+
--------
|
|
154
|
+
>>> gl_penetration_depth(psi0=1.0)
|
|
155
|
+
1.0
|
|
156
|
+
"""
|
|
157
|
+
return float(np.sqrt(m / (e**2 * psi0**2)))
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def ginzburg_landau_parameter(coherence_length: float, penetration_depth: float) -> float:
|
|
161
|
+
r"""Ginzburg-Landau parameter :math:`\kappa = \lambda/\xi`.
|
|
162
|
+
|
|
163
|
+
The single dimensionless number that decides a superconductor's
|
|
164
|
+
response to a magnetic field: :math:`\kappa < 1/\sqrt2` is Type I
|
|
165
|
+
(the normal-superconducting interface has positive surface energy, and
|
|
166
|
+
the field is excluded entirely below :math:`H_c`); :math:`\kappa >
|
|
167
|
+
1/\sqrt2` is Type II (negative surface energy favors flux penetrating
|
|
168
|
+
as an Abrikosov vortex lattice between :math:`H_{c1}` and
|
|
169
|
+
:math:`H_{c2}`).
|
|
170
|
+
|
|
171
|
+
Parameters
|
|
172
|
+
----------
|
|
173
|
+
coherence_length : float
|
|
174
|
+
:math:`\xi`, from :func:`gl_coherence_length`.
|
|
175
|
+
penetration_depth : float
|
|
176
|
+
:math:`\lambda`, from :func:`gl_penetration_depth`.
|
|
177
|
+
|
|
178
|
+
Returns
|
|
179
|
+
-------
|
|
180
|
+
float
|
|
181
|
+
|
|
182
|
+
Examples
|
|
183
|
+
--------
|
|
184
|
+
>>> round(ginzburg_landau_parameter(coherence_length=1.0, penetration_depth=1.0), 4)
|
|
185
|
+
1.0
|
|
186
|
+
"""
|
|
187
|
+
return float(penetration_depth / coherence_length)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def gl_order_parameter_profile(x, xi: float) -> np.ndarray:
|
|
191
|
+
r"""Order parameter healing profile :math:`\psi(x)/\psi_0 = \tanh(x/(\sqrt2\,\xi))`.
|
|
192
|
+
|
|
193
|
+
The exact solution of the dimensionless Ginzburg-Landau equation
|
|
194
|
+
:math:`\xi^2\psi'' = \psi^3-\psi` for a condensate pinned to zero at a
|
|
195
|
+
boundary (``x = 0``, e.g. a normal-superconducting interface) and
|
|
196
|
+
recovering its bulk value far from it -- the direct, textbook
|
|
197
|
+
illustration of the coherence length as a *healing length*.
|
|
198
|
+
|
|
199
|
+
Parameters
|
|
200
|
+
----------
|
|
201
|
+
x : array_like
|
|
202
|
+
Distance from the boundary.
|
|
203
|
+
xi : float
|
|
204
|
+
Coherence length, from :func:`gl_coherence_length`.
|
|
205
|
+
|
|
206
|
+
Returns
|
|
207
|
+
-------
|
|
208
|
+
ndarray
|
|
209
|
+
:math:`\psi(x)/\psi_0`, in :math:`[0, 1)` for :math:`x \geq 0`.
|
|
210
|
+
|
|
211
|
+
Examples
|
|
212
|
+
--------
|
|
213
|
+
>>> import numpy as np
|
|
214
|
+
>>> round(float(gl_order_parameter_profile(0.0, xi=1.0)), 8)
|
|
215
|
+
0.0
|
|
216
|
+
>>> bool(gl_order_parameter_profile(np.array([10.0]), xi=1.0)[0] > 0.999)
|
|
217
|
+
True
|
|
218
|
+
"""
|
|
219
|
+
x = np.asarray(x, dtype=float)
|
|
220
|
+
return np.tanh(x / (np.sqrt(2) * xi))
|