Skip to content

Add Classical and Quantum Hamiltonian functions to physics algorithms #13235

@morgen-code

Description

@morgen-code

Feature description

I would like to suggest adding functions for the Hamiltonian in both classical mechanics and quantum mechanics
to the physics directory.

Proposed functions

  1. Classical Hamiltonian
    Computes H = T + V for a particle or system, where T is kinetic energy and V is potential energy.
    Example use case: free particle, harmonic oscillator, simple pendulum.

  2. Quantum Hamiltonian (1D)
    Constructs the Hamiltonian matrix for a particle in a 1D potential using finite difference discretization.
    Example use case: solving the time-independent Schrödinger equation.

Benefits

Provides a practical way for learners to understand and simulate physical systems in Python.
Fits the existing educational purpose of the physics directory as a collection of algorithmic implementations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis PR modified some existing files

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions