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-epsilon"
Install specific skill from multi-skill repository
# Description
Generate and validate epsilon.inp for BerkeleyGW dielectric function calculation
# SKILL.md
name: rubato-bgw-epsilon
user-invokable: true
description: Generate and validate epsilon.inp for BerkeleyGW dielectric function calculation
argument-hint: "epsilon_cutoff:Ry number_bands:N [parent:cNNN] [calc_id:cNNN] [options...] | validate:
Generate or validate epsilon.inp for the epsilon.x executable, which computes the dielectric function (polarizability / inverse dielectric matrix).
Usage
Generate mode (default):
rubato:bgw-epsilon epsilon_cutoff:Ry number_bands:N [parent:cNNN] [calc_id:cNNN] [options...]
Validate mode:
rubato:bgw-epsilon validate:<input_file>
Generate arguments
epsilon_cutoff:Ryβ Required. Plane-wave cutoff for the dielectric matrix in Ry (typical: 15β30 Ry).number_bands:Nβ Required. Number of bands in the polarizability sum (from WFN_pb). Must be β€ bands in WFN_pb.parent:cNNNβ Parent parabands (or pw2bgw) calculation. Used to infer the number of available bands in WFN_pb.calc_id:cNNNβ Saveepsilon.inptocalc_db/{calc_id}/input/. If omitted, save to current directory.frequency_dependence:Nβ 0 = GPP (default), 2 = full-frequency contour deformation.qpoints:...β Q-points block. If not given, you must ask the user for the q-points list.
Execution β Generate Mode
Step 1: Gather q-points
The q-points block is required. If the user did not provide q-points, ask:
"Please provide the q-points list. Format per line:
qx qy qz divisor flagwhere flag = 0 (regular), 1 (qβ0 for semiconductor/insulator), 2 (q=0 exactly for metal)."
For production runs, q-points match the nscf k-grid (all irreducible q-points including qβ0). For convergence test runs, a coarse grid (e.g., 2Γ2Γ1) may be used.
Step 2: Construct epsilon.inp
epsilon_cutoff {epsilon_cutoff}
number_bands {number_bands}
begin qpoints
{q-points}
end
Optional additions (include only if user requests):
frequency_dependence {0|2} # default: 0 (GPP); 2 = full-frequency
Do not include screened_coulomb_cutoff in epsilon.inp β that keyword belongs to sigma.inp.
Step 3: Validate the generated input
Before showing the result, run the validator to catch any issues:
python {skill_dir}/bgw_validate.py '{"mode": "validate", "input_file": "<temp_path>", "ref_file": "{skill_dir}/refs/epsilon.json"}'
If errors are found, fix them before proceeding.
Step 4: Show and save
- Show the complete
epsilon.inpto the user. - If the validator found warnings, show them.
- Ask for confirmation or modifications.
- Save to
calc_db/{calc_id}/input/epsilon.inpifcalc_idis given, or./epsilon.inpotherwise.
Execution β Validate Mode
When validate:<input_file> is given, validate an existing epsilon.inp file.
Step 1: Run mechanical validation
python {skill_dir}/bgw_validate.py '{"mode": "validate", "input_file": "<path>", "ref_file": "{skill_dir}/refs/epsilon.json"}'
Step 2: Semantic validation (your judgment)
After the script's mechanical checks, perform additional checks:
- screened_coulomb_cutoff should NOT be in epsilon.inp (it belongs to sigma.inp).
- epsilon_cutoff > 40 Ry is unusual β warn.
- frequency_dependence must be 0 or 2. Value 1 is sigma-only (GPP).
- The qpoints block must have exactly one q-point with flag = 1 or 2.
- If do_rpa is present, every q-point must have a weight column.
Step 3: Report results
- Show summary: N errors, M warnings.
- List each error with explanation and fix suggestion.
- List warnings.
- Add semantic issues from Step 2.
- Offer to fix issues automatically if the user wants.
Keyword lookup
To look up documentation for any epsilon.x keyword:
python {skill_dir}/bgw_validate.py '{"mode": "lookup", "ref_file": "{skill_dir}/refs/epsilon.json", "variables": ["keyword1", "keyword2"]}'
Q-Points Format
Each line in the begin qpoints ... end block:
qx qy qz divisor flag
qx qy qzβ q-point in fractional coordinates (divided bydivisor).divisorβ integer divisor; actual q = (qx, qy, qz) / divisor.flagβ 0: regular q; 1: qβ0 (small finite displacement, for semiconductors/insulators); 2: q=0 exactly (for metals).
The block must contain exactly one qβ0 or q=0 point (flag = 1 or 2). This is required for the head of the dielectric matrix.
Example for a 4Γ4Γ1 k-grid semiconductor slab (qβ0 along x):
begin qpoints
0.001 0.0 0.0 1 1
0.25 0.0 0.0 1 0
0.5 0.0 0.0 1 0
0.0 0.25 0.0 1 0
0.25 0.25 0.0 1 0
0.5 0.25 0.0 1 0
0.0 0.5 0.0 1 0
0.25 0.5 0.0 1 0
end
Frequency Dependence Notes
frequency_dependence 0(GPP, default): Static calculation, fast. The Generalized Plasmon Pole model is applied in sigma.x. Recommended starting point.frequency_dependence 2(Full-frequency): Computes frequency-dependent polarizability on a grid. Required for full-frequency sigma. Much more expensive.- For GW-BSE, GPP is standard. Full-frequency is for advanced users needing more accurate self-energies.
Rules
epsilon_cutoffandnumber_bandsare always required. If the user does not provide them, ask.- The qpoints block is required. If not provided, ask the user for the q-points list.
- Do not add
screened_coulomb_cutoffto epsilon.inp. That keyword is only valid in sigma.inp. epsilon.number_bands>=sigma.number_bands. Remind the user of this constraint when both are being set.- Show the complete epsilon.inp before saving. Never write without user confirmation.
- When saving to a calc directory, always use the
input/subdirectory:calc_db/{calc_id}/input/epsilon.inp. - In validate mode, show all errors at once. Do not stop at the first error.
- Suggest fixes for every error. Use the validator's suggestions and add domain knowledge.
# 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.