I am making a finite elements simulation of electrons in the bottom of the conduction band of some material. To do so I assume that the electrons move in the bottom of a flat well with their original mass replaced by the effective mass. The idea is to calculate wave functions for electrons living in the bottom of a heterostructure well, as for example in InGaAs, which has a potential profile as shown on the attached picture. However for the simulation I have some problems with the "discontinuity" of the kinetic energy operator across the InAs-GaAs interface. The kinetic energy is a matrix given by: -ħ2/2m_eff * 1/Δx2 *A , where A is a matrix defined by: A(i,i)=-2 A(i+1,i)=1 A(i,i+1)=1 ,i.e. the standard form for the second derivative in the finite element method. However across the interface the effective mass changes from the effective mass for InAs to the effective mass for InAs. How can I write up the matrix for the kinetic energy such that it "stitches" the wave functions from the two segments correctly together? If I did it analytically I would have some boundary conditions to use, but I need to do this numerically since I am going to develop it further in a way, where a numerical approach is crucial.