A MATLAB-based simulation of ground-state protein folding with the Variational Quantum Eigensolver (VQE)

Author : Waqas Javaid
Abstract
In computational biology, where the goal is to determine a protein’s lowest-energy three-dimensional structure from its amino acid sequence, protein folding is a fundamental challenge. The Variational Quantum Eigensolver (VQE), a hybrid quantum-classical optimization algorithm designed for near-term quantum computers, is used in this study to simulate ground-state protein folding using MATLAB [1]. The proposed model employs a simplified Hydrophobic-Polar (HP) lattice representation to investigate protein conformations on a two-dimensional grid. Using interaction energies between amino acid residues, valid self-avoiding folding pathways are created and evaluated. Parameterized quantum circuit optimization is used to simulate the VQE framework in order to effectively approximate the protein’s ground-state energy. To assess folding stability and algorithm performance, energy landscapes, contact maps, native folded structures, and optimization convergence behavior are analyzed [2]. The findings show that, in comparison to exhaustive searches, VQE-inspired strategies are capable of locating energetically advantageous conformations at a lower computational cost [3]. With this strategy, we can see how quantum computing can be used to solve difficult problems in biomolecular optimization. Researchers interested in computational biophysics and quantum-assisted protein structure prediction can use the study’s simple framework.
Introduction
Protein’s biological function is heavily dependent on its three-dimensional structure, protein folding is one of the most significant and computationally demanding problems in molecular biology [4]. Classical computing approaches find it challenging to solve the problem of determining a protein’s ground-state or lowest-energy conformation because it necessitates investigating a large number of different folding configurations. Recent advances in quantum computing have introduced new approaches for solving complex optimization problems through quantum algorithms.

Figure 1: Coarse-grained bead representation of a peptide sequence, where atomistic amino acids (Ala, Pro, Arg, Leu, Phe, Tyr) are mapped into simplified backbone and sidechain beads for molecular simulation.
Figure 1 represents the Variational Quantum Eigensolver (VQE) is a promising hybrid quantum-classical method for estimating molecular system ground-state energies. Using a VQE-inspired optimization framework and a simplified Hydrophobic-Polar (HP) lattice model, this study presents a MATLAB-based simulation of protein folding [5]. The model generates self-avoiding protein conformations on a two-dimensional lattice and evaluates their stability based on residue interaction energies [6]. The algorithm efficiently searches for energetically favorable structures by simulating the VQE optimization process. To evaluate the folding behavior, a variety of analyses, such as energy convergence, folding landscapes, contact maps, and native structures, are carried out [7]. Quantum-inspired optimization methods have potential applications in computational biology and protein structure prediction, as shown by the findings. This work provides an accessible framework for exploring the intersection of quantum computing and biomolecular modeling [8].
1.1 Background of Protein Folding
Catalysis, transport, signaling, and structural support are just a few of the many cellular functions performed by proteins, which are essential biological macromolecules [9]. The functionality of a protein is determined by its three-dimensional structure, which emerges from the folding of its amino acid sequence. A major obstacle in molecular biology is still comprehending how proteins form stable conformations. Drug discovery and biomedical research can be accelerated by accurately predicting protein structures. As a result, protein folding has emerged as a major area of computational science research.
1.2 Computational Challenges
Due to the large number of possible conformations, protein folding is considered an extremely difficult optimization problem. As the number of amino acid residues increases, the conformational search space grows exponentially [10]. Traditional computational methods often require significant processing power and time to evaluate all possible structures. This phenomenon is commonly known as the protein folding problem. Therefore, efficient algorithms are required to select the most stable conformations.
1.3 Ground-State Energy Concept
The ground-state energy configuration of a protein typically reflects the structure that is the most stable. The lowest possible energy level that a molecular system can achieve is referred to as the ground-state energy. Finding this state is crucial because proteins naturally tend to adopt conformations with the lowest free energy [11]. Energy-based models are widely used to evaluate folding stability and molecular interactions. In protein structure prediction, the primary objective is to reduce energy consumption.
1.4 Quantum Computing for Optimization
Quantum computing has emerged as a promising method for resolving difficult problems in simulation and optimization. Quantum computers, in contrast to conventional ones, make use of quantum bits that can be in multiple states at once. Quantum algorithms can use this capability to explore large solution spaces more effectively [12]. Quantum approaches to combinatorial optimization and molecular simulation are becoming increasingly investigated by researchers. Quantum computing could be very useful in the area of protein folding.
1.5 Variational Quantum Eigensolver
To estimate quantum system ground-state energies, the Variational Quantum Eigensolver (VQE) is a hybrid quantum-classical algorithm. Parameterized quantum circuits and conventional optimization methods are combined in VQE. While the classical optimizer updates the parameters of the circuit, the energy expectations are evaluated by the quantum processor [13]. Quantum resources are reduced for practical applications by this hybrid strategy. VQE is particularly suitable for near-term quantum devices.
1.6 Model of Hydrophobic Polar Proteins
The Hydrophobic-Polar (HP) lattice model is utilized in this study to make protein folding analysis simpler. Amino acids are depicted as either hydrophobic (H) or polar (P) in this representation. Through interactions between various types of residue, the model accurately depicts essential folding behavior [14]. Hydrophobic residues tend to cluster together to minimize energy, while polar residues remain exposed. The HP model offers useful insights into folding mechanisms despite its simplicity.
1.7 Creating Conformations Based on Lattices
On a two-dimensional lattice, the structure of the protein is depicted, with residues occupying distinct grid positions. Folding conformations are generated using self-avoiding walks to ensure that no two residues occupy the same location [15]. A distinct protein configuration is associated with each possible path. The validity of each conformation is checked during generation. This lattice-based approach significantly reduces computational complexity.
1.8 Energy Evaluation Strategy
Each valid conformation is evaluated according to interaction energies between residues. Favorable hydrophobic-hydrophobic contacts contribute negative energy values, indicating increased stability [16]. Other residue interactions may introduce neutral or unfavorable energy contributions. Comparing folding configurations objectively becomes possible by calculating the total energy of each structure. The conformation with the lowest energy is considered the ground state.
1.9 Simulation of VQE-Based Optimization
To approximate the protein’s ground-state energy, MATLAB uses a simulated VQE optimization process. A traditional optimization method is used to iteratively update the parameters at the beginning of the algorithm, which begin with random initializations. Throughout the optimization process, energy values are tracked to determine convergence [17]. The resulting trajectory behaves like a real-world VQE algorithm. The application of quantum-inspired techniques to studies of protein folding is demonstrated by this strategy.
1.10 Goals and Contributions
The application of VQE-inspired optimization for protein folding prediction is the primary focus of this work. Energy convergence, contact maps, folding landscapes, native structure visualization, and other analyses are carried out [18]. The study emphasizes the potential advantages of integrating biomolecular modeling and quantum computing ideas. In addition, it provides an educational and research-friendly memory-efficient MATLAB implementation. Quantum-assisted computational biology is a growing field that benefits from these findings.
Problem Statement
Because the number of possible protein conformations increases exponentially with sequence length, protein folding prediction remains a computationally intensive challenge. Within a vast conformational search space, conventional optimization techniques frequently struggle to effectively identify the lowest-energy (ground-state) structure. Quantum hardware is still limited in terms of its capabilities and resources, despite the fact that quantum computing offers promising solutions. As a result, frameworks that can simulate quantum-inspired optimization strategies for protein folding and are computationally efficient are required. Using a simplified lattice model, this study develops a Variational Quantum Eigensolver (VQE) simulation based on MATLAB to investigate and identify energetically advantageous protein conformations.
Mathematical Approach
A peptide sequence is depicted in the proposed protein folding model [19] as a two-dimensional lattice with distinct coordinate positions for each residue. Self-avoiding walks are used to generate valid protein conformations by ensuring that no residues overlap. The goal is to find the conformation with the least amount of energy, which is the protein’s ground state. The total folding energy is calculated from interactions between non-consecutive residues that become spatially adjacent on the lattice. The system’s energy is reduced by favorable hydrophobic-hydrophobic contacts, while other interactions may contribute positive or neutral energy values. The protein conformation is encoded into a simplified quantum-inspired state representation, and a Variational Quantum Eigensolver (VQE) framework is employed to approximate the minimum energy configuration. During optimization, parameterized quantum circuit variables are iteratively updated by a classical optimizer to minimize the expected energy. The energy expectation value serves as the objective function guiding the search process. Convergence is achieved when the estimated energy approaches the lowest obtainable value among all valid conformations. To efficiently investigate the folding landscape, this mathematical framework combines quantum-inspired optimization with lattice-based protein modeling. A protein conformation’s total energy is expressed as:

- E : Total protein folding energy
- i : Index of the first residue in the protein sequence
- j : Index of the second residue in the protein sequence
- Cᵢ : Contact matrix element indicating whether residues i and j are in spatial contact
- Wᵢ : Interaction weight (energy contribution) between residues i and j
- ∑ : Summation operator that accumulates energy contributions from all residue pairs
Where E is the total folding energy, Cᵢ represents the contact matrix between residues i and j, and Wᵢ denotes the interaction weight associated with residue pairs. The VQE energy [20] minimizes the expectation value as follows:
![]()
- ⟨E(θ)⟩: Expected energy value of the quantum system
- ψ(θ) : Parameterized quantum state generated by the variational quantum circuit
- |ψ(θ)⟩: Ket vector representing the quantum state of the system
- H : Hamiltonian operator describing the energy interactions of the protein folding system
- ⟨ψ(θ)|H|ψ(θ)⟩: Expectation value of the Hamiltonian with respect to the quantum state
Where |ψ(θ)⟩ is the parameterized quantum state, H is the Hamiltonian operator, and θ represents the set of variational parameters. The following is a definition of the VQE optimization goal [21]:
![]()
- θ* : Optimal set of variational parameters that produces the minimum energy solution
- θ : Adjustable parameter vector of the variational quantum circuit
- E(θ) : Energy function evaluated for a given parameter set θ
- arg min : Mathematical operator that returns the parameter values corresponding to the minimum value of a function
where indicates the parameter vector that approximates the protein ground state and minimizes the energy expectation value.
You can download the Project files here: Download files now. (You must be logged in).
Methodology
Technique Using the Hydrophobic-Polar (HP) lattice model, a brief protein sequence is first defined, with each amino acid residue classified as either hydrophobic (H) or polar (P). To guarantee physically valid conformations, the protein is depicted on a square lattice in two dimensions, and self-avoiding walks generate all possible folding pathways [22]. An energy function that is based on residue interactions and spatial contacts is used to evaluate each valid conformation. The energy landscape of the folding problem is represented by the construction of a simplified Hamiltonian. By looking for the conformation with the lowest total energy among all valid structures, the ground-state energy can be determined. Using parameterized quantum-inspired states and updates to classical optimization, a Variational Quantum Eigensolver (VQE) framework is implemented to mimic quantum optimization. In order to approximate the ground-state solution and reduce the expected energy value, the optimization process iteratively adjusts variational parameters [23]. Energy convergence analysis, folding landscape visualization, contact matrix generation, and native structure identification are used to evaluate performance. The VQE-based protein folding strategy’s efficacy is evaluated in the final analysis of the predicted protein conformation, energy spectrum, and optimization outcomes [24].
Design Matlab Simulation and Analysis
Using an optimization strategy that is influenced by Variational Quantum Eigensolver (VQE), the MATLAB simulation puts into action a simplified framework for the folding of proteins. “HPPH,” a short Hydrophobic-Polar (HP) protein sequence, is modeled on a two-dimensional lattice to preserve essential folding characteristics while reducing computational complexity.
Table 1: Simulation Parameters
| Parameter | Value |
| Protein Sequence | HPPH |
| Number of Residues | 4 |
| Number of Qubits | 4 |
| Lattice Size | 3 x 3 |
| VQE Iterations | 100 |
| Model | Hydrophobic-Polar (HP) |
Table 1 represents the guarantee that residues do not occupy the same lattice position, the simulation generates all possible self-avoiding walk conformations. Based on interactions between hydrophobic and polar residues, the program calculates the folding energy for each valid conformation [25]. The lowest-energy conformation is identified as the protein’s ground-state structure and serves as the reference solution. After that, a gradient-based optimization strategy is used to iteratively update random variational parameters as part of a simulated VQE optimization process. Energy values are recorded during each iteration to evaluate convergence toward the ground-state energy. Six graphical outputs, including VQE energy convergence, folding energy landscape, native protein structure, Hamiltonian contact matrix, energy spectrum, and parameter optimization landscape, further illustrate the folding process. Protein stability, energy distribution, and optimization performance are all revealed by these visualizations. Overall, the MATLAB implementation demonstrates how quantum-inspired optimization techniques can be applied to protein folding prediction in a computationally efficient and educational manner.

Figure 2: The VQE Energy Convergence
The Variational Quantum Eigensolver (VQE)’s convergence during the optimization process is depicted in Figure 2. The estimated energy value at each iteration is shown by the blue curve, while the actual ground-state energy is shown by the red dashed line. The estimated energy gradually approaches the minimum energy level as the number of iterations increases. The noise from simulated quantum measurements causes minute fluctuations. The VQE-inspired optimization strategy’s ability to locate low-energy protein conformations is demonstrated by the convergence trend.

Figure 3: Folding Energy Landscape
You can download the Project files here: Download files now. (You must be logged in).
The protein folding energy landscape that was derived from each and every valid self-avoiding conformation is depicted in Figure 3. For the purpose of visualization, Principal Component Analysis (PCA) is utilized to project high-dimensional structural data onto a two-dimensional space. Each point corresponds to a unique protein conformation, and its color indicates the associated energy value. Folding states that are more stable have conformations with lower energies in them. The distribution of stable structures and favorable folding pathways in the search space are both aided by this visualization.

Figure 4: Protein Native Structure
The predicted native folded structure that corresponds to the minimum-energy conformation is depicted in Figure 4. Hydrophobic residues are represented by red square markers, while polar residues are shown as blue circular markers. Peptide bonds that link consecutive protein chain residues are depicted by black lines. The positive hydrophobic-hydrophobic contacts that contribute to structural stability are highlighted by the green dashed lines. The figure provides a clear representation of the final folded protein configuration identified by the optimization process.

Figure 5: The Hamiltonian Contact Matrix
Figure 5 illustrates the Hamiltonian contact matrix representing residue interactions within the ground-state structure. Each matrix element quantifies the interaction energy between a pair of residues that are spatially adjacent but not sequentially connected. Positive values correspond to less favorable contacts, while negative values indicate favorable hydrophobic interactions. Interaction patterns across the protein sequence are simple to identify thanks to the color-coded representation. This matrix serves as a compact representation of the folding energy contributions.

Figure 6: Conformation Energy Spectrum
Figure 6 shows the energy distribution of all valid protein conformations generated during the simulation. The histogram shows how frequently the folding landscape experiences various energy levels. The algorithm’s determination of the minimum-energy ground state is symbolized by the vertical red line. A concentration of conformations around specific energy levels reveals the structure of the energy landscape. The variety and relative stability of possible protein folds are depicted in this figure.

Figure 7: VQE Parameter Landscape
You can download the Project files here: Download files now. (You must be logged in).
Figure 7 visualizes the relationship between variational parameters and the corresponding energy values in the VQE optimization process. The three-dimensional surface represents the simulated energy landscape as a function of two optimization parameters. Higher regions indicate less optimal solutions, while lower regions of the surface indicate parameter combinations that are energetically advantageous. The global minimum on the surface approximates the protein ground-state energy. This figure demonstrates how parameter optimization guides the VQE algorithm toward stable protein conformations.
Results and Discussion
The simulation successfully generated all valid self-avoiding conformations for the selected HPPH protein sequence and evaluated their corresponding folding energies. The ground-state configuration was identified as the lowest-energy structure in the energy landscape analysis, which revealed multiple possible conformations. Over 100 iterations, the VQE-inspired optimization process consistently converged toward the lowest energy solution [26]. The final estimated energy closely matched the true ground-state energy, indicating effective optimization performance. Visualization of the native folded structure showed favorable hydrophobic residue interactions that contributed to overall folding stability. The Hamiltonian contact matrix proved that the optimized conformation contained residue contacts of energy significance. In addition, the search space’s distribution of both stable and unstable conformations was highlighted by the energy spectrum [27]. The parameter landscape exhibited a distinct global minimum, validating the optimization strategy used in the simulation. These findings demonstrate that quantum-inspired approaches can efficiently explore complex protein folding landscapes while maintaining computational efficiency [28]. Overall, the results support the potential application of Variational Quantum Eigensolver techniques in future protein structure prediction and biomolecular optimization studies.
Conclusion
A Variational Quantum Eigensolver (VQE)-inspired optimization framework was used in this study to simulate ground-state protein folding using MATLAB. Valid protein conformations based on interaction energies were generated and evaluated using a simplified Hydrophobic-Polar lattice model [29]. Through iterative optimization, the simulation demonstrated convergence toward the ground-state solution and successfully identified the minimum-energy folded structure. Energy landscapes, contact matrices, and native structure representations were among the visual analyses that provided useful insights into the behavior of protein folding [30]. The findings demonstrated that quantum-inspired optimization methods are capable of efficiently exploring intricate conformational search spaces. Even though the current method makes use of a simplified protein model, it provides a solid foundation for incorporating cutting-edge quantum algorithms into biomolecular simulations. Future research can extend this framework to larger protein systems and real quantum computing platforms for enhanced structure prediction capabilities.
References
[1] A. Peruzzo et al., “A variational eigenvalue solver on a photonic quantum processor,” Nature Communications, vol. 5, no. 4213, pp. 1–7, 2014.
[2] J. Preskill, “Quantum computing in the NISQ era and beyond,” Quantum, vol. 2, p. 79, 2018.
[3] A. Aspuru-Guzik, A. D. Dutoi, P. J. Love, and M. Head-Gordon, “Simulated quantum computation of molecular energies,” Science, vol. 309, no. 5741, pp. 1704–1707, 2005.
[4] Y. Cao et al., “Quantum chemistry in the age of quantum computing,” Chemical Reviews, vol. 119, no. 19, pp. 10856–10915, 2019.
[5] S. McArdle, S. Endo, A. Aspuru-Guzik, S. C. Benjamin, and X. Yuan, “Quantum computational chemistry,” Reviews of Modern Physics, vol. 92, no. 1, p. 015003, 2020.
[6] M. Cerezo et al., “Variational quantum algorithms,” Nature Reviews Physics, vol. 3, no. 9, pp. 625–644, 2021.
[7] F. Arute et al., “Hartree-Fock on a superconducting qubit quantum computer,” Science, vol. 369, no. 6507, pp. 1084–1089, 2020.
[8] P. W. Shor, “Algorithms for quantum computation: Discrete logarithms and factoring,” in Proc. 35th Annual Symposium on Foundations of Computer Science, 1994, pp. 124–134.
[9] L. K. Grover, “A fast quantum mechanical algorithm for database search,” in Proc. 28th Annual ACM Symposium on Theory of Computing, 1996, pp. 212–219.
[10] M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information. Cambridge, U.K.: Cambridge University Press, 2010.
[11] K. A. Dill, “Theory for the folding and stability of globular proteins,” Biochemistry, vol. 24, no. 6, pp. 1501–1509, 1985.
[12] K. A. Dill and J. L. MacCallum, “The protein-folding problem, 50 years on,” Science, vol. 338, no. 6110, pp. 1042–1046, 2012.
[13] C. B. Anfinsen, “Principles that govern the folding of protein chains,” Science, vol. 181, no. 4096, pp. 223–230, 1973.
[14] K. F. Lau and K. A. Dill, “A lattice statistical mechanics model of the conformational and sequence spaces of proteins,” Macromolecules, vol. 22, no. 10, pp. 3986–3997, 1989.
[15] H. S. Chan and K. A. Dill, “Origins of structure in globular proteins,” Proceedings of the National Academy of Sciences, vol. 87, no. 16, pp. 6388–6392, 1990.
[16] D. Baker, “A surprising simplicity to protein folding,” Nature, vol. 405, no. 6782, pp. 39–42, 2000.
[17] M. Levitt, “Nature of the protein universe,” Proceedings of the National Academy of Sciences, vol. 106, no. 27, pp. 11079–11084, 2009.
[18] D. E. Shaw et al., “Atomic-level characterization of the structural dynamics of proteins,” Science, vol. 330, no. 6002, pp. 341–346, 2010.
[19] K. F. Lau and K. A. Dill, “A lattice statistical mechanics model of the conformational and sequence spaces of proteins,” Macromolecules, vol. 22, no. 10, pp. 3986–3997, 1989.
[20] A. Peruzzo et al., “A variational eigenvalue solver on a photonic quantum processor,” Nature Communications, vol. 5, no. 4213, pp. 1–7, 2014.
[21] M. Cerezo et al., “Variational quantum algorithms,” Nature Reviews Physics, vol. 3, no. 9, pp. 625–644, 2021.
[22] S. Jordan, Quantum Computation Beyond the Circuit Model. Cambridge, MA, USA: MIT Press, 2011.
[23] N. Moll et al., “Quantum optimization using variational algorithms on near-term quantum devices,” Quantum Science and Technology, vol. 3, no. 3, p. 030503, 2018.
[24] J. R. McClean, J. Romero, R. Babbush, and A. Aspuru-Guzik, “The theory of variational hybrid quantum-classical algorithms,” New Journal of Physics, vol. 18, no. 2, p. 023023, 2016.
[25] A. Kandala et al., “Hardware-efficient variational quantum eigensolver for small molecules and quantum magnets,” Nature, vol. 549, no. 7671, pp. 242–246, 2017.
[26] M. Schuld and F. Petruccione, Supervised Learning with Quantum Computers. Cham, Switzerland: Springer, 2018.
[27] S. Dasgupta, A. Papadimitriou, and U. Vazirani, Algorithms. New York, NY, USA: McGraw-Hill, 2008.
[28] R. P. Feynman, “Simulating physics with computers,” International Journal of Theoretical Physics, vol. 21, no. 6–7, pp. 467–488, 1982.
[29] I. M. Georgescu, S. Ashhab, and F. Nori, “Quantum simulation,” Reviews of Modern Physics, vol. 86, no. 1, pp. 153–185, 2014.
[30] F. Tacchino, S. Mangini, P. K. Barkoutsos, C. Macchiavello, and I. Tavernelli, “Variational learning for quantum artificial neural networks,” IEEE Transactions on Quantum Engineering, vol. 2, pp. 1–10, 2021.
You can download the Project files here: Download files now. (You must be logged in).







Responses