본문으로 건너뛰기
cccskills
무료GitHub에 공개

orca-opt

ORCA geometry optimization. Handles method/basis selection, dispersion corrections, solvent models, and convergence settings.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Hello-QM/catgo-LRG스타 208(GitHub 208 + cccskills 0)

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md10.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

ORCA Geometry Optimization Skill

When to Use

Use this skill when the user wants to:

  • Optimize a molecular geometry with ORCA
  • Find the minimum energy structure of a molecule
  • Relax a molecular cluster or complex

Do NOT use for periodic systems (use VASP or CP2K instead).

Node Parameters (canonical names — these are what the engine actually reads)

ParameterDefaultDescription
methodB3LYPDFT functional (e.g. B3LYP, PBE0, wB97X-D4, r2SCAN-3c)
basisdef2-SVPBasis set (omit for composite methods like r2SCAN-3c)
charge0Total charge
multiplicity1Spin multiplicity (2S+1)
dispersion(none)D4 | D3BJ | D3 | none. Put D4/D3BJ HERE, not in method.
three_body_dispersionfalseAdds ABC term (D3-class only; ignored for D4)
gridDefGrid2DefGrid1/2/3 — emitted only when ≠ default
wavefunction(none)e.g. UKS for unrestricted
uno, ucofalseUnrestricted natural / corresponding orbital tweaks
num_cores4%pal nprocs
max_core_mb4000%maxcore
opt_convergence(none)e.g. TightOpt, VeryTightOpt

⚠️ extra_keywords and extra_blocks are NOT read by the ORCA workflow engine. Earlier versions of this skill recommended them; anything passed via those keys is silently dropped. Use the dedicated fields above. CPCM solvation, SlowConv/SOSCF, and NumFreq currently have no first-class field on the opt/freq/neb_ts/irc nodes — that is a node-def gap, not a usage problem.

MCP Tool Examples — proven Expanse submission flow

Use catgo_workflow (graph-based), NOT catgo_workflow_engine (task-based). The graph-based tool auto-captures the viewer structure on create. The task-based tool's add_task does not, so jobs fail with "No input structure provided". Param keys differ too: graph-based uses method/basis, task-based uses orca_method/orca_basis.

1. Confirm structure is loaded

catgo_view(action: "get_state")

2. Find the Expanse session_id

Session IDs are volatile — they change on every reconnect. Discover the current one:

curl -s http://localhost:8000/api/hpc/connections

Look for the entry with host: login.expanse.sdsc.edu and copy its session_id.

3. Create the workflow (auto-captures viewer structure)

catgo_workflow(action: "create", name: "Benzene optimization")

Returns a workflow with one structure_input node containing the current viewer structure. Note its node ID (e.g., n1777012885-iode).

4. Add the geo_opt node and connect it

Inject extra_blocks: "%output jsongbwfile True jsonpropfile True end" so ORCA emits the JSON files OPI parses on the way back. Without this, OPI parsing falls back to grepping ORCA.out (still works, just less rich).

catgo_workflow(action: "batch", workflow_id: "<wf_id>", operations: [
  {"op": "add_node", "node_type": "geo_opt", "label": "opt",
   "params": {
     "software": "orca",
     "method": "B3LYP",
     "basis": "def2-SVP",
     "charge": 0,
     "multiplicity": 1,
     "extra_blocks": "%output jsongbwfile True jsonpropfile True end"
   }},
  {"op": "connect", "from_id": "<structure_input_id>", "to_id": "opt",
   "from_handle": "structure", "to_handle": "structure"}
])

5. Run with the full HPC run_config

Real opt jobs on non-trivial molecules can run for hours — default to partition: "shared" with a generous walltime. Use debug only for tiny sanity checks (≤ a couple of heavy atoms, single-point or quick test). Read server/templates/orca_generic.sh and pass its contents as default_template.

catgo_workflow(action: "run", workflow_id: "<wf_id>", run_config: {
  "execution_mode": "hpc",
  "default_session_id": "<expanse_session_id>",
  "base_work_dir": "/expanse/lustre/projects/sdp126/jyang25/ORCA/catgo",
  "default_job_params": {
    "nodes": 1, "ntasks": 8, "cpus_per_task": 1,
    "walltime": "04:00:00", "partition": "shared"
  },
  "cluster_configs": {
    "<expanse_session_id>": {
      "account": "sdp126",
      "partition": "shared",
      "module_loads": "module load cpu/0.17.3b\nmodule load gcc/10.2.0/npcyll4\nexport PATH=$HOME/openmpi-4.1.8/bin:$PATH\nexport LD_LIBRARY_PATH=$HOME/openmpi-4.1.8/lib:$LD_LIBRARY_PATH",
      "orca_dir": "/home/jyang25/orca_6_1_1_RRP8",
      "default_template": "<contents of server/templates/orca_generic.sh>",
      "default_job_params": {
        "nodes": 1, "ntasks": 8, "cpus_per_task": 1,
        "walltime": "04:00:00", "partition": "shared"
      }
    }
  }
})

For a quick sanity check (e.g., H2O / methane / single small molecule), override to partition: "debug", walltime: "00:30:00", ntasks: 4. The debug partition caps at 30 min — anything bigger will be rejected after the limit.

The local-scratch template stages I/O to $TMPDIR/orca_$SLURM_JOB_ID and copies results back to the Lustre work_dir. Required on Expanse — Lustre is bad for ORCA's many small temp files.

6. Common parameter variations

For dispersion (non-covalent systems, dimers, π-stacking, H-bonding):

"params": {"method": "B3LYP", "basis": "def2-TZVP", "dispersion": "D3BJ", "charge": 0, "multiplicity": 1}

For D4 (newer Grimme correction, slightly better for metals):

"params": {"method": "B3LYP", "basis": "def2-SVP", "dispersion": "D4", "charge": 0, "multiplicity": 1}

For implicit solvation:

CPCM is currently a node-def gap on opt/freq/neb_ts/irc — there's no first-class solvation/solvent field, and extra_keywords is not read. UV-Vis is the exception (it has dedicated solvation/solvent fields). Until this is fixed, single-point CPCM on a gas-phase optimized geometry, or running on a non-CatGo input file, is the workaround.

For tight convergence (publication quality, pre-freq):

"params": {"method": "B3LYP", "basis": "def2-TZVP", "opt_convergence": "TightOpt", "dispersion": "D3BJ", "charge": 0, "multiplicity": 1}

For open-shell radicals:

"params": {"method": "UB3LYP", "basis": "def2-SVP", "charge": 0, "multiplicity": 2}

7. Monitor

catgo_workflow(action: "status", workflow_id: "<wf_id>")

Or query SLURM directly via the live session:

curl -s "http://localhost:8000/api/hpc/jobs/<job_id>?session_id=<expanse_session_id>"

8. Pull results when COMPLETED

Pull the ORCA outputs into a local directory, including the OPI JSON files (*.property.json is the rich structured output OPI parses):

mkdir -p ./local_run
for f in ORCA.out ORCA.xyz ORCA.engrad ORCA.property.json ORCA.json; do
  curl -s -X POST http://localhost:8000/api/hpc/files/read-content \
    -H 'Content-Type: application/json' \
    -d "{\"session_id\":\"<expanse_session_id>\",\"file_path\":\"<work_dir>/$f\"}" \
    > ./local_run/$f
done

ORCA.json and ORCA.property.json only exist if the input had the %output jsongbwfile True jsonpropfile True end block (step 4). If you omitted it, OPI parsing falls back to grepping ORCA.out.

9. Parse with OPI

Replaces hand-walking ORCA.xyz / ORCA.engrad. Requires pip install orca-pi.

import sys
sys.path.insert(0, ".claude/skills")  # for the _shared helper
from _shared.orca_opi import parse_local

out = parse_local("./local_run")

print("SCF converged:        ", out.scf_converged())
print("Geometry converged:   ", out.geometry_optimization_converged())
print("Final energy (Eh):    ", out.get_final_energy())
print("Optimized XYZ:\n", out.get_structure().to_xyz_block())

# Per-step trajectory (energy curve)
for i, geom in enumerate(out.results_properties.geometries):
    print(i, geom.single_point_data.finalenergy)

# Population analyses (any of these are one call now)
mulliken = out.get_mulliken()
print("HOMO/LUMO/gap (eV):", out.get_homo(), out.get_lumo(), out.get_hl_gap())

Viewing the optimization curve in the IDE

Use the shared helper to plot per-step energies and surface the PNG inline.

from _shared.orca_opi import quick_plot_opt_energy, show_png
png = quick_plot_opt_energy(out)            # writes ./local_run/opt_energy.png
show_png(png, "Opt energy convergence")     # prints `![Opt energy convergence](local_run/opt_energy.png)`

After running this, reply to the user with the markdown link the script printed (e.g. ![Opt energy convergence](local_run/opt_energy.png)) so Claude Code renders the figure inline in chat.

Submission gotchas (real failures we hit)

  • catgo_workflow_engine.add_task doesn't auto-attach the viewer structure → "No input structure provided".
  • partition=workq (Shaheen default) is invalid on Expanse → use debug or shared.
  • Missing account=sdp126 → "Invalid account or account/partition combination".
  • Missing module_loads + orca_dir → orca not on PATH, job runs ORCA-not-found and silently produces nothing.
  • After re-connecting to Expanse, the session_id changes — re-discover via /api/hpc/connections and update default_session_id + cluster_configs key.
  • Engine doesn't regenerate submit.sh on retry alone — call run with the new run_config to get a fresh script with updated SBATCH headers.

Dispersion Corrections

KeywordMethodWhen to use
D3BJGrimme D3 with Becke-Johnson dampingDefault choice for dispersion
D3Grimme D3 with zero dampingLegacy, use D3BJ instead
D4Grimme D4Newer, slightly better for metals

Always include dispersion for: molecular dimers, adsorption complexes, conformational searches, anything with pi-stacking or H-bonding.

Basis Set Ladder

BasisQualityCostUse
def2-SVPDouble-zetaLowScreening, initial opt
def2-TZVPTriple-zetaMediumProduction geometry
def2-TZVPPTriple-zeta+polHighAccurate energetics
def2-QZVPPQuadruple-zetaVery highBenchmark only

Strategy: optimize with def2-SVP, then single-point with def2-TZVP for energy.

SCF Convergence Issues

ORCA SCF tweaks like SlowConv, VerySlowConv, SOSCF, SmearTemp 5000 are not exposed as first-class node params (gap in the engine). For now: pre-optimize with a smaller basis (def2-SVP) and feed that geometry to a larger-basis run, or run ORCA directly on a hand-edited input file outside the workflow engine.

Common Mistakes

  • Forgetting dispersion for non-covalent systems (huge geometry errors)
  • Using restricted (R) method for open-shell (use UB3LYP, not B3LYP)
  • Basis set too large for optimization (optimize with SVP, refine energy with TZVP)
  • Not checking for imaginary frequencies after optimization

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

abinit

무료

Generate and manage ABINIT DFT calculations. Use when the user requests ABINIT, or needs DFPT phonons, GW calculations, or BSE optical spectra.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Hello-QM/catgo-LRG2082026년 10월 23일 업데이트

Use when the user asks to place an adsorbate molecule on a surface, find adsorption sites, or set up a surface+adsorbate model for DFT.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Hello-QM/catgo-LRG2082026년 10월 23일 업데이트

Use when the user asks for adsorption energy, binding energy, or wants to compare how strongly a molecule binds to a surface.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Hello-QM/catgo-LRG2082026년 10월 23일 업데이트

Use when the user asks to analyze computational results: Gibbs free energy, OER/HER/CO2RR overpotentials, adsorption energy, convergence tests, DOS/d-band analysis, or Bader charge analysis.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Hello-QM/catgo-LRG2082026년 10월 23일 업데이트

Use AmberTools antechamber for molecular force field parameterization. Generates GAFF/GAFF2 parameters and AM1-BCC or RESP charges for use in AMBER or LAMMPS classical MD simulations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Hello-QM/catgo-LRG2082026년 10월 23일 업데이트

atom-ops

무료

One-shot recipes for adding, deleting, moving, and replacing individual atoms in the active CatGo viewer structure. Use whenever the user asks to "add an atom", "delete atoms", "remove this atom", "move atom N", "replace H with Li", or any single-atom edit — including "add a hydrogen on top of atom 12" / "delete atoms 5–9" / "swap the oxygen at site 3 for fluorine". Skips the discovery loop (no need to list structure tools or check adsorption sites first); goes straight to the matching `catgo_structure` action. Triggers in Chinese on 加原子, 删原子, 减原子, 移动原子, 替换原子, 增加氢, 删除氧, 把 ... 换成 ....

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Hello-QM/catgo-LRG2082026년 10월 23일 업데이트

Hello-QM의 스킬 모두 보기

이 스킬의 문제 신고