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.
- Starts a Gaussian wavepacket inside the well.
- Computes the exact reference dynamics by expanding in the well's eigenstates.
- Discretises the Hamiltonian on a grid and decomposes it into Pauli strings.
- Builds a first- or second-order Trotter step and evolves the state.
- Compares against the exact reference at several time snapshots.
- Runs convergence studies against the number of Trotter steps
rand the grid sizeN. - Increases the step count until fidelity passes 0.99.
- 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.
| 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 |
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py