This repository contains the simulation code for a Quantum Mechanics 2 (QM-2) course project. The objective is to simulate the time evolution of coupled qubits under an XY Hamiltonian to realize an iSWAP gate using Trotterization.
The project simulates the Hamiltonian: $$ H = g(X \otimes X + Y \otimes Y) $$
This interaction naturally gives rise to the iSWAP gate, which exchanges the amplitudes of the
- Trotterization: Implements time evolution using the Trotter-Suzuki decomposition.
- Circuit Visualization: Visualizes the quantum circuit decomposition into basis gates.
-
Simulations:
-
Single iSWAP: Demonstrates the state swap from
$|01\rangle$ to$|10\rangle$ . -
Time Evolution: Plots the probability of states
$|01\rangle$ and$|10\rangle$ over time. - Double iSWAP: Shows that applying the operation twice returns the system to the initial state (with a phase).
-
Single iSWAP: Demonstrates the state swap from
final.ipynb: The main Jupyter Notebook containing the complete simulation code and results.project_report.pdf: The detailed project report and documentation.images/: Directory containing the generated simulation plots.
Ensure you have Python installed. You can install the required dependencies using pip:
pip install -r requirements.txtOpen the final.ipynb notebook to run the simulations:
jupyter notebook final.ipynbNote: The notebook generates plots in the current directory. The canonical versions are stored in the
images/directory.
Key simulation results:
This project was developed for academic purposes.


