Skip to content

rgora/photochemistry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

203 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computational Photochemistry Tutorials

In this repository I publish materials for my Computational Photochemistry course. Please note that the scripts and some of the programs that we use are often written ad hoc and were not thoroughly tested.

📘 Getting Started with MobaXterm

📥 Download and Install

  1. Go to the MobaXterm official website.
  2. Download the Home Edition (Installer or Portable version).
  3. Install or unzip the package and launch MobaXterm.

🔌 Connect to a Remote Server (via SSH)

  1. Open MobaXterm.
  2. Click on Session (top left corner).
  3. Select SSH.
  4. Fill in the remote host details:
    • Remote host: ui.wcss.pl
    • Specify username: your-username
  5. (Optional) Check Use private key if you're using an SSH key.
  6. Click OK to connect.

📁 Upload/Download Files

  • Once connected via SSH, a file browser will appear on the left side.
  • You can drag and drop files between your local machine and the server.

🛠 Tips

  • Use the built-in terminal for Linux commands.
  • Save sessions for quick reconnects.
  • You can also use tools like scp, rsync, or Git directly in the terminal.

🧠 Note: MobaXterm is available only on Windows. For macOS or Linux, consider using Terminal or other SSH clients.

🐧 Basic Linux / UNIX Commands

📄 File Permissions in UNIX

Each file in UNIX has:

  • a type (directory, file, or link),
  • access rights for:
    • the owner,
    • the group,
    • others.

Example output of ls -l:

drwxr-xr-x 2 rgora kdm 2048 Mar 26 16:39 n2h2/
-rw-r--r-- 1 rgora kdm 4552 Mar 26 12:12 scan.dat
lrw-r--r-- 1 rgora kdm   75 Mar 26 12:14 scan.gpl

Legend:

  • d – directory, - – regular file, l – symbolic link
  • r – read, w – write, x – execute

File permissions are displayed as:

-rwx r-x r--
|---|---|---|
  U   G   O

U = User, G = Group, O = Others

🔧 Essential Commands

# Navigation
cd                # Go to home directory
cd /path/to/dir   # Change to specific directory

# File listing
ls                # List files
ls -la            # Long list incl. hidden files
ls -1 /dir        # One file per line

# File removal
rm file           # Delete a file
rm -r folder      # Recursively delete a folder

# Copy/move files
cp file1 file2    # Copy file1 to file2
cp -r dir1 dir2    # Copy directory
mv file newname   # Rename or move file

# Create/delete directories
mkdir new_folder
rmdir empty_folder

# File viewing
cat file.txt      # Print content
more file.txt     # Page through file
less file.txt     # Like more, but scrollable

# Changing permissions
chmod +x file     # Make file executable
chmod a-w file    # Remove write permission for all
chmod ugo=rx file # Read/execute access to all

💡 Tips

  • Use man <command> or <command> --help to read about commands.
  • Use wildcards:
    • * matches any string.
    • ? matches a single character.
  • Use | (pipe) to connect commands:
    ls -l | less
  • Use > and < to redirect output:
    ls -l > output.txt
    sort < output.txt
📝 Modern vim Basics

✍️ Modes in vim

  • Esc – Command mode
  • i – Insert before cursor
  • a – Append after cursor
  • o / O – Open new line below / above
  • v – Visual selection mode (character-wise)
  • V – Visual line selection
  • Ctrl + v – Visual block selection (column mode)

🧭 Movement (you can also use arrow keys)

  • ↑ ↓ ← → – Move cursor
  • 0 / $ – Start / end of line
  • gg / G – Top / bottom of file
  • :n – Go to line n
  • Ctrl + G – Show file and line info

🧾 Editing & Copy-Paste

  • x / X – Delete character under / before cursor
  • dd – Delete current line
  • yy – Copy line
  • p – Paste after cursor
  • u – Undo
  • Ctrl + r – Redo

🟦 Block Editing

  • Ctrl + v – Start block selection
  • Use arrow keys to expand selection
  • d, y, p, etc. work with blocks

Example:

  • Select a vertical block with Ctrl + v, move with arrows, press I to insert text at the beginning of every selected line (then press Esc twice to apply).

🔍 Search and Replace

  • /pattern – Search forward
  • ?pattern – Search backward
  • n / N – Next / previous match
  • :s/old/new/g – Replace in current line
  • :%s/old/new/g – Replace in entire file

🖫 Save and Exit

  • :w – Save
  • :q – Quit
  • :wq or ZZ – Save and quit
  • :q! – Quit without saving

🪟 Working with Splits

  • :split or :sp filename – Horizontal split
  • :vsplit or :vsp filename – Vertical split
  • Ctrl + w + w – Switch between windows
  • Ctrl + w + q – Close current split
  • Ctrl + w + = – Make splits equal size

💡 Tip: To open files in splits from the command line:
vim -O file1 file2 (vertical)
vim -o file1 file2 (horizontal)

📝 Vim Cheat Sheet

📄 Download the Cheat Sheet PDF

🔐 Remote Access with SSH

🔌 Connect to Remote Server

  • -Y allows GUI applications over SSH

⚙️ Execute Remote Commands

ssh ui.wcss.pl "qstat -u $USER"

📂 File Transfers with SCP

scp file.txt ui.wcss.pl:             # upload to home directory
scp -r folder/ ui.wcss.pl:target/    # upload directory
scp ui.wcss.pl:file.txt ./           # download

🔑 SSH Key Setup

ssh-keygen -t rsa

Then copy your public key:

cat ~/.ssh/id_rsa.pub | ssh [email protected] "cat >> ~/.ssh/authorized_keys"
  • Next time you connect: no password needed.
  • Use ssh-add if your key is passphrase protected.
📋 Job Scheduling with PBS

🔎 Check Queue Status

qstat
qstat -u $USER           # your jobs only
qstat -f Job_ID          # detailed info
pbsnodes -a              # check compute nodes

🚀 Submit Interactive Job

qsub -I -X -l select=1:ncpus=4:mem=4gb -l walltime=6:00:00

🧾 Submit Batch Job with Script

cat << EOF | qsub -r n
#!/bin/bash
#PBS -N my_job
#PBS -l ncpus=4
#PBS -l mem=2mb
#PBS -q main
#PBS -m n
#PBS -l walltime=1:00:00

cd ~
ls -l >& output.txt
EOF
  • Use qstat -u $USER to check job status: Q = queued, R = running
📅 Job Scheduling with SLURM

📊 Check Job and Node Status

squeue                     # list current jobs
squeue -u $USER            # your jobs
sinfo                      # info about nodes

🚀 Submit a Job

sbatch job_script.sh

Example job_script.sh:

#!/bin/bash
#SBATCH --job-name=my_job
#SBATCH --output=result.out
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem=4G
#SBATCH --time=01:00:00

cd $HOME
ls -l > result.txt

🧪 Interactive Job Session

srun --ntasks=1 --cpus-per-task=4 --mem=4G --time=01:00:00 --pty bash

❌ Cancel Job

scancel <job_id>

📊 To check the status of a running job one may use squeue command or sstat and for finished jobs sacct:

squeue --user $USER
squeue --user $USER --Format jobid:10,name,state:10,timeleft:12,minmemory:10,stdout:100'
sstat <job_id>
sstat --fields=JobID,MaxVMSize,MaxVMSizeNode,MaxVMSizeTask,AveCPU <job_id>
sacct --format=jobid,jobname,qos,cputime,ncpu,avecpu,elapsed,avevmsize --jobs=<job_id>

📊 WCSS has a comprehensive users' manual at man.e-science.pl

📘 Excited states of pyrimidine nucleobases

📘 Excited states of pyrimidine nucleobases

In this tutorial, we try to locate geometries of ground and excited states minima of pyrimidine nucleobases as well as the relevant minimum energy crossing points (MECPs) between low-lying states. The starting geometries are available in the article of Lan et al.. In the supplementary information, the relevant geometries of U, T and C are reported.

We start with the optimization of geometry at the KS-DFT and TD-DFT levels in ORCA.

Next, we locate the relevant MECPs using Turbomole and CIOpt packages

To obtain reference geometries of MECPs we will use BAGEL package.

Finaly, we will attempt to locate the MECPs using MRSF-TDDFT using GAMESS(US) package.

📊 TODO

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors