How to model quantum wells¶
This tutorial shows you how to use SigSpace to study one of the most commonly used model systems: a 1D quantum well. You will learn how to create Hamiltonian operators, solve them, and reproduce key properties of quantum wells.
Define the system to solve¶
The first step is to define the system we want to study. This information is stored in the Hamiltonian. Therefore, we need to define the Hamiltonian in order to solve the problem:
import sigspace as sg
H = sg.Hamiltonian(sdims=1)
H += 1.23
print(H)
The first line imports the SigSpace library. Next, we define an empty Hamiltonian. The argument sdims specifies the number of spatial dimensions (in this case, we are working with a 1D problem).
You can treat the Hamiltonian like a mathematical object, adding terms as needed. For example, we could add a constant term, as shown in the third line. Later, we'll see how to add more complex terms to model more interesting problems.
The final line prints a summary of the Hamiltonian, which looks like this:
-0.5*Δ + 1.23 Eh
Every Hamilton operator always includes the kinetic energy term (-0.5*Δ), which is the default and cannot be modified. The second term, 1.23 Eh
, represents the constant we added earlier. “Eh” is the symbol for Hartree, the unit of energy in atomic units. Internally, all computations are performed in atomic units to ensure a good numerical stability.
Let's calculate something¶
Now, let’s define a new Hamiltonian with a custom potential and solve it:
import sigspace as sg
import numpy as np
def Vfun(x):
return -1/(1+x ** 2)
H = sg.Hamiltonian(sdims=1) + Vfun
solver = sg.Solver(H)
solver.grid(-10, 10, 200)
sol = solver.run()
sg.quickplot(sol)