Skip to content

About

Particle in a 1D infinite well, evolved with Trotterized quantum circuits in Qiskit

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Infinite Well Simulation with Trotterization

Simulates a Gaussian wavepacket in a 1D infinite potential well (particle in a box) using Trotterized quantum circuit evolution in Qiskit, and checks it against the exact answer.

The same code, with a longer write-up, is in QIW_Simulation_Trotterization.

What main.py does

  1. Starts a Gaussian wavepacket inside the well.
  2. Computes the exact reference dynamics by expanding in the well's eigenstates.
  3. Discretises the Hamiltonian on a grid and decomposes it into Pauli strings.
  4. Builds a first- or second-order Trotter step and evolves the state.
  5. Compares against the exact reference at several time snapshots.
  6. Runs convergence studies against the number of Trotter steps r and the grid size N.
  7. Increases the step count until fidelity passes 0.99.
  8. Saves plots, an animation and resource tables to output/.

All the parameters you might want to change (grid size, Trotter order, wavepacket width, time step target) are at the top of main.py.

Files

File Role
physics.py eigenstates, energies, wavepacket, exact evolution
trotter.py Hamiltonian, Pauli decomposition, Trotter step
circuit.py quantum circuit construction
analysis.py fidelity and convergence analysis
visualization.py plots and the animation
main.py runs everything

Run it

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py

Wavepacket evolution

About

Particle in a 1D infinite well, evolved with Trotterized quantum circuits in Qiskit

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages