Introduction

Modeling an interface between two materials is a highly valuable approach for various applications, including designing two-dimensional materials for advanced electronics, the development of battery materials for energy storage, and the integration of new materials into microelectronics1,2,3,4. However, modeling such interfaces accurately at the quantum scale in a periodic system poses significant challenges5. One source of difficulty is the need to model an interface system between materials with different lattice parameters. When two materials with different lattice parameters are joined together, the interface is usually incoherent, which means that the atomic positions do not align perfectly across the boundary. To accommodate the lattice mismatch, a strain field and a dislocation network are generated at the interface, which affect the mechanical and electronic properties of the heterostructure6.

Modeling mismatched interface systems would require a large unit cell that can capture both materials while keeping the boundary of the unit cell periodic. For example, interface systems with a 25% mismatch require a supercell consisting of three and four unit cells of each material along the interface plane, as shown schematically in Fig. 1. To represent relaxed interfaces between materials with smaller mismatches, even larger supercells are required. For instance, \({SiC}/{Si}\) interface with ~20% mismatch requires four and five unit cells of \({Si}\) and \({SiC}\), respectively, along the interface1. Similarly, the \({InAs}/{Si}\) interface, where the mismatch is approximately 12.5%, consists of seven unit cells of \({InAs}\) across from eight unit cells of \({Si}\) 2. The same principle applies to two-dimensional materials that do not match their substrate lattice parameter, such as \({Mo}{S}_{2}\) on \({Au}\) substrate, where the mismatch is ~9.1% thus require 11 unit cells of \({Mo}{S}_{2}\) atop 10 \({Au}\) unit cells3. Adding atomic layers parallel to the interface in those supercells increases the number of atoms significantly.

Fig. 1: Schematic of the relaxed interface with 25% mismatch.
figure 1

a Top view and b side view, with the supercell boundaries marked by dashed lines. Large teal and small blue spheres denote the two atom types; grey spheres mark atoms outside the supercell. The mismatched interface appears as rows of three teal spheres opposite four blue spheres.

Such large unit cells, often containing hundreds of atoms, which approach the upper limit of typical electronic structure calculations, are computationally expensive and time-consuming to simulate. Additionally, using large supercells to represent relaxed interfaces usually imposes some amount of biaxial strain to at least one of the materials, as the ratio between the relaxed lattice parameter of two lattices is rarely an exact ratio of small numbers1,2,3,4,7,8. The forced strain is another limitation when considering simulating mismatched interfaces.

The computational challenges of modeling mismatched interfaces with large supercells have been addressed through the development of several approximation methods and numerical techniques. Effective medium theories and cluster expansion methods, for example, allow for modeling of complex systems with reduced computational demands9,10. Techniques like k-point folding and symmetry-adapted perturbation theory facilitate the use of smaller supercells while capturing essential long-range interactions11. Advanced methods, including machine learning-based structure prediction, have also enabled the extrapolation of properties from simulations with smaller supercells, balancing computational efficiency with model accuracy. Despite decades of research addressing the issue of large system sizes, the challenge of accurately modeling interfaces with mismatches remains unresolved.

In this study, we propose an approach to simulate interfaces between materials with different lattice parameters that avoids the need for matching lattice parameters or employing very large supercells. By using a compact supercell with a single unit cell from each material and applying periodic boundary conditions with optimized basis functions, this method can achieve reliable results efficiently, minimizing artificial strain and enhancing computational efficiency.

Results

Novel method for modeling material interfaces

In this section, we presented a detailed description of our novel algorithm for constructing and solving the Kohn-Sham Hamiltonian matrix eigenvalue problem. Calculation of eigenvalues is a central step in performing density functional theory (DFT) calculations. We describe a solution suitable for a two-dimensional system, and only consider the \(\Gamma\) point in k-space for simplicity.

Novel basis set with changing periodicity

In the simulation of an interface system with a mismatch, a supercell is typically employed to model the system, utilizing the periodic nature of the cell and the application of Bloch’s theorem. However, when the mismatch is small, the supercell must be enlarged to accurately describe the system while maintaining the periodic boundary condition, thus making the simulation computationally expensive. According to the proposed novel method, the supercell can be reduced to contain a single unit cell of each material across the interface, as seen in Fig. 2. This modification effectively redefines the boundary, resulting in a supercell boundary that is no longer rectangular but consists of joined frames of varying sizes.

Fig. 2: Two types of supercells representing relaxed interface with 25% mismatch.
figure 2

Large teal and small blue spheres represent the two atom species. a The rectangular supercell (dashed line) defines the system’s periodicity. b The proposed smaller supercell (dashed line) redefines the periodicity; it is significantly smaller than in a. Grey spheres indicate atoms outside the cell.

Defining the supercell in this manner implies that the potential used to construct the Hamiltonian, as well as the system’s eigenvectors, are not rectangular in shape. This non-rectangular shape is illustrated in Fig. 3, which contains the potential energy of the system with the mismatched interface, and a spatial representation of an eigen-state from this system, obtained by using the proposed method.

Fig. 3: Potential energy surface and eigenstate map of the InAs/Si mismatched interface.
figure 3

a Two-dimensional potential energy of a mismatched interface system, modeled as InAs/Si. On one side of the interface, the lattice parameter is marked \({L_X^A}\), and on the other side of the interface, the lattice parameter is \({L_X^B}\). b Two-dimensional spatial representation of an eigen-state, in absolute square, for the same interface system, corresponding to energy of 6.15 eV. Both the potential and the eigen-state are defined in a frame that is not rectangular.

To model an interface system with a mismatch according to this method, there is a need for a novel basis set of functions that change their periodicity along the interface direction and are adapted to the lattice parameter of each material, thus mimicking the periodicity pattern represented by the corresponding supercell. The proposed basis set, which allows this change, is based on the plane waves basis set. It includes an additional factor, denoted as \({f}_{\left(z\right)}\) in Eq. 1, which depends on the distance from the interface:

$${\varphi }_{n}\left(z,x\right)={e}^{\frac{2\pi i* {n}_{z}* z}{{L}_{z}}}* {e}^{\frac{2\pi i* {n}_{{\rm{x}}}* x}{{f}_{\left(z\right)}}}$$
(1)

Here \({n}_{z}\) and \({n}_{x}\) are quantum numbers integers along the z and x directions, respectively. \({L}_{z}\) is the length of the supercell along the z direction, while \({f}_{\left(z\right)}\) is the function that defines the effective periodic boundary and the length of the supercell along the x direction. The \({f}_{\left(z\right)}\) function can be chosen to be any function, where \({f}_{\left(z\right)}\) equals the lattice parameter of material A at one side of the interface and equals the lattice parameter of material B at the second side of the interface as illustrated in Fig. 4. The \({f}_{\left(z\right)}\) function complies with the system’s periodic boundary, meaning that its period corresponds to the system’s length in the z-direction (Eq. 2). It is possible to define different transition functions as \({f}_{\left(z\right)}\).

$$f\left(z\right)=f\left(z+{L}_{z}\right)$$
(2)
Fig. 4: Periodic transition function between two lattice parameters.
figure 4

Function \({f}_{\left(z\right)}\) represents a smooth transition between the lattice parameter \({L_X^A}\) of material A and \({L_X^B}\) of material B along the z-axis. The point labeled as interface indicated the region where the transition occurs. The function \({f}_{\left(z\right)}\) is periodic with respect to the system’s length \({L_Z}\).

The basis set’s boundary condition, defined in Eq. 3, will produce eigenstates with similar periodicity, which results from solving the eigenvalue problem with this basis set, as can be seen in Fig. 3. The boundary condition in the normal direction to the interface is similar to the periodic boundary condition in the usual plane waves basis set Fig. 5.

$${\varphi}_{n}(z,x)={\varphi}_{n}\left(z+{L}_{z},\,x+f_{(z)}\right)$$
(3)
Fig. 5: Spatial representation of three basis functions showing periodicity change.
figure 5

Real part of a three basis functions, denoted \(\varphi_{({nz}=1,{nx}=1)}\), \(\varphi_{({nz}=2,{nx}=1)}\) and \(\varphi_{({nz}=1,{nx}=3)}\). All three basis functions show periodicity change in x direction at a certain region in the z axis. The shape of the defined functions is not rectangular, as it follows the periodicity change and thus keeps the boundaries periodic.

The basis set functions are orthogonal between themselves, except when the quantum number in the direction parallel to the interface, \({n}_{x}\), is identical (see Eq. 4):

$$\begin{array}{c}\left\langle {\varphi }_{m}|{\varphi }_{n}\right\rangle ={\int }_{0}^{{L}_{z}}{\int }_{0}^{{f}_{\left(z\right)}}{e}^{\frac{2\pi i* \left({n}_{z}-{m}_{z}\right)* z}{{L}_{z}}}* {e}^{\frac{2\pi i* \left({n}_{x}-{m}_{x}\right)* x}{{f}_{\left(z\right)}}}{dx}* {dz}=\\\left\{\begin{array}{c}{for}\,{n}_{x}\ne {m}_{x},\,{\displaystyle\int }_{0}^{{L}_{z}}{e}^{\frac{2\pi i* \left({n}_{z}-{m}_{z}\right)* z}{{L}_{z}}}* \left(\frac{{f}_{\left(z\right)}}{2\pi i* \left({n}_{x}-{m}_{x}\right)}\right)* \left({e}^{2\pi i* \left({n}_{x}-{m}_{x}\right)}-1\right){dz}=0\\ {for}\,{n}_{x}={m}_{x},\,{\displaystyle\int}_{0}^{{L}_{z}}{e}^{\frac{2\pi i* \left({n}_{z}-{m}_{z}\right)* z}{{L}_{z}}}* {f}_{\left(z\right)}{dz}\ne 0\end{array}\right.\end{array}$$
(4)

Unlike plane waves, two basis functions are not orthogonal to each other if \({n}_{x}={m}_{x}\), even if \({n}_{z}={m}_{z}\) because of the added \({f}_{\left(z\right)}\) function. Because the basis set is not completely orthogonal, the overlap matrix \({S}_{{mn}}=\langle {\varphi }_{m}|{\varphi }_{n}\rangle\) is needed and used in the generalized eigenvalue problem.

Numerical demonstrations and test cases

In this section we describe the results of applying our novel method to two systems, using two-dimensional test potential energies. We compare our results with those obtained from the conventional plane wave method using larger supercells. The interfaces examined involve Silicon (Si) and two other semiconductor materials - Silicon Carbide (SiC) and Indium Arsenide (InAs). These material combinations are highly relevant in the semiconductor industry, where they find applications in a diverse array of electronic and optoelectronic devices1,2. The Si/SiC and Si/InAs interfaces were specifically chosen for this study due to the significant lattice mismatch that exists between the constituent materials. This lattice mismatch is substantial enough and cannot be ignored when considering the properties and behavior of these heterojunctions. At the same time, the magnitude of the mismatch falls within a range that still allows for the use of conventional computational methods and simulation techniques to model and analyze these interfaces and therefore provide good test cases for comparison12,13,14,15,16,17,18.

We tested the validity of our new basis set by applying it to a system of quantum harmonic oscillators as described in the SI.

The detailed procedure for constructing two-dimensional interface models from bulk DFT potentials is provided in the SI.

Demonstrating with InAs/Si interface

The InAs/Si system exhibits 12.5% mismatch in lattice parameters. The bulk InAs was modeled with a zinc-blende structure and lattice parameter of 6.24 Å, while the Si bulk was modeled with a diamond structure and lattice parameter of 5.46 Å. The conventional InAs/Si supercell was created by appending the potential of eight unit cells of bulk Si, and the potential of seven unit cells of bulk InAs, with the interface oriented along the (100) plane for both materials. Both the conventional and the reduced supercells are shown in Fig. 6. Due to the periodic boundary conditions implemented in our model, both interface terminations (In and As) are inherently present, one at the center of the simulation cell and one at the boundary, as detailed in the Supplementary Information. The two supercell potentials were incorporated into the code as inputs. The corresponding eigen-states and their eigen-energies were computed using either the conventional PW method or the novel basis set functions.

Fig. 6: Potential energy of the InAs/Si interface in two supercell representations.
figure 6

a Rectangular conventional supercell contains eight unit cells of Si across seven unit cells of stoichiometric InAs. b Reduced supercell includes only single unit cell of each material on both sides of the interface.

A test was performed to assess the convergence of eigen-energies within the system, utilizing both PW and the novel basis set. As depicted in Fig. 7, the test focused on the two lowest eigen-energies of the InAs/Si interface, modeled using a reduced supercell. The results demonstrate that the new basis set achieves convergence comparable to the PW basis set. A stability threshold of less than 0.01 eV was attained by both basis sets when the energy cut-off was set to at least 350 eV. Energy cut-off of 350 eV was thus used for comparing between both methods.

Fig. 7: Convergence of the lowest two eigen-energies using two basis sets.
figure 7

\(E_0\) and \(E_1\) are the lowest eigen-energies of the InAs/Si interface system represented by a reduced supercell. Hollow squares mark values obtained with a plane wave basis set, and filled circles mark values obtained with the suggested novel method using a modified basis set.

A comparison of the lowest eigen-energies derived from both methods validated the effectiveness of the proposed method. There was excellent agreement between the lowest eigen-energies obtained from both methods, and the spatial distribution of the eigen-states are also consistent across both methods, as depicted in Fig. 8. The first two eigenstates seen in Fig. 8 are spatially delocalized on the entire interface, while the next two eigenstates are located on each side of the interface. It’s noteworthy that employing a larger supercell leads to the emergence of additional eigenstates, a result that can be attributed to the band folding effect of using supercells11.

Fig. 8: Eigenstate distributions for the two-dimensional InAs-Si interface by two methods.
figure 8

Each eigen-states shown on the left was derived using a traditional method on an extensive supercell. The corresponding eigen-states on the right pane were obtained by the novel method with a reduced unit cell. A darker color indicates a higher probability.

We compared two different interface configurations within the supercell. As detailed in the Supplementary Information, the eigenstate spatial distributions maintain their characteristic patterns across configurations. The slight differences in eigenvalues between configurations (ranging from 0.03–0.09 eV) suggest an effect similar to small variations in k-vector sampling.

Demonstrating with SiC/Si Interface

The SiC/Si interface is characterized by a lattice parameter mismatch of 25%. The bulk SiC was represented using a zinc-blende structure with a lattice parameter of 4.36 Å, while the Si bulk was modeled with a diamond structure and lattice parameter of 5.45 Å. To construct the conventional SiC/Si supercell, we combined the potentials from four unit cells of bulk Si, and five unit cells of SiC bulk, with the interface oriented along the (100) plane for both materials. In constructing this interface, we expanded the SiC potential unit cell to ensure that the interface consisted of a layer of carbon atoms on the SiC side and silicon atoms on the Si side. Figure 9 illustrates both the conventional and reduced supercells. The full supercells and reduced supercells were used as inputs to the code. The eigenstates and their corresponding eigen-energies were calculated using either the traditional PW method or a novel basis set functions for comparison. Energy cut-off of 350 eV was used for comparing between both methods.

Fig. 9: Potential energy of a SiC/Si interface system in two supercell representations.
figure 9

a Rectangular conventional supercell containing four unit cells of Si across five unit cells of SiC. b Reduced supercell includes only a single unit cell of each material on both sides of the interface.

A comparison of the lowest eigen-energies calculated using both methods gives an initial assessment of the effectiveness of the proposed approach. Excellent agreement was observed between the lowest eigen-energies obtained from the two methods, and the spatial distribution of the eigen-states was also consistent across both techniques, as illustrated in Fig. 10. This figure shows that the eigen-states are either delocalized over the entire interface or localized on each side of the interface, a result that holds regardless of the method employed.

Fig. 10: Eigenstate distributions for the two-dimensional SiC–Si interface by two methods.
figure 10

Each eigen-states shown on the left was derived using a traditional method on an extensive supercell. The corresponding eigen-states on the right pane were obtained by the novel method. Darker color indicates higher probability.

We investigated the eigen-energy full spectra for the SiC/Si interface system and compared the eigen-energies extracted using the reduced supercell method against the conventional full supercell method. Figure 11 presents a visual comparison between the eigenvalue spectra obtained from these two approaches, highlighting the correspondence between their respective energy levels and associated eigenstates. Numerous eigen-energies are consistent across both methods. However, the full supercell method introduces additional eigen-energies, which can be attributed to the band folding effect inherent in the use of supercells11. Certain eigenstates derived from the reduced supercell method do not correspond to any eigenenergy obtained from the full supercell calculation. These eigenstates could potentially be explained by performing the calculation in k-space other than the \(\Gamma\) point. To confirm that the matched eigenvalues are not coincidental, we manually compared their symmetry character and spatial representations, as illustrated in Fig. 10.

Fig. 11: Eigenvalue spectra comparison between reduced and full supercell methods.
figure 11

Black lines (left axis) for reduced supercell; grey lines (right axis) for full supercell. Matching eigenvalues are connected by bridging lines.

Discussion

This article introduces an innovative algorithm addressing a challenge in computational materials science: accurately modeling interfaces between materials with different lattice parameters. Traditional density functional theory (DFT) methods face significant limitations in this area, typically requiring either large supercells or introducing artificial strain, which results in high computational costs and potential inaccuracies. Our novel approach overcomes these limitations by adaptively tuning plane-wave basis sets to match the periodic structure of each material across the interface, eliminating the need for extensive supercells or compromised lattice parameters.

The key innovation lies in our idea of adaptive basis sets that spatially adjust their periodicity along the interface direction, specifically tailored to the lattice parameters of each material. This method solves the eigen value problem while significantly reducing computational costs. The algorithm efficiently calculates the eigen-energies of mismatched systems, representing an important first step in the way of performing full DFT calculations with the proposed method.

Validation studies using two-dimensional potentials of InAs/Si and SiC/Si interfaces demonstrate the method’s effectiveness. Despite using significantly smaller supercells, our approach shows excellent agreement with traditional basis sets in both eigen-energies and spatial distribution, though accuracy decreases at higher energies and does not perfectly reproduce the complete eigenvalue spectra. This enhanced computational efficiency makes it possible to study complex material systems that were previously impractical to model.

Our method shows clear promise for further developments and practical applications. A key planned enhancement is the extension to non-zero k points beyond the Γ point, which will enable comprehensive exploration of full band structures and electronic properties. We are also actively working on a full three-dimensional implementation that will handle systems with lattice mismatches in multiple dimensions. Our approach can be extended by defining position-dependent periodicity functions for both in-plane dimensions (\({f}_{x}(z)\) and \({f}_{y}(z)\)). The mathematical framework we’ve developed is fully compatible with this extension. Extending to more dimensions is important when dealing with lattice-mismatched materials that have different periodicities in both in-plane dimensions. We acknowledge that our current treatment of the interface region is a simplification that could be refined. Future work will explore varying the periodicity near interfaces to better capture interface-specific characteristics while maintaining computational efficiency in bulk regions. Looking forward, this approach has the potential to transform interface modeling by enabling more efficient and accurate calculations of mismatched interfaces.

Methods

Hamiltonian construction algorithm

We have developed a program to construct the Kohn-Sham Hamiltonian of two-dimensional mismatched interface potential, using our novel method. The code also solves the generalized eigenvalue problem with the new basis set (Eq.1). The code is available in the SI.

Input requirements and preprocessing steps

The algorithm requires several inputs as detailed in section a of Fig. 12. Firstly, a potential that describes the system using a two-dimensional matrix, \(V\), is needed. For testing the program, the total potential from calculations performed by the Vienna Ab Initio Simulation Package (VASP) is primarily used19,20,21. This three-dimensional potential is converted to two dimensions by averaging over one of the axes. Additionally, a transition function is required to define the perpendicular periodicity along the interface direction, represented as a vector, \({f}_{\left(z\right)}\). The length of the \({f}_{\left(z\right)}\) vector should match the size of the potential matrix in the interface dimension. The sizes of the system’s bounding box, \({L}_{Z}\) and \({L}_{X}\), are also necessary to establish the system’s spatial dimensions. Finally, the cut-off energy is needed to determine the size of the basis set by defining all allowed combinations of \({n}_{z}\) and \({n}_{x}\), which are the quantum numbers for the basis set.

Fig. 12: Flowchart of the Hamiltonian matrix construction algorithm.
figure 12

Steps: a input parameters, b structuring inputs, c block-matrix multiplication to build the Hamiltonian, d completing the assembly, e solving the generalized eigenvalue problem, f generating outputs.

Basis set generation

The inputs are processed into column and row vectors, as mentioned in section b of Fig. 12. The spatial column vectors are systematically arranged in accordance with a mesh grid of spatial points, while excluding points that fulfill the condition \(X > {f}_{\left(z\right)}\), thereby lying outside the supercell boundary. Conversely, the row vectors, representing quantum numbers \({n}_{z}\) and \({n}_{x}\), are constructed based on a mesh grid of reciprocal space points, omitting any values that do not comply with the cut-off energy. In a similar manner to the Plane Waves basis set, it is necessary to define a cut-off energy that determines the number of basis functions used for modeling. Higher energy cut-off means more basis functions and higher accuracy of calculation, while making the calculation time longer. Cut-off energy can be determined by checking for convergence of properties up to a certain criteria. The quantum numbers values, \({n}_{z}\) and \({n}_{x}\), that fulfill the cut-off criteria, define the number of basis functions and the size of the Hamiltonian matrix. Usually, the cut-off criteria is defined as shown in Eq. 5:

$${\left(\left|G+k\right|\right)}^{2}* \frac{{\hslash }^{2}}{2m} < {E}_{{cut}-{off}},{where}\,\,G=\frac{2\pi {n}_{i}}{{L}_{i}}$$
(5)

The proposed method and basis set require choosing the quantum numbers values that correspond to the minimal lattice parameter along the interface direction:

$$\left(\frac{4{\pi }^{2}{n}_{x}^{2}}{{\min \left({f}_{(z)}\right)}^{2}}+\frac{4{\pi }^{2}{n}_{z}^{2}}{{L}_{z}^{2}}\right)* \frac{{\hslash }^{2}}{2m} < {E}_{{cut}-{off}}$$
(6)

Block-wise construction of Hamiltonian matrix

The Hamiltonian and the basis overlap matrix are built according to the block matrix multiplication approach, as detailed in section c of Fig. 12. The matrices were calculated block after block, ordered by their rows and grouped by columns. In every loop, the matrix block is calculated by matrix multiplication defined in Eq. 7:

$${H}_{i,j}=\sum _{k}{\varphi }_{i}^{k}\left(-\frac{{\hslash }^{2}}{2m}{\Delta \varphi }_{j}^{k}+{V}^{k}* {\varphi }_{j}^{k}\right)$$
(7a)
$${S}_{i,j}=\sum _{k}{\varphi }_{i}^{k}{\varphi }_{j}^{k}$$
(7b)

Where \({H}_{i,j}\) is the Hamiltonian block, and \({S}_{i,j}\) is the overlap matrix block. The potential is denoted by \(V\), while \({\varphi }_{i}\) and \({\varphi }_{j}\) represent the basis functions associated with the matrix block in question. Furthermore, \(\triangle {\varphi }_{j}\) is the result of applying the Laplacian operator to the corresponding basis function. The index \(k\) indicates summation over all space points.

To optimize the computation of matrix blocks, several time-saving strategies are implemented. First, we avoid calculating blocks from the lower part of the large matrices by leveraging the Hermitian nature of the Hamiltonian and basis overlap matrices. This characteristic allows us to infer these lower blocks from their corresponding upper blocks, as detailed in section d of Fig. 12. Second, for blocks that are not from the first row of blocks, there is no need to construct the basis set matrix or calculate its Laplacian product of the block’s column (the same bra 〈|). Instead, we retain these matrices in memory to enhance computational efficiency. Lastly, when processing blocks within the diagonal section, the basis matrix of the block row is identical to that of the block’s column basis set, enabling us to simply replicate it rather than compute it anew.

Laplacian operator

The construction of the Hamiltonian requires the application of the Laplacian operator to the basis functions during the computation of the kinetic term. Unlike the conventional Plane Waves basis set, which allows for the second derivative to be easily calculated through scalar multiplication (refer to Eq. 8a), the second derivative becomes more complex with our proposed basis set, as depicted in Eq. 8b. Nevertheless, our code adopts a streamlined method for computing the product of the Laplacian operator. It borrows the form from the Plane Waves basis set and omits the terms involving the derivative of \({f}_{\left(z\right)}\), as illustrated in Eq. 8c. This method not only improves the accuracy of the results significantly due to numerical instability in calculating derivatives but also enhances computational efficiency.

$${\Delta {\varphi }_{n}=\nabla }^{2}\left({e}^{\frac{2\pi i* {n}_{z}* z}{{L}_{z}}}* {e}^{\frac{2\pi i* {n}_{x}* x}{{L}_{x}}}\right)=\left({\left(\frac{2\pi i* {n}_{z}}{{L}_{z}}\right)}^{2}+{\left(\frac{2\pi i* {n}_{x}}{{L}_{x}}\right)}^{2}\right)* {\varphi }_{n}$$
(8a)
$$\begin{array}{c}{\Delta {\varphi }_{n}=\nabla }^{2}\left({e}^{\frac{2\pi i* {n}_{z}* z}{{L}_{z}}}* {e}^{\frac{2\pi i* {n}_{x}* x}{{f}_{\left(z\right)}}}\right)=\\\left(\begin{array}{c}{\left(\frac{2\pi i* {n}_{z}}{{L}_{z}}\right)}^{2}+{\left(\frac{2\pi i* {n}_{x}}{{f}_{\left(z\right)}}\right)}^{2}+\frac{2\pi i{* n}_{x}* x* {f}_{\left(z\right)}^{{\prime} {\prime} }}{{f}_{\left(z\right)}^{2}}\\ -\frac{4\pi i* {n}_{x}* x* {\left({f}_{\left(z\right)}^{{\prime} }\right)}^{2}}{{f}_{\left(z\right)}^{3}}-\frac{8{\pi }^{2}* {n}_{x}* {n}_{z}* x* {f}_{\left(z\right)}^{{\prime} }}{{f}_{\left(z\right)}^{2}* {L}_{z}}+{\left(\frac{2\pi i* {n}_{x}* x* {f}_{\left(z\right)}^{{\prime} }}{{f}_{\left(z\right)}^{2}}\right)}^{2}\end{array}\right)* {\varphi }_{n}\end{array}$$
(8b)
$${\Delta {\varphi }_{n}=\nabla }^{2}\left({e}^{\frac{2\pi i* {n}_{z}* z}{{L}_{z}}}* {e}^{\frac{2\pi i* {n}_{x}* x}{{f}_{\left(z\right)}}}\right)=\left({\left(\frac{2\pi i* {n}_{z}}{{L}_{z}}\right)}^{2}+{\left(\frac{2\pi i* {n}_{x}}{{f}_{\left(z\right)}}\right)}^{2}\right)* {\varphi }_{n}$$
(8c)

Solving the generalized eigenvalue problem

The generalized eigenvalue problem of the complete Hamiltonian matrix written in section e of Fig. 12 is solved by the efficient eig function in MATLAB22,23. The outputs from this solution are the eigen-energies and eigen-states of the interface. The eigen-states can be optionally converted to spatial representation by matrix multiplication with the basis set.