qe-calc
/qe-calc
Oblicza właściwości materiałów i kryształów metodą DFT w Quantum ESPRESSO, od struktury Materials Project lub COD.
- Autor
- teman67 ↗
- Repozytorium
- Quantum_Espresso_Automation ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 31.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 4
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 1
Brak sygnałów. Repozytorium zmienione 31.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Oblicza właściwości materiałów i kryształów metodą DFT w Quantum ESPRESSO, od struktury Materials Project lub COD.
Oryginalny opis (EN)
Compute properties of a material or crystal with DFT (Quantum ESPRESSO 7.6 in WSL), starting from a Materials Project structure (fallbacks COD/OPTIMADE/literature/built). Use when the user asks to calculate, simulate, predict or check a materials property — band structure, band gap, DOS/PDOS, lattice constants or relaxed structure, total or formation energy, equation of state, bulk/elastic moduli, phonons, dielectric constant, Born charges, magnetic moments — or mentions Quantum ESPRESSO, pw.x, ph.x, DFT, SSSP, Materials Project or an mp-id.
Jak działa
- Stage 1 — Understand the request
- Stage 2 — Environment (once per session)
- Stage 3 — Structure
- Stage 4 — Plan
- Stage 5 — Review the inputs
- Stage 6 — Run
- Stage 6b — Research loop (automatic fixes exhausted or a new error)
- Stage 7 — Analyse and check
- Stage 8 — Deliver: plots + written analysis
- Report to the user
Podgląd SKILL.md
---
name: qe-calc
description: Compute properties of a material or crystal with DFT (Quantum ESPRESSO 7.6 in WSL), starting from a Materials Project structure (fallbacks COD/OPTIMADE/literature/built). Use when the user asks to calculate, simulate, predict or check a materials property — band structure, band gap, DOS/PDOS, lattice constants or relaxed structure, total or formation energy, equation of state, bulk/elastic moduli, phonons, dielectric constant, Born charges, magnetic moments — or mentions Quantum ESPRESSO, pw.x, ph.x, DFT, SSSP, Materials Project or an mp-id.
---
# QE materials calculation pipeline
You drive `qeflow` (this repo) through `./qe.cmd <command>` from the repo root. It runs inside
WSL (Ubuntu-22.04, conda env `qe`, QE 7.6). Every number you report must come from a file this
pipeline wrote (`calcs/<label>/results/summary.json`, step outputs) — never from memory.
Supporting files (read when the stage needs them):
- `recipes.md` — property → calculation chain, parameters, and manual recipes for things the CLI
does not automate (spin-orbit, HSE, hp.x U, slabs/work function, defects, QHA).
- `troubleshooting.md` — QE error → fix table, performance and memory tips.
- `analysis_guide.md` — how to write the results analysis that goes into the HTML report (Stage 8).
- Official QE docs, installed release: `./qe.cmd docs <pw|ph|pp|dos|projwfc|bands|q2r|matdyn|hp> <keyword>`
(mirror in `docs/qe-7.6/`, Grep-able). Online: https://www.quantum-espresso.org/Doc/INPUT_PW.html
(swap PW for PH, PP, DOS, PROJWFC, BANDS, Q2R, MATDYN, HP). **Look up every keyword before you add
or change it in an input**; quote the doc line when you explain a choice to the user.
Shell: Bash tool → `./qe.cmd ...`; PowerShell tool → `.\qe.cmd ...`. Paths in arguments are relative
to the repo root (no leading `/`).
## Stage 1 — Understand the request
Extract: material (formula, phase/polymorph, mp-id, mineral name), property, accuracy wanted,
constraints (time, cores). Map the property with the table in `recipes.md`. If the phase is
ambiguous (e.g. "TiO2"), default to the ground state (lowest energy above hull) and say so; ask only
when the choice changes the answer the user cares about (e.g. they say "anatase").
## Stage 2 — Environment (once per session)
`./qe.cmd doctor`. If it prints NOT READY, stop and tell the user what to fix (README "Setup").
No MP key → the user runs `qe.cmd set-mp-key` themselves (hidden prompt). Never ask them to paste a
key into the chat and never write keys into files yourself.
## Stage 3 — Structure
1. `./qe.cmd search <formula|chemsys|mp-id> [--max-ehull 0.1]`. Choose: the requested polymorph;
otherwise the lowest `e_above_hull`, preferring `theoretical=False` (experimentally known) and
the smaller cell. Tell the user which entry and why.
2. `./qe.cmd fetch mp-XXXX` → prints `LABEL=...`. Check the summary line: formula, space group,
atom count, lattice, site moments.
3. Not in MP → `./qe.cmd search <formula> --source cod` (experimental CIFs) or `--source optimade`
(Alexandria, Materials Cloud MC3D, JARVIS, OQMD). Fetch with `cod:<id>` / `optimade:<prov>:<id>`.
Add `--reference-from mp-...` if a related MP entry can serve as the comparison reference.
4. Not in any database → WebSearch for a published CIF (paper supplementary files, AMCSD, crystallography
journals). Download it into a new empty folder `calcs/_downloads/<name>/`, read it, then
`./qe.cmd import calcs/_downloads/<name>/<file>.cif --label <L> --source paper --url <url> --experimental`.
Do not use paywalled/licensed databases (ICSD) unless the user provides the file.
5. Hypothetical material → build it with pymatgen (copy `scripts/build_structure_example.py`:
substitution into a prototype, supercell, doping, vacancy, slab, AFM cell), run it with
`./qe.cmd py scripts/<your_script>.py` (WSL env python), then `import` the CIF/JSON. Say
clearly that it is hypothetical; the plan must keep the vc-relax, and mention stability checks
(phonons, convex hull).
6. Partial occupancies are refused by `fetch/import`: pick an ordered model with the user (or an SQS).
Antiferromagnets: the structure must carry signed `magmom` site properties in a cell large
enough for the order (MP structures usually do; check the printed moments).
## Stage 4 — Plan
`./qe.cmd plan <LABEL> --property <p> [--quality fast|standard|precise] [--functional pbe|pbesol]
[--relax-mode vc-relax|relax|none] [--spin auto|on|off] [--hubbard none|mp|Fe=5.3,...]`
Read every printed decision. Adjust when:
- no reference data (COD/OPTIMADE/paper/built structures) → the plan starts as "metal"; `run` re-checks
after the first finished scf/relax and switches later steps to insulator settings if the electron
count shows a gap (printed as `[info] electronic character re-checked ...`, recorded in decisions);
- lattice constants are the goal → consider `--functional pbesol` (closer to experiment);
- the decisions show a NOTE that MP used GGA+U (transition-metal oxides/fluorides) → discuss
`--hubbard mp` (mimic MP) vs plain PBE vs computing U with hp.x (`recipes.md`);
- the user wants the experimental lattice → `--relax-mode relax` (ions only) or `none`;
- elastic constants, phonons, small energy differences → `--quality precise` or a convergence scan
first (`--property converge --param ecut|kspacing` under a separate label).
Tell the user the plan in 3-6 lines: structure, chain of steps, key parameters, size class printed by
`show`. Get a go-ahead before **medium/large** jobs, elastic (≈26 runs), phonons of cells with
>4 atoms, or anything you expect to exceed ~30 min. Small jobs: proceed.
## Stage 5 — Review the inputs
`./qe.cmd prepare <LABEL>` writes and prints the next input. Check against this list:
- `ecutwfc`/`ecutrho` ≥ the SSSP values (`./qe.cmd cutoffs <elements>`), dual 8 for US/PAW;
- k-mesh vs cell size (`step.json` has the mesh and irreducible count); metals denser;
- `nspin=2` and `starting_magnetization` signs match the intended magnetic order;
- occupations: smearing for scf/relax, `fixed` for phonons/dielectric of non-magnetic insulators,
`tetrahedra_opt` for DOS nscf;
- `HUBBARD` card labels match `ATOMIC_SPECIES` labels;
- pseudo files exist in `pseudo_dir`;
- after the first pw.x run: the `Sym. Ops.` line in `pw.out` matches the space group (48 for Fd-3m,
24 for F-43m). Far fewer means a rotated cell: re-import (imports are rotated to the standard frame).
To change something, edit `calcs/<LABEL>/<step>/pw.in` directly (hand edits are kept; `prepare --force`
regenerates and drops them). Later steps are generated just before they run, from the relaxed
structure, so only the next input exists at first.
## Stage 6 — Run
`./qe.cmd run <LABEL> --all` with the Bash tool's `run_in_background: true`; you are notified when it
exits. It resumes: finished steps are skipped; a failed step reruns as is if its input was edited after
the failure, otherwise it first gets the next automatic fix.
Progress: `./qe.cmd status <LABEL>` (scf iterations, BFGS steps, q-points). For runs of hours, start
it in the user's terminal panel instead (it then survives this session) and poll `status`.
Default MPI processes = physical cores (`QEFLOW_NPROC`); `--np N` to change, pools are automatic.
Errors are repaired automatically (`qeflow/autofix.py`, settings in `qeflow.toml` `[autofix]`): a failed
step is matched against the rules (learned ones in `autofix_rules.toml` first), the next fix of that
error's ladder is checked against the official `INPUT_*.def` of QE 7.6 (keyword exists, value is a
documented option), applied to the input and the step reruns. Output lines `[autofix] ...` show each
fix with its doc line; `./qe.cmd fixlog <LABEL>` lists them. Covered: SCF non-convergence, Davidson
failures, relaxation step limit / BFGS failure (restart from the last geometry), radial-FFT table,
cannot bracket Ef, metallic with fixed occupations, ph.x non-convergence (with `recover`), killed or
out-of-memory runs (rerun, fewer processes), missing files from earlier steps, MPI slot/CMA problems.
## Stage 6b — Research loop (automatic fixes exhausted or a new error)
`run --all` exits with code **4** and prints `NEEDS RESEARCH` + the path of
`calcs/<LABEL>/<step>/error_report.md`. Do not stop and do not ask the user; work the problem:
1. Read `error_report.md`: errors, CRASH/stderr, the output before the timing report, SCF accuracy
history, every attempt so far, the matching paragraphs of the official user guide's Troubleshooting
section, and research leads. If it says **Needs a decision** (wrong charge / pseudopotential /
structure / symmetry), fix that root cause (re-plan with higher cutoffs under a new label, re-import the
structure, fetch the pseudo), not the input.
2. Official documentation first: `./qe.cmd docs <prog> <keyword>` for each candidate keyword; Grep
`docs/qe-7.6/` (INPUT_*.def, PW/PHonon/PP user guides, release notes) for the error text.
3. Then trusted sources (WebSearch with the exact error string in quotes, plus `quantum espresso`):
quantum-espresso.org documentation and FAQ, the QE GitLab source/issues (gitlab.com/QEF/q-e: read the
routine that raised the error), the users mailing list archive (lists.quantum-espresso.org), matsci.org,
aiida-quantumespresso's error handlers. Prefer answers by QE developers; check the QE version they
refer to. Ignore unsourced blog advice.
4. Choose the smallest fix that addresses the cause. Confirm every keyword and value with
`./qe.cmd docs`. Edit `calcs/<LABEL>/<step>/<prog>.in` (hand edits are kept), or
`./qe.cmd prepare <LABEL> --step <step> --restart` for relaxations, or re-plan.
5. Record it: `./qe.cmd record-fix <LABEL> --step <step> --why "<cause -> fix>" --source "<doc keyword,
user-guide section or URL>" --change "<NAMELIST.key old -> new>"`.
6. If the fix is general (not specific to this structure), add a `[[rule]]` to `autofix_rules.toml` so it is
automatic next time (format at the top of that file).
7. Resume: `./qe.cmd run <LABEL> --all` in the background. Repeat from 1 on the next failure.
Stop only when the research budget is used (`max_research_fixes`, printed by `run`), or the evidence
shows the calculation itself is wrong (unphysical structure, missing pseudopotential): then report to the
user what failed, what was tried (`./qe.cmd fixlog <LABEL>`), and the options.
## Stage 7 — Analyse and check
`run --all` ends with the analysis; `./qe.cmd analyze <LABEL>` re-runs it → `results/summary.json`,
`results/report.md`, plots (`bands.png`, `dos.png`, `bands_dos.png`, `phonons.png`, `thermo.png`,
`eos.png`, `elastic.png`, `convergence.png`, `structure.png`, `diagnostics.png` as applicable) and derived
quantities (effective masses, band-edge orbital character, Debye temperature, Pugh/Zener ratios,
C_V at 300 K, ...). Look at the plots with Read. Then check, in this order:
1. Technical: every step `done`, no `error` findings; warnings explained.
2. Physical sanity: relaxed space group unchanged; volume within a few % of MP (PBE overestimates
~1-3 %); metal vs insulator consistent with the reference; moments sensible; no imaginary phonons
(or explain them); Cij Born-stable; EOS minimum inside the sampled range.
3. Reference comparison table in the report (MP values are VASP PBE/GGA+U — compare like with like;
experiment differs for known reasons, e.g. PBE gaps ~30-50 % too small).
4. Convergence: if a quantitative claim depends on it (moduli, phonons, small energy differences) and
no convergence scan was run, say so or run one.
## Stage 8 — Deliver: plots + written analysis
Controlled by `qeflow.toml` `[delivery]` (`./qe.cmd prefs`). Do this when `auto_report = true` (the
default) or whenever the user asks for plots, a report or an analysis:
1. `run --all` has already analysed the job and built a first `results/report.html` (empty analysis
section). After manual runs: `./qe.cmd analyze <LABEL>`.
2. Read `calcs/<LABEL>/results/summary.json` and look at every PNG listed under `figures` (Read tool).
3. Write `calcs/<LABEL>/results/analysis.md` following `analysis_guide.md` at the `analysis_detail`
level (`brief` or `full`).
4. `./qe.cmd report <LABEL>` (adds `--open` itself when `open_in_browser = true`). It prints the
Windows paths of the report and figures.
5. Give it to the user in one SendUserFile call (status "normal"): the report
`calcs/<LABEL>/results/report.html` (use the Windows path `report` printed) with display "render"; if `send_plots = true`,
also the property's main figures (bands_dos/bands/dos/phonons/thermo/eos/elastic/convergence;
structure and diagnostics only if something in them needs attention). One-line caption.
6. If `publish_artifact = true`: `./qe.cmd report <LABEL> --artifact`, load the `artifact-design`
skill, then publish `results/report_artifact.html` with the Artifact tool (icon "chart"; description
one sentence) and give the link.
7. In the chat: lead with the answer (key numbers with units), then 3-5 bullets of interpretation and
any warning that changes how far the result can be trusted. The report holds the rest.
If `auto_report = false` and the user did not ask for a report, skip 2-6 and report in the chat as below.
The user can change the behaviour in words ("brief analysis from now on", "stop sending plots",
"also publish reports"): edit the matching key in `qeflow.toml` and confirm in one line.
## Report to the user
Lead with the answer (value ± what limits it). Then: structure used (source id, space group, relaxed
lattice), method (functional, pseudos, cutoffs, k-mesh, spin/U), the comparison table, check results,
caveats, and paths to `report.html`/`report.md` and plots. Mention follow-ups only if they matter (HSE for
gaps, convergence, SOC for heavy elements).
## Do not
- write pw.x inputs from scratch — generate with `prepare`, then edit;
- go below SSSP cutoffs, or compare energies computed with different pseudos/cutoffs/k-spacing
(formation energies: plan every job with the same `--cutoff-elements`);
- move scratch (`QEFLOW_SCRATCH`) onto `/mnt/<drive>` — QE I/O there is very slow;
- delete `calcs/<label>` folders (they are the provenance); `./qe.cmd clean <label>` frees scratch only.
Pliki w paczce (4)
- SKILL.md 14 KB
- analysis_guide.md 5 KB
- recipes.md 6 KB
- troubleshooting.md 5 KB
Wersje
W bazie nie ma innych skilli o nazwie qe-calc.
Migawka bazy z 13.11.2026 · wersja paczki 722bf8a6442b (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100quantum-espresso
Pomaga w obliczeniach z pierwszych zasad w Quantum ESPRESSO: SCF, struktury pasmowe, DOS, fonony i gęstość ładunku. - 100quantum-espresso
Wspiera obliczenia materiałowe w Quantum ESPRESSO: SCF, pasma, DOS, sprzężenie elektron-fonon i powierzchnie Fermiego. - 100dft-qe
Generuje zadania wejściowe Quantum ESPRESSO (SCF, NSCF, relax, vc-relax, MD, pasma, DOS, fonony) ze struktury i ustawień DFT podanych przez użytkownika. - 100vasp
Prowadzi obliczenia DFT z falami płaskimi w VASP na HPC przez narzędzia dft_*: projekt obliczeń, wysyłanie i monitorowanie zadań, diagnoza błędów i interpretacja wyników dla decyzji w odkrywaniu materiałów. - 100phonopy
Prowadzi przepływ pracy z fononami w phonopy, niezależnie od silnika sił: obliczenia skończonych przemieszczeń, stałe siłowe, struktura pasmowa, DOS i wielkości termiczne, z VASP, Quantum ESPRESSO lub ML. - 100alterlab-pymatgen
Analizuje i przetwarza materiały biblioteką pymatgen: struktury krystaliczne, diagramy fazowe, struktury elektronowe, powierzchnie i dostęp do bazy Materials Project.