This an Exact Diagonalization (ED) code implemented in Wolframe Mathematica (version 13.1).

It includes:
1. ED code for spin 1/2 Heisenberg spin chain with open/periodic boundary conditions. 
Input parameters: length of spin chain and boundary condition. 
Expected output: the Hamiltonian of spin chain and its corresponding eignen systems. 

2. Calculation of the dynamic spin structure factor based on the Hamiltonian and ground state obtained from the ED calculation.
The calculation should be performed after the ED calculation.
Expected output: Dynamic spin structure factor of the given spin chain. 

Expected run time for a spin chain with length L<10: less than 1 min to run on laptop.

