# A Hybrid Key Generator Model Based on Multiscale Prime Sieve and Quantum-Inspired Approaches
## Appendix A Detailed Explanation of the Schrodinger Equation in the Five Algorithms  
In our quantum key generation algorithms, we used the Schrodinger equation to generate cryptographic keys based on quantum randomness. Here, we explain how we used the Schrodinger equation, discretised it, and finally transformed it into a 2048-bit decimal string. We will refer to ultra-optimised implementations for each method. 1. The Schrodinger Equation and its Discretisation  
The time-independent Schrodinger equation is given by:  
\[\hat{H}\psi(x)=E\psi(x)\]  
where:  
* \(\hat{H}\) is the Hamiltonian operator representing the total energy of the quantum system;
* \(\psi(x)\) is the wavefunction, which describes the probability amplitude of a particle's position;
* \(E\) is the energy eigenvalue associated with the quantum state. For a single particle in a potential \(V(x)\), the Hamiltonian is:  
\[\hat{H}=-\frac{\hbar^{2}}{2m}\frac{d^{2}}{dx^{2}}+V(x)\]  
where:  
* \(\frac{d^{2}}{dx^{2}}\) is the second derivative operator, representing the kinetic energy;
* \(V(x)\) is the potential energy acting on the particle;
* \(\hbar\) is the reduced [PERSON]'s constant and \(m\) is the particle mass. Since we cannot solve this equation analytically for complex potentials, we discretise it using numerical methods. 2. Discretisation of the Schrodinger Equation  
To solve the Schrodinger equation numerically, we use a finite difference method. We replace the second derivative by a discrete Laplacian on a grid of \(N\) points:  
\[\frac{d^{2}\psi}{dx^{2}}\approx\frac{\psi_{i+1}-2\psi_{i}+\psi_{i-1}}{\Delta x ^{2}}\]  
where:  
* \(\psi_{i}\) is the wavefunction value at grid point \(i\);
* \(\Delta x\) is the discretised step size. The Hamiltonian then becomes a tridiagonal matrix:  
\[H=\frac{\hbar^{2}}{2m\Delta x^{2}} \begin{pmatrix}2+V_{1}&-1&0&\dots&0\\ -1&2+V_{2}&-1&\dots&0\\ 0&-1&2+V_{3}&\dots&0\\ \dots&\dots&\dots&\dots&-1\\ 0&0&0&-1&2+V_{N}\end{pmatrix} \]  
We solve this matrix eigenvalue problem using numerical diagonalisation to find the energy eigenvalues \(E_{N}\), which are then mapped to a cryptographic key. 3. Generating the 2048-bit Decimal Sequence  
(a) Schrodinger-Based Key Generation (Ultra-Optimised)  
We solve the eigenvalue problem for a random quantum potential. The eigenvalues, which are real numbers, are extracted. We take the absolute values and convert them into a decimal sequence. We select the first 256 decimal digits to generate a 2048-bit key. Mathematical Steps:  
1. Solve numerically;  
2. Extract eigenvalues;  
3. Convert eigenvalues into absolute integer values;  
4. Construct a string of decimal digits;  
5. Take the first 256 digits (since each decimal digit is roughly 8 bits). (b) Quantum Simulation Key Generation  
We use a randomised quantum wavefunction instead of eigenvalues. The wavefunction probability distribution is computed. The probabilities are sampled, and their values are converted into decimal digits. Mathematical Steps:  
1. Construct a random quantum wavefunction:  
\[\psi(x)=Ae^{-x^{2}}+iBe^{-x^{2}}\]  
2. Normalise the wavefunction:  
\[\psi_{norm}=\frac{\psi}{||\psi||}\]  
\[P(x)=|\psi(x)|^{2}\]  
3. Convert sampled indices to a 2048-bit decimal sequence. (c) Quantum Hashing Key Generation  
We apply the quantum Fourier transform (QFT) to the wavefunction. The phase information of the transformed state is extracted. The phase angles are converted into decimal values. Mathematical Steps:  
1. Apply QFT:  
\[\Psi_{k}=\sum_{j=0}^{N-1}e^{-2\pi jk/N\psi_{j}}\]  
\[\theta_{k}=angle(\Psi_{k})\]  
\[int\Big{(}\theta_{k}\times 10^{6}\Big{)}mod10\]  
(d) Quantum Key Distribution (QKD)  
Uses the BB84 quantum key distribution protocol. Quantum bit states are randomly chosen. Matching basis results are used to form the secure key  
Mathematical Steps:  
1. Generate random quantum bit states:  
[PERSON] sends photons on a random basis states. [PERSON] randomly selects basis states to measure. 2. Keep only the matching basis results. 3. Convert quantum bit outcomes into a decimal key sequence.