Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add BryceByeongchan/rubato-skills --skill "rubato-bgw-absorption"
Install specific skill from multi-skill repository
# Description
Generate and validate absorption.inp for BerkeleyGW BSE optical absorption calculation
# SKILL.md
name: rubato-bgw-absorption
user-invokable: true
description: Generate and validate absorption.inp for BerkeleyGW BSE optical absorption calculation
argument-hint: "number_val_bands_coarse:N number_cond_bands_coarse:N number_val_bands_fine:N number_cond_bands_fine:N energy_resolution:eV [calc_id:cNNN] [options...] | validate:
Generate or validate absorption.inp for the absorption.x executable, which solves the Bethe-Salpeter equation (BSE) to compute optical absorption spectra and exciton properties.
Usage
Generate mode (default):
rubato:bgw-absorption number_val_bands_coarse:N number_cond_bands_coarse:N number_val_bands_fine:N number_cond_bands_fine:N energy_resolution:eV [calc_id:cNNN] [options...]
Validate mode:
rubato:bgw-absorption validate:<input_file>
Generate arguments
number_val_bands_coarse:Nβ Required. Valence bands on coarse grid (must match kernel.inp).number_cond_bands_coarse:Nβ Required. Conduction bands on coarse grid (must match kernel.inp).number_val_bands_fine:Nβ Required. Valence bands on fine grid.number_cond_bands_fine:Nβ Required. Conduction bands on fine grid.energy_resolution:eVβ Required. Broadening width for absorption spectrum (eV). Typical: 0.05β0.15 eV.calc_id:cNNNβ Save tocalc_db/{calc_id}/input/. If omitted, save to current directory.use_velocityβ Use velocity operator for dipole transitions (recommended).use_momentumβ Use momentum operator (no WFNq_fi needed).diagonalization/haydock/lanczosβ Solver method (default: diagonalization).tda_bse/full_bseβ TDA (default) or full BSE.eqp_co_correctionsβ Interpolate QP corrections from coarse to fine grid.write_eigenvectors:Nβ Write first N eigenvectors (0=none).gaussian_broadening/lorentzian_broadening/voigt_broadeningβ Broadening type.cell_slab_truncation/cell_box_truncation/cell_wire_truncationβ Coulomb truncation.
Execution β Generate Mode
Step 1: Construct absorption.inp
number_val_bands_coarse {number_val_bands_coarse}
number_cond_bands_coarse {number_cond_bands_coarse}
number_val_bands_fine {number_val_bands_fine}
number_cond_bands_fine {number_cond_bands_fine}
diagonalization
use_velocity
gaussian_broadening
energy_resolution {energy_resolution}
Optional additions (include only if user requests):
eqp_co_corrections # interpolate QP corrections
write_eigenvectors {N} # write first N exciton eigenvectors
use_wfn_hdf5 # HDF5 wavefunctions
cell_slab_truncation # 2D Coulomb truncation
screening_semiconductor # default, usually omitted
haydock # iterative solver (replaces diagonalization)
number_iterations 100 # for haydock/lanczos
full_bse # non-TDA (replaces tda_bse)
Step 2: Validate the generated input
python {skill_dir}/bgw_validate.py '{"mode": "validate", "input_file": "<temp_path>", "ref_file": "{skill_dir}/refs/absorption.json"}'
If errors are found, fix them before proceeding.
Step 3: Show and save
- Show the complete
absorption.inpto the user. - If the validator found warnings, show them.
- Ask for confirmation or modifications.
- Save to
calc_db/{calc_id}/input/absorption.inpifcalc_idis given, or./absorption.inpotherwise.
Execution β Validate Mode
When validate:<input_file> is given, validate an existing absorption.inp file.
Step 1: Run mechanical validation
python {skill_dir}/bgw_validate.py '{"mode": "validate", "input_file": "<path>", "ref_file": "{skill_dir}/refs/absorption.json"}'
Step 2: Semantic validation (your judgment)
- All four band counts are required. Error if any are missing.
energy_resolutionis required. Error if missing.number_val_bands_coarseandnumber_cond_bands_coarsemust match kernel.inp values.number_val_bands_fine>=number_val_bands_coarse(typically).number_cond_bands_fine>=number_cond_bands_coarse(typically).- Solver keywords are mutually exclusive: only one of
diagonalization,haydock,lanczos,diagonalization_primme. - Broadening keywords are mutually exclusive: only one of
gaussian_broadening,lorentzian_broadening,voigt_broadening. haydockrequireslorentzian_broadening. Warn ifgaussian_broadeningis used withhaydock.full_bseauto-setsextended_kernel. Warn ifextended_kernelis missing from kernel.inp.use_symmetries_coarse_gridmust match kernel.inp setting.- Only one Coulomb truncation keyword should be present (mutually exclusive).
- Only one screening model should be present (mutually exclusive).
Step 3: Report results
- Show summary: N errors, M warnings.
- List each error with explanation and fix suggestion.
- Add semantic issues from Step 2.
- Offer to fix issues automatically.
Keyword lookup
python {skill_dir}/bgw_validate.py '{"mode": "lookup", "ref_file": "{skill_dir}/refs/absorption.json", "variables": ["keyword1", ...]}'
Rules
- All four band counts and
energy_resolutionare always required. If the user does not provide them, ask. number_val_bands_coarseandnumber_cond_bands_coarsemust match kernel.inp. Warn if mismatch detected.- Solver keywords are mutually exclusive. Only one of
diagonalization,haydock,lanczos,diagonalization_primme. haydockonly supportslorentzian_broadening. Die with error if combined withgaussian_broadening.voigt_broadeningrequiresenergy_resolution_sigmaandenergy_resolution_gamma. Both Gaussian and Lorentzian components must be specified.full_bserequiresextended_kernelin kernel.inp. Remind the user of this requirement.- For 2D systems, always include
cell_slab_truncation. Warn if slab system detected but truncation missing. - Show the complete absorption.inp before saving. Never write without user confirmation.
- When saving to a calc directory, always use the
input/subdirectory:calc_db/{calc_id}/input/absorption.inp. - In validate mode, show all errors at once. Suggest fixes for every error.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.