Skip to content

Anay2005/Time-Evolution-on-a-Quantum-Computer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Simulation of the 1D XXZ Spin Chain

Python Qiskit Jupyter

Overview

This repository contains code to simulate a 1D XXZ quantum spin chain. The project uses the Suzuki-Trotter method to turn continuous physics equations (the Schrödinger equation) into discrete, step-by-step quantum circuits.

The code includes an exact classical simulation to use as a baseline, and a manual Qiskit implementation designed to run on actual IBM Quantum hardware while managing device noise.

Read the full project report: docs/Project_Report.pdf

My Contributions: The Suzuki-Trotter Code

While this was a group project, I was responsible for writing the core quantum simulation logic:

  • Writing the Trotter Algorithm: I coded the sequence that breaks the complex Hamiltonian math into Even and Odd bond groups so it can actually run on a computer. I implemented both the standard 1st-order method and the more accurate 2nd-order symmetric method.
  • Building the Circuits by Hand: Instead of letting Qiskit build the circuit automatically, I hard-coded it using native rotation gates (RXX, RYY, RZZ). This ensures the hardware runs the independent bonds at the exact same time, which cuts down on physical device errors.
  • Testing and Error Analysis: I wrote the code to compare our quantum circuits against the exact classical math to measure the error. This helped us find the "sweet spot" time step (dt = 0.1) that balances mathematical error against the physical noise of the IBM chips.

Repository Structure

├── assets/                          # Images for the README
├── docs/
│   └── Project_Report.pdf           # Full physics derivations and results
├── notebooks/
│   └── xxz_spin_chain_simulation.ipynb # Main code and data visualization
├── README.md                        
└── requirements.txt                 # List of python packages needed

Tech Stack

  • Quantum: Qiskit, Qiskit Aer (for local simulation), Qiskit IBM Runtime (for running on IBM chips)
  • Classical Math: NumPy, SciPy
  • Graphing: Matplotlib

How to Run This Locally

To run the Jupyter notebook on your own machine:

  1. Clone the repository:

    git clone https://github.com/yourusername/xxz-quantum-simulation.git cd xxz-quantum-simulation

  2. Install the required Python packages:

    pip install -r requirements.txt

  3. Open the notebook:

    jupyter notebook notebooks/xxz_spin_chain_simulation.ipynb

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages