PyARPES Quickstart Guide
PyARPES Quickstart Guide
This page is a guide for downloading PyARPES and using it for experiments conducted in the Harmony Lab. It includes instructions and files specific to working with our tr-ARPES system. If you're unfamiliar with ARPES, you can read about it on the About ARPES page.
Refer to the official PyARPES docs for more general information on the library:
1. Installation
The Instructions are based on Installation — arpes 3.0.1 documentation. Code in bold may need to be adjusted to your configuration. If you encounter issues installing PyARPES, reach out to haoyuejiang@berkeley.edu.
Install Anaconda Navigator
Open Anaconda Prompt (or Command Prompt given your PATH variable is set up correctly) and navigate to the folder where you want to clone the PyARPES Gitlab repository. For example:
cd C:\Users\username
Clone the repository to your selected folder (e.g. "lab"). Make sure to close any instances of the Anaconda Navigator app to prevent conflicts:
git clone https://gitlab.com/lanzara-group/python-arpes
Then create a new environment inside the newly imported python-arpes folder, which may take a few minutes. It will say "done" once it's finished:
cd python-arpes
conda env create -f environment.yml
5. Activate the environment:
conda activate arpes
6. Install PyARPES in an editable configuration. See the section below if you get an error.
pip install -e .
⊘
If you get ERROR: No matching distribution found for pygor, you can alternatively run within your python-arpes directory
git clone https://github.com/chstan/igorpy
Then, go to the igorpy directory, install PyARPES in an editable configuration, and return to your main python-arpes directory.
cd igorpy
pip install -e .
cd ..
7. It is highly recommended that you install PyARPES through conda rather than pip. Make sure conda-forge is a lower priority than the Anaconda channel by running:
conda config --append channels conda-forge
conda install -c arpes arpes
8. Install and configure standard tools like Jupyter or Jupyter Lab. Notes on installing and configuring Jupyter based installations can be found in jupyter.m. If you already have Jupyter and just need to register your environment. You can do
pip install ipykernel
python -m ipykernel install --user
You can also give the kernel a different display name in Juptyer with python -m ipykernel install --user --display-name "My Name Here".
9. To check that all the necessary dependencies are installed, run the following command and note that the PyQt5==5.15 requirement can be safely ignored:
python -m pip check
10. Read section 4 if you run into any further issues during the installation process.
⊘
If you get arpes 3.0.1 requires ase, which is not installed. arpes 3.0.1 has requirement PyQt5==5.15, but you have pyqt5 5.15.10. , only ase needs to be installed in the python-arpes directory (ignore the PyQt5 warning).
conda install -n arpes -c conda-forge ase
Then, refresh the metadata: go to the igorpy directory, reinstall PyARPES, return to your main python-arpes directory, and ensure ase is now installed.
cd igorpy
pip install -e .
cd ..
python -m pip check
2. Run Tutorial Example Data (Recommended)
Ensure you are in the arpes environment and open Jupyter Lab within your python-arpes directory:
conda activate arpes
cd C:\Users\username\python-arpes
jupyter lab
Once Jupyter Lab starts in your browser, you will be able to access the example_data folder in the File Browser.
Create a new Python 3 file and follow the detailed tutorial found at Tutorial data in PyARPES — arpes 3.0.1 documentation.
3. Your Experiment's trARPES Data
Time-Resolved ARPES uses a pump-probe scheme to watch how a material's electronic structure evolves after ultrafast laser excitation. A femtosecond pump pulse excites the sample, and after a controlled time delay, a probe pulse (XUV from high-harmonic generation) photoemits electrons whose kinetic energy and angle are measured by a hemispherical analyzer.
By comparing spectra taken at different pump-probe delays, we can directly observe phenomena like charge-density-wave gap collapse, hot carrier relaxation, and coherent phonon oscillations in materials like 1T-TaS₂.
Each .pxt file from the Scienta analyzer is a 2D snapshot of the band structure (energy × emission angle) taken at a specific delay stage position. The core of TR-ARPES analysis is comparing these snapshots:
# Load two scans at different pump-probe delays
f30 = fld(30) # reference (pump off)
f31 = fld(31) # pumped (delay = 242.7 mm)
# The differential is the TR-ARPES result
diff = f31.spectrum - f30.spectrum
Red — intensity increased (electrons excited to higher states)
White — no change
Blue — intensity decreased (states depopulated by pump)
Clone the repository: https://github.com/Harlan-Phillips/TR-ARPES
Download the notebook from GitHub into your data folder.
2. Edit the data path
Open the notebook and set DATA_DIR to point to your data/ folder containing .pxt files.
3. Run all cells
In Jupyter or VS Code, hit Run All. The GUI will appear with all available scans.
Don't forget to select the correct anaconda environment (Section 1)
4. Pick two scans and compare
Set Scan A as your reference (pump off), Scan B as your pumped scan. The differential map shows what changed.
4. Debugging Installation
If you get pin on python 3.13 conflicts with any installable versions, ARPES dependencies (especially xarray 0.9.6 and h5py 2.x) only support Python ≤ 3.8
conda install -n arpes -c conda-forge ase
Create a new environment with an older Python version:
conda create -n arpes38 python=3.8
conda activate arpes38
Then continue setup inside this environment.
If you get ValueError: did not find HDF5 headers, pip attempted to build h5py from source on Windows, missing precompiled HDF5 libs.
Fix (conda binary install):
conda install -c conda-forge hdf5=1.10.* h5py=2.10.* netcdf4=1.5.3 numpy=1.18 astropy=3.2
This ensures all dependencies use the prebuilt binaries for HDF5 1.10.
If you get “unsatisfiable” solver error when mixing netcdf4 ≥ 1.5.7 and h5py 2.10.
Lock everything to the older ABI:
conda install -c conda-forge "hdf5=1.10.*" "netcdf4=1.5.3" "h5py=2.10.*"