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

cp2k-geo-opt

CP2K geometry optimization. Handles bulk, slab, and molecular systems with GPW method. Efficient for large systems (200+ atoms).

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

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

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md7.0 KB

SKILL.md(원문)

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

CP2K Geometry Optimization

Set up and submit CP2K geometry optimizations using the Gaussian and Plane-Wave (GPW) method. CP2K is the preferred code for systems larger than ~200 atoms where VASP becomes memory-limited.

Scenario 1: Bulk Optimization

Full cell and ionic relaxation for periodic bulk systems.

from catgo.workflow import Workflow

wf = Workflow("CP2K bulk MgO")
struct = wf.add_task("structure_input", structure=bulk_json)

opt = wf.add_task("geo_opt",
                  structure=struct.output.structure,
                  software="cp2k",
                  cell_opt=True,          # Relax cell + ions (like ISIF=3 in VASP)
                  cutoff=600,             # Ry
                  rel_cutoff=60,          # Ry
                  basis_set="DZVP-MOLOPT-SR-GTH",
                  xc_functional="PBE",
                  max_iter=200,           # Max geo_opt steps
                  eps_geo=3e-4,           # Force convergence (Hartree/Bohr)
                  system_name="bulk_MgO")

wf.submit()

MCP equivalent:

catgo_workflow_v2(action="create", params={"name": "CP2K bulk MgO"})

catgo_workflow_v2(action="add_task", params={
  "workflow_id": "wf_xxx",
  "task_type": "structure_input",
  "structure": "<bulk_json>"
})

catgo_workflow_v2(action="add_task", params={
  "workflow_id": "wf_xxx",
  "task_type": "geo_opt",
  "software": "cp2k",
  "structure": "{{t_001.output.structure}}",
  "cell_opt": true,
  "cutoff": 600,
  "basis_set": "DZVP-MOLOPT-SR-GTH",
  "system_name": "bulk_MgO"
})

catgo_workflow_v2(action="submit", params={"workflow_id": "wf_xxx"})

Scenario 2: Slab Optimization

Fixed cell, ionic relaxation with frozen bottom layers. Analogous to VASP ISIF=2.

wf = Workflow("CP2K TiO2 slab")
struct = wf.add_task("structure_input", structure=slab_json)

opt = wf.add_task("geo_opt",
                  structure=struct.output.structure,
                  software="cp2k",
                  cell_opt=False,         # Fix cell (slab)
                  cutoff=600,
                  basis_set="DZVP-MOLOPT-SR-GTH",
                  freeze_layers=2,        # Freeze bottom 2 layers
                  poisson_solver="MT",    # Martyna-Tuckerman for slab geometry
                  system_name="TiO2_slab")

wf.submit()

Slab-specific settings:

  • cell_opt=False — mandatory for slabs (equivalent to ISIF=2 in VASP)
  • freeze_layers=2 — freeze bottom layers to mimic bulk
  • poisson_solver="MT" — Martyna-Tuckerman solver handles the vacuum correctly for 2D-periodic systems. Use "PERIODIC" for bulk (3D-periodic) and "MT" or "WAVELET" for slabs

Scenario 3: Adsorbate on Slab

Same as slab, with adsorbate atoms free to relax:

opt = wf.add_task("geo_opt",
                  structure=adsorbate_slab_json,
                  software="cp2k",
                  cell_opt=False,
                  freeze_layers=2,
                  cutoff=600,
                  vdw_method="DFTD3",    # Dispersion for adsorption
                  poisson_solver="MT",
                  system_name="*OH_on_TiO2")

Scenario 4: Large System (500+ atoms)

CP2K's GPW method with OT (Orbital Transformation) SCF solver scales linearly for large systems:

opt = wf.add_task("geo_opt",
                  structure=large_system_json,
                  software="cp2k",
                  cutoff=400,                   # Lower cutoff acceptable for screening
                  basis_set="SZV-MOLOPT-SR-GTH", # Minimal basis for speed
                  ot_minimizer="DIIS",           # OT method for large systems
                  ot_preconditioner="FULL_ALL",
                  eps_scf=1e-5,
                  system_name="large_system")

OT vs diagonalization:

  • OT: O(N) scaling, no HOMO-LUMO gap requirement, default for > 100 atoms
  • Diagonalization: O(N^3) scaling, needed for metallic systems (zero gap)

For metals: OT does not work for metallic systems (zero band gap). Use Fermi-Dirac smearing with diagonalization:

opt = wf.add_task("geo_opt",
                  structure=metal_json,
                  software="cp2k",
                  scf_method="diag",          # Standard diagonalization
                  smearing_method="FERMI_DIRAC",
                  electronic_temperature=300,  # K
                  system_name="metal")

Key Parameters

ParameterDefaultPurpose
cutoff600 RyPW cutoff for density grid
rel_cutoff60 RyMulti-grid relative cutoff
basis_setDZVP-MOLOPT-SR-GTHGaussian basis set
xc_functionalPBEExchange-correlation functional
max_iter200Max geometry optimization steps
eps_geo3e-4Force convergence (Hartree/Bohr, ~ 0.015 eV/A)
eps_scf1e-6SCF convergence (Hartree)
cell_optFalseWhether to optimize cell parameters
freeze_layers0Number of bottom layers to freeze
vdw_methodNoneDispersion correction ("DFTD3", "DFTD3(BJ)")
poisson_solverPERIODICPoisson solver ("PERIODIC", "MT", "WAVELET")

Convergence Monitoring

catgo_workflow_v2(action="status", params={"workflow_id": "wf_xxx"})

catgo_analyze(action="convergence", params={"task_id": "t_opt"})
# Returns: energy vs step, max force vs step

catgo_analyze(action="forces", params={"task_id": "t_opt"})

Chain: CP2K Optimization then Frequency

wf = Workflow("CP2K opt + freq")
struct = wf.add_task("structure_input", structure=slab_oh_json)

opt = wf.add_task("geo_opt", structure=struct.output.structure,
                  software="cp2k", freeze_layers=2,
                  system_name="*OH")

frq = wf.add_task("freq", structure=opt.output.structure,
                  software="cp2k",
                  freeze_mode="layers", freeze_layers=4,
                  system_name="*OH")

gib = wf.add_task("gibbs_energy",
                  energy=opt.output.energy,
                  frequencies=frq.output.frequencies,
                  phase="adsorbed", system_name="*OH")

wf.submit()

Output

The geo_opt task produces:

  • output.structure — optimized structure (pymatgen dict as JSON string)
  • output.energy — total DFT energy in eV

Troubleshooting

ProblemFix
SCF not convergingUse OT method, increase scf_max_iter, reduce mixing
Energy oscillationsIncrease cutoff (try 800 Ry), check rel_cutoff
Forces not convergingLoosen eps_geo, increase max_iter
OT fails for metalSwitch to diagonalization with Fermi smearing
Memory errorReduce cutoff, use SZV basis, increase nodes
Missing basis for elementCheck CP2K basis set library, may need to download
Poisson solver error for slabUse poisson_solver="MT" instead of "PERIODIC"

Unit Conversions

CP2K uses atomic units internally. CatGo converts automatically, but for reference:

  • 1 Hartree = 27.2114 eV
  • 1 Bohr = 0.529177 A
  • Force: 1 Ha/Bohr = 51.422 eV/A
  • eps_geo=3e-4 Ha/Bohr corresponds to ~0.015 eV/A (comparable to VASP EDIFFG=-0.02)

리뷰

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

댓글

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

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

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. 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의 스킬 모두 보기

이 스킬의 문제 신고