Skip to content

added parameter estimation tutorial for schrodinger equation#79

Open
a-b-h-a-y-s-h-i-n-d-e wants to merge 2 commits into
deepforestsci:mainfrom
a-b-h-a-y-s-h-i-n-d-e:tutorial_schrodinger
Open

added parameter estimation tutorial for schrodinger equation#79
a-b-h-a-y-s-h-i-n-d-e wants to merge 2 commits into
deepforestsci:mainfrom
a-b-h-a-y-s-h-i-n-d-e:tutorial_schrodinger

Conversation

@a-b-h-a-y-s-h-i-n-d-e
Copy link
Copy Markdown
Contributor

@a-b-h-a-y-s-h-i-n-d-e a-b-h-a-y-s-h-i-n-d-e commented May 19, 2026

image image image image image image image image image image image

@@ -0,0 +1,618 @@
Parameter Learning of the Schrödinger Equation
===============================================

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add context on what Schrödinger's equation models (the physics and mathematics)

time-dependent Schrödinger equation using gradient descent in Physika.
The Schrödinger equation is a partial differential equation that governs
the evolution of the wave function of a non-relativistic quantum-mechanical
system.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please briefly describe what a "non-relativistic quantum-mechanical
system" is

\frac{\partial \psi}{\partial t} = -\frac{i}{\hbar} \left( -\frac{\hbar^2}{2m} \frac{\partial^2 \psi}{\partial x^2} + V(x)\psi \right)
\end{align*}

This is the RHS of the Schrödinger equation — the rate of change of the
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this

.. code-block:: text

Nx : ℕ = 1024
x : ℝ[Nx] = linspace(-200, 200, Nx)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make sure this (and other tutorials) runs properly with the new type system

hbar : ℝ = 1.0
mass : ℝ = 1.0

The timestep is chosen using the CFL stability condition for the
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please describe whar CFL is

Nt : ℕ = 3271


The Initial Condition — Gaussian Wave Packet
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets remove "The"

return history


.. note::
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's implement this with physika


x0 : ℝ = -50.0 # initial position
k0 : ℝ = 2.0 # wavenumber (controls momentum)
sigma : ℝ = 10.0 # width of the wave packet
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use greek letters?

psi0 = (1 / sigma*sqrt(3.14))**0.5 * exp(1j * k0 * x) * exp(-((x - x0)**2) / (2 * sigma**2))


Discretizing the RHS
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does RHS refer to? I understand is d𝜓/dt from above, but please lets make it more explicit.

Discretizing the RHS
---------------------

We discretize space into :math:`N_x` points with uniform spacing
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add an explanation about discretization, why is relevant? What is the purpose of discretization?

\end{align*}

When the wave packet hits this barrier, part of it is reflected and part
tunnels through — a purely quantum mechanical phenomenon with no classical
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of this text "— a purely quantum mechanical phenomenon with no classical

analogue"? If its not adding, lets remove it

When the wave packet hits this barrier, part of it is reflected and part
tunnels through — a purely quantum mechanical phenomenon with no classical
analogue. The ratio of transmitted to reflected probability depends
sensitively on :math:`V_0`, which is why it is a learnable parameter.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that "The ratio of transmitted to reflected probability depends
sensitively on :math:V_0" implies "a learnable parameter." but the parameter we are trying to learn


def adam(bh: ℝ, g: ℝ, m: ℝ, v: ℝ, t: ℝ, lr: ℝ) : ℝ[4]:
beta1: ℝ = 0.9
beta2: ℝ = 0.999V: ℝ[Nx] = make_potential(1.8)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like V: ℝ[Nx] = make_potential(1.8) is a new line

scalar.


.. figure:: /_static/tutorial_files/pred_results_plot.gif
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice results!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants