cotangent_bundle
cotangent_bundle.py — Symplectic geometry of cotangent bundles: from canonical structure to quantization
Overview
This module provides a symbolic‑numerical laboratory for exploring the
symplectic geometry of cotangent bundles before a Hamiltonian is chosen.
It demonstrates how the canonical symplectic form ω = dξ ∧ dx emerges
directly from the geometry of T*M, and how it alone determines the Poisson
bracket, Hamilton’s equations, and ultimately the link to quantum mechanics.
The package implements:
Construction of the canonical Liouville 1‑form
θand the symplectic formω = dθ.Verification that
ωis closed (dω = 0) and non‑degenerate (det ω ≠ 0).Derivation of Hamiltonian vector fields
X_Hfrom any symbolic HamiltonianH(x,ξ)via the intrinsic relationι_{X_H} ω = dH.Numerical integration of the Hamiltonian flow with preservation checks (energy, symplectic area, Jacobian determinant).
Symbolic and numerical study of Poisson brackets, Jacobi identity, and canonical commutation relations.
Visualisation of phase‑space trajectories, energy surfaces, and the symplectic area preserved by the flow.
Canonical transformations and their characterisation (preservation of ω).
A gentle introduction to the Dirac quantisation rule:
{f,g} ↦ (1/iℏ)[f̂,ĝ], illustrated with pseudo‑differential operators (through an external psiop module).
All computations are performed symbolically with SymPy and then lambdified for efficient numerical integration and visualisation with NumPy/SciPy and Matplotlib.
Mathematical background
Let M be an n‑dimensional manifold (here taken as ℝⁿ for simplicity).
The cotangent bundle T*M carries a canonical 1‑form (Liouville form)
defined in local coordinates (x¹,…,xⁿ, ξ₁,…,ξₙ) by
θ = ξ₁ dx¹ + … + ξₙ dxⁿ.
Its exterior derivative
ω = dθ = dξ₁ ∧ dx¹ + … + dξₙ ∧ dxⁿ
is a closed (dω = 0) and non‑degenerate 2‑form – the symplectic form.
Crucially, ω is independent of any Hamiltonian; it is a geometric
property of the bundle itself.
Given a smooth function H : T*M → ℝ (the Hamiltonian), the Hamiltonian vector field X_H is uniquely defined by
ι_{X_H} ω = dH.
In coordinates this yields the familiar Hamilton equations
˙xⁱ = ∂H/∂ξᵢ , ˙ξᵢ = −∂H/∂xⁱ.
The flow Φ_t generated by X_H preserves ω (Liouville’s theorem); in particular the symplectic volume (area in 1D) is conserved. The Poisson bracket of two observables f,g is defined by
{f,g} = ω(X_f, X_g) = Σᵢ (∂f/∂xⁱ ∂g/∂ξᵢ − ∂f/∂ξᵢ ∂g/∂xⁱ),
and satisfies the Jacobi identity. The canonical brackets
{xⁱ, ξⱼ} = δⁱⱼ , {xⁱ, xʲ} = {ξᵢ, ξⱼ} = 0
are direct consequences of ω.
Quantisation. The Dirac correspondence replaces Poisson brackets by commutators:
[f̂,ĝ] = iℏ {f,g} .
For the fundamental pair this gives the Heisenberg relation
[x̂ⁱ, p̂ⱼ] = iℏ δⁱⱼ. The module illustrates this by quantising a
classical Hamiltonian into a pseudo‑differential operator (using a
companion module psiop) and verifying the correspondence.
Canonical transformations. A change of coordinates (x,ξ) → (X,Ξ) is canonical iff it preserves ω, i.e. dΞ ∧ dX = dξ ∧ dx. Equivalently, the Jacobian matrix J satisfies Jᵀ ω J = ω. Several examples are provided, together with generating functions.
Higher dimensions. The code handles arbitrary dimension by building the block‑diagonal symplectic matrix
ω = [[0, -I], [I, 0]] .
References
- cotangent_bundle.canonical_symplectic_form_construction()[source]
Step-by-step construction of the canonical symplectic form on the cotangent bundle T*M
- cotangent_bundle.canonical_transformations_preserve_omega()[source]
Shows that canonical transformations preserve ω
- cotangent_bundle.complete_symplectic_example_unified()[source]
Complete example showing the ENTIRE pipeline: H → ω → X_H → Φₜ → Conserved quantities
Uses classes from psiop.py for integration
- cotangent_bundle.conceptual_architecture()[source]
High-level overview of the conceptual architecture
- cotangent_bundle.explicit_derivation_hamilton_equations()[source]
Explicitly derives Hamilton’s equations from only the data of ω and H
- cotangent_bundle.from_omega_to_flow(H_expr, vars_x)[source]
Shows how the symplectic structure ω allows passage from H (function) to X_H (vector field) to Φₜ (flow)
- cotangent_bundle.from_poisson_to_commutator()[source]
Shows the fundamental link between Poisson bracket (classical) and commutator (quantum) via correspondence
- cotangent_bundle.hamiltonian_vector_field(H_expr, vars_x)[source]
Computes the Hamiltonian vector field X_H from an arbitrary H
- cotangent_bundle.interactive_symplectic_dynamics(H_options)[source]
Interactive dashboard to explore different Hamiltonians with the SAME symplectic structure
- cotangent_bundle.poisson_bracket(f_expr, g_expr, vars_x)[source]
Poisson bracket {f, g} induced by ω
- cotangent_bundle.quantize_hamiltonian(H_classical, vars_x, mode='weyl')[source]
Quantizes a classical Hamiltonian into a pseudo-differential operator
H_classical(x, ξ) → Ĥ operator
mode: ‘weyl’ (symmetric) or ‘kn’ (Kohn-Nirenberg)
- cotangent_bundle.symplectic_structure_higher_dimensions(n=2)[source]
Shows how ω generalizes to arbitrary dimension
- cotangent_bundle.verify_canonical_relations(vars_x)[source]
Verifies the canonical commutation relations
- cotangent_bundle.verify_symplectic_preservation(H_expr, vars_x, t_max=1.0, n_times=10)[source]
Simplified and more robust version