To generate data for the microcanonical average in ETH (Eigenstate Thermalization Hypothesis) for a non-integrable Hamiltonian, you can follow these general steps:
1. **Diagonalize the Hamiltonian**: Numerically diagonalize the Hamiltonian of your non-integrable system to obtain its eigenstates and eigenvalues.
2. **Calculate the diagonal elements of the local operator**: Evaluate the diagonal elements of the local operator in the eigenbasis of the Hamiltonian. This will give you the values of the local operator for each eigenstate.
3. **Perform the microcanonical average**: Compute the microcanonical average of the diagonal elements of the local operator. The microcanonical average is defined as:
```
A_mc = (1/n) * sum(A_ii)
```
where `A_ii` are the diagonal elements of the local operator, and `n` is the number of eigenstates within the energy window of interest.
4. **Vary the energy window**: Repeat the microcanonical average calculation for different energy windows to obtain the energy dependence of the microcanonical average.
Here's a Python code snippet that demonstrates the general approach:
```python
import numpy as np
from scipy.linalg import eigh
# 1. Diagonalize the Hamiltonian
H = ... # your non-integrable Hamiltonian
eigenvalues, eigenstates = eigh(H)
# 2. Calculate the diagonal elements of the local operator
A = ... # your local operator
A_diag = [np.abs(np.dot(eigenstates[:, i], np.dot(A, eigenstates[:, i]))) for i in range(len(eigenvalues))]
# 3. Perform the microcanonical average
def microcanonical_average(E_min, E_max):
"""Compute the microcanonical average of the diagonal elements of the local operator."""
indices = np.where((eigenvalues >= E_min) & (eigenvalues
Choose a Model: Select a well-studied non-integrable Hamiltonian for your system. Popular choices include spin chains like Heisenberg XXZ model or fermionic models like Hubbard model.
Diagonalize the Hamiltonian: Utilize libraries like LAPACK or ScaLAPACK in MATLAB to diagonalize the Hamiltonian matrix. This will provide you with the system's eigenstates (energy levels) and corresponding eigenvalues (energies).
Sample Microcanonical Ensemble: The microcanonical ensemble represents states with a fixed energy. Here's how to generate data for the microcanonical average:Define an energy window: Choose an energy range within the spectrum that represents the microcanonical ensemble you're interested in. Sample eigenstates: Randomly select eigenstates from within the chosen energy window. The probability of selecting an eigenstate should be proportional to its degeneracy (number of states with the same energy). This ensures a microcanonical distribution.
Analyzing Diagonal Matrix Elements:
Plot the Data: Once you have sampled eigenstates, access the corresponding diagonal elements of your local operator in the eigenstate basis. Plot these values against the eigenstate index or energy to visualize their behavior.
Compare with ETH: According to ETH, for local operators in the thermodynamic limit (large system size), the diagonal elements in the eigenstate basis should approach the microcanonical average value. You can compare the average of your plotted data points with the theoretical microcanonical average for the chosen energy window.
Additional Considerations:
System Size: ETH predictions become more accurate with increasing system size. Consider increasing the system size in your simulation for a stronger ETH signature.
Ergodicity: Ergodic systems explore all accessible microstates over time. Ensure your chosen model exhibits ergodic behavior for reliable microcanonical sampling.
Finite-size effects: For finite systems, there will be deviations from ETH predictions. You might need to analyze the data statistically to account for these effects.