Step-by-step guide to install Quantum ESPRESSO (QE) on Windows via WSL (Ubuntu), transfer data from external drives, and run QE:
-
Enable WSL:
Open PowerShell as Administrator and run:wsl --installReboot your PC when prompted.
-
Install Ubuntu:
wsl --install -d <distribution name>
- After reboot, open the Microsoft Store and install Ubuntu (latest LTS version).
- Launch Ubuntu from the Start menu to complete setup (create a username/password).
- If you encounter any issues during the installation, you can refer to the official Microsoft documentation for troubleshooting: https://learn.microsoft.com/en-us/windows/wsl/install
sudo apt update && sudo apt upgrade -y-
Python 3 (already pre-installed in Ubuntu):
Verify with:python3 --version
-
Install Miniconda:
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh chmod +x Miniconda3-latest-Linux-x86_64.sh ./Miniconda3-latest-Linux-x86_64.sh
Follow prompts (agree to license, install to default location, and allow
conda init).
Close/reopen the terminal afterward.
-
Create and activate
qe_env:conda create --name qe_env python=3.9 -y conda activate qe_env
-
Install Quantum ESPRESSO:
conda install conda-forge::qe -y conda install conda-forge::qe-tools -y
-
Access External Drive:
- Connect your external drive (e.g.,
D:orE:). - In WSL, navigate to the drive:
Use
cd /mnt/[drive_letter]/ # e.g., cd /mnt/e/
lsto view files.
- Connect your external drive (e.g.,
-
Copy Files to WSL:
mkdir ~/qe_data # Create a directory in WSL home cp -r /mnt/e/path/to/data/* ~/qe_data # Copy files
-
Activate the Conda environment:
conda activate qe_env
-
Navigate to your data:
cd ~/qe_data
-
Run QE Commands:
Example forpw.x:pw.x -input input_file.in > output_file.out
- Mount External Drives: All Windows drives are auto-mounted under
/mnt/[drive_letter]. - Performance: For large files, work directly in WSL’s native file system (
~/or/home/) for faster I/O. - Backup: Copy results back to Windows using:
cp ~/qe_data/output_file.out /mnt/c/Users/YourName/Desktop/
-
QE Not Found:
Ensurequantum-espressois installed in the active Conda environment.
Verify with:conda list | grep espresso -
Permission Denied:
Run:sudo chmod -R 755 ~/qe_data -
MPI Issues:
Install MPI libraries:sudo apt install openmpi-bin libopenmpi-dev
-
GUI Tools (XCrySDen, etc.):
Install X Server for Windows (e.g., VcXsrv) to display Linux GUI apps.
-
Install dependencies:
sudo apt install gfortran libfftw3-dev libopenmpi-dev libblas-dev liblapack-dev
-
Clone QE repository:
git clone https://github.com/QEF/q-e.git cd q-e -
Configure and compile:
./configure make all