Skip to content

feature/SOF-8044 Feature: add the h-BN boron-vacancy formation-energy tutorial page - #404

Open
VsevolodX wants to merge 28 commits into
mainfrom
feature/SOF-8044
Open

VsevolodX wants to merge 28 commits into
mainfrom
feature/SOF-8044

Conversation

@VsevolodX

@VsevolodX VsevolodX commented Sep 13, 2026

Copy link
Copy Markdown
Member

Tutorial page for the h-BN boron-vacancy formation-energy Specific Example (api-examples PR: mat3ra/api-examples#367), Jira SOF-8044, epic SOF-7994.

What changed

  • New tutorials/materials/specific/defect-point-vacancy-boron-nitride-simulation.md: what is reproduced (QPOD 1BN-1.2d.v_B.0.1, 10.18 eV, standard states; only q = 0), the formation-energy definition, settings and where they differ from QPOD (GBRV ultrasoft vs PAW, 48- vs 84-atom cell), the optional relaxation (RELAX_DEFECT: fast SCF 10.46 eV / relaxed 10.12 eV vs QPOD 10.18) and the 0.2 eV tolerance, theory vs experiment, what the default run submits, the JupyterLite embed.
  • mkdocs.yml and mkdocs-guide.yml: one nav line each, next to the structure page; index-guide.md and tutorials/materials/specific/overview.md: the Bertoldo row now links the page instead of "Coming Soon".
  • references.bib: Bertoldo2022 journal corrected to npj Computational Materials.

Verified

  • scripts/serve-all.sh --build + scripts/links/check-links.py: no broken internal links (332 664 checked); the page appears in the Guide nav next to its prerequisite; the citation renders.

Manual checks (merging accepts anything unticked)

  • The jupyterlite_embed opens specific_examples/defect_point_vacancy_boron_nitride_SIMULATION.ipynb on the preview — requires the api-examples PR merged and the JupyterLite build refreshed first.
  • Numbers on the page match the notebook's printed E_f from the production runs (10.46 unrelaxed, 10.12 relaxed).

Merge after mat3ra/api-examples#367.

VsevolodX and others added 8 commits September 12, 2026 21:28
Reproduces QPOD's neutral V_B formation energy (10.18 eV, standard
states) for the h-BN vacancy tutorial pair, mirroring the graphene
substitution simulation page's structure.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review blockers: correct n_i to the signed atom-count change (the page
had E_f short by 2*mu_B), stop promising the four Total Energy jobs
always share one model (the notebook reuses an existing job per
material instead), state the 0.02 eV finite-size offset without
implying it bounds the tolerance, and register the page in
mkdocs-guide.yml (Tutorials site), which was missing it entirely.

Should-fix: numeric cutoff/k-grid in the settings table, npj (not
Nature) Computational Materials in the body, reconcile the nitrogen
reference job with its zero coefficient, $$...$$ for the equation, and
name the compute defaults in what the default run does.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The notebook's model is GBRV ultrasoft PBE at 40 Ry / 200 Ry, not PAW
PseudoDojo JTH -- ultrasoft PBE sets for B and N do exist. Update the
settings table and the surrounding sentence, and keep the pseudopotential
family as one of the differences the 0.5 eV tolerance covers.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Round-2 review: the "clean project" sentence described a project
selector the notebook doesn't have -- replace it with the actual
consistency check the results cell runs (recompute E_f from three
owned total energies, warn on mismatch). Note that PAW and ultrasoft
cutoffs aren't comparable numbers, and fold cutoff into the tolerance's
unestimated differences. Correct "jobs already finished are reused" --
only the three reference jobs are; the defect job always runs. Fix the
references.bib journal to npj Computational Materials (was Nature).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Round-3 review: the reference-reuse and cluster-fallback paragraphs
described notebook behaviour 64b562aa changed away from. Reuse is now
keyed to a per-material, per-model job name, so a cutoff change can't
silently reuse a stale reference -- the residual hazard is the
workflow's own elemental-energy resolution, which the results cell's
consistency check catches; a missing cluster now raises and lists the
available ones instead of falling back silently. Also: fix the
inverted "skipped otherwise" for reference jobs, add the third verdict
line form (reference mismatch), add k-point density to the unestimated
differences, and make the atom counts (pristine -> defective) explicit
in the settings table.

Prerequisite page: journal name and a line noting both materials
(h-BN supercell, B-vacancy h-BN) are saved by name, matching its own
notebook's cell 15.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
api-examples 144f2c2f lets CLUSTER_NAME be None to use the first listed
cluster; a name that is set but not found still raises and lists the
available ones. State both in the compute paragraph.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Round-4 blocker: the prerequisite page's generic create_nanoribbon /
create_point_defect route does not save two named materials -- only
the combined notebook embedded in its own section 6 does. Say so on
both pages, so the new page's prerequisite step names the right
notebook.

Should-fix: CLUSTER_NAME's shipped default is "cluster-001", not
unset; match cell 44's verdict suffix byte for byte (ASCII "--", not
an em dash); expand QPOD, GPAW, PBE, PAW at first use; state once that
the elemental references are the platform's own seeded materials
(why mu_B is alpha-boron specifically) and that an unseeded account
stops the notebook at that step.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… ref

QPOD expands to "Quantum Point Defect database" (singular, lowercase
"database") per the manuscript itself, not "Quantum Point Defects
Database". Reflow that paragraph to the surrounding line width. The
prerequisite notebook lives in its section 6, not "its last section"
(References). Expand GBRV once (Garrity-Bennett-Rabe-Vanderbilt).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@netlify

netlify Bot commented Sep 13, 2026

Copy link
Copy Markdown

Deploy Preview for mat3ra-documentation ready!

Name Link
🔨 Latest commit 194b062
🔍 Latest deploy log https://app.netlify.com/projects/mat3ra-documentation/deploys/6aac8b34c8d0790008eea4ac
😎 Deploy Preview https://deploy-preview-404--mat3ra-documentation.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

VsevolodX and others added 5 commits September 15, 2026 16:13
Physics decision (VB, 2026-09-15): the notebook now fixes the defect
cell's total magnetization to 1 uB, the doublet QPOD reports, instead
of a starting-magnetization guess. An unconstrained SCF on this cell
finds a quartet (3 uB) 0.22 eV lower -- state both, and that the
doublet is what is compared with QPOD.

Add the measured production result (10.46 eV vs QPOD's 10.18 eV,
+0.28 eV, inside tolerance, verdict yes; four jobs at 2-6 min each on
40 cores), and note in the offsets paragraph that the MACE estimates
were spin-blind and that the 0.28 eV gap is dominated by the doublet's
relaxation energy, which QPOD's cell includes and this SCF-only
workflow does not.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…n timing

Round-6 review: the offsets paragraph said skipping relaxation costs
0.04 eV and, two sentences later, that relaxation dominates the
measured 0.28 eV gap -- both cannot hold. Retire the 0.04 eV figure
for the doublet (it was a spin-blind MACE estimate) and back the
"largest single contributor" claim with the actual forces (2.0 eV/A
on the vacancy's N neighbours vs 0.01 eV/A pristine and QPOD's own
threshold) rather than stating an unmeasured relaxation energy as fact.

Also: the timing sentence now describes the doublet run that actually
produced 10.46 eV (one ~8 min defect job, three references reused from
an earlier run at 2-4 min each), not the earlier quartet run's range;
one sentence on why the doublet -- not the lower-energy quartet -- is
the state compared with QPOD (QPOD's entry is the relaxed doublet, and
relaxation's effect on the ordering is undetermined here); and Bohr
magneton written out at first use so muB (magnetization) and mu_B
(boron's chemical potential) are no longer one underscore apart.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Physics decision (VB, 2026-09-15): RELAX_DEFECT is now an optional
notebook parameter (default False). Document both configurations --
unrelaxed SCF (10.46 eV, +0.28 eV, no) and relaxed defect (10.12 eV,
-0.07 eV, yes) -- where the page describes what the run does, and the
12-hour wall-time limit that the relaxation needs.

Add the relaxation geometry (three N neighbours move 0.07-0.13 A
outward, a small Jahn-Teller distortion of the doublet) and its 0.35 eV
energy. With the relaxed value now measured, retire the spin-blind
0.02/0.04 eV MACE estimates and the "most likely relaxation" hedge;
tighten the verdict tolerance from 0.5 to 0.2 eV, which the relaxed
result and its pseudopotential/cell-size differences still clear.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Round-7 review: on the recommended (relaxed) path, the notebook prints
a residual total force about 3x the page's stated 0.01 eV/A criterion.
State why -- it is Quantum ESPRESSO's norm over every atom, not the
per-atom maximum, which this run met at 0.009 eV/A.

Also: justify the 0.2 eV tolerance from the known differences (0.02 eV
finite-size estimate, unquantified pseudopotential set) rather than
from the relaxed result itself; state the unrelaxed run's timing from
the measured per-job table (~15 min cold, ~6 min once references are
reused) instead of an unsourced "~7 minutes"; make the section heading
and job count cover both configurations (up to five jobs with
RELAX_DEFECT); note the mismatch suffix is appended to the verdict
line, not substituted for it; merge the Geometry/Relaxation table rows
and note only the defective cell is relaxed here, against QPOD
relaxing every structure; and round 10.12 - 10.18 consistently to
-0.06 eV.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The notebook is losing its data-presence guards and the "-- reference
mismatch, see warning above" suffix (VB: unnecessary). Remove every
mention of it and the consistency-check warning from the page; keep
the description that the results cell prints the workflow's E_f next
to the E_f recomputed from the notebook's own three total energies, so
the reader can see they agree. The two verdict forms are now exactly
"yes (relaxed defect)" / "no (unrelaxed SCF)".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@VsevolodX
VsevolodX marked this pull request as ready for review September 16, 2026 18:30
VsevolodX and others added 14 commits September 16, 2026 11:45
The tutorials index and its full-overview page still showed the
h-BN vacancy row's Properties cell as "(Coming Soon)". Link it to
the new simulation page, matching the Fujimoto and Liu rows' form.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
VB: the page must look like the existing tutorials, not invent its own
way, and must not explain physics the paper already explains. Rewrote
against SOF-8043's Gr/Ni simulation page (primary template, unmerged)
and the merged MoS2 / graphene-substitution simulation pages: same
section shape (Introduction + "what is being reproduced" subsection,
Prerequisites, Workflow overview with a one-line formula, Calculation
parameters table, How to run, Expected results, embed), same terse
per-row/per-bullet treatment of settings instead of paragraphs.

Deleted: the displayed formation-energy equation and its DeltaN
derivation, the doublet/quartet discussion, the Jahn-Teller /
displacement paragraph, the pseudopotential-cutoff-comparability
sentences, the total-force-norm explanation, the tolerance-rationale
paragraphs, and acronym expansions the sibling pages don't carry
(GBRV, GPAW, PBE, PAW, QPOD). Kept every fact needed to run the
notebook and read its output: the manuscript, the target values and
source, the parameters table, the RELAX_DEFECT toggle, the two
measured results, and the verdict strings.

107 lines, down from 185; closer to the sibling pages' proportions of
manuscript / parameters / results content.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
VB pointed at the two merged pages -- defect-point-substitution-graphene-
simulation.md and the MoS2 simulation page -- not SOF-8043's unmerged
one, and said the earlier "collapse step-by-step and customization into
one How-to-run section" was wrong. Undo that: restore the full section
list, order and heading wording the graphene page (the closest match,
another defect SE) uses -- Introduction (+ manuscript note and "What is
being reproduced"), Prerequisites, Workflow overview, Calculation
parameters (4.1 DFT parameters, 4.2 Relaxation settings), Step-by-step
instructions (5.1-5.5, with the notebook's actual top-cell parameter
values at api-examples 1f26d397), Expected results (+ 6.1 Comparison
with published results), Customization options (7.1-7.3), Troubleshooting
(8.1-8.3), embed, References.

Still no physics exposition per VB's standing rule: every fact is one
line or one table row, as the sibling pages state theirs.

237 lines, matching the graphene page's (235) proportions and depth.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
api-examples e205404c: the parameter is RELAX (was RELAX_DEFECT).
RELAX = True now looks for an already-relaxed structure matched by
content hash and model before relaxing again, and saves a new
relaxation as "B-vacancy h-BN relaxed" for reuse by this or any other
notebook. Update every RELAX_DEFECT mention and describe both timing
regimes: default ~15 min (~6 min once references are reused); RELAX
first run ~70 min, later runs ~6 min once the relaxed structure is
found. Note the DEFECTIVE_NAME + RELAX = False shortcut for a
structure already relaxed elsewhere.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…timing

Round-9 review: the notebook resolves DEFECTIVE_NAME from ./uploads,
not the platform, so pointing it at an already-relaxed platform
material raises -- delete that paragraph. RELAX = True is the only
route to a relaxed structure and finds it automatically.

Also: "later runs ... take about 6 minutes" described a path that has
not been executed yet. State it as what the notebook does (finds the
relaxed structure and skips the relaxation) rather than as a timing
measurement, and correct the relaxation time itself to the measured
~52 minutes (PLAN Sec19), not the unmeasured ~70 used previously.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
api-examples e912516f: load_material now tries the uploads folder,
then the user's materials collection by name, before raising -- same
shape as workflows/defect_formation_energy.ipynb. Reinstate the
Customization note this enables: DEFECTIVE_NAME = "B-vacancy h-BN
relaxed" with RELAX = False picks up an already-relaxed structure from
the account instead of the uploads folder. Update Sec2 and Sec5's load
descriptions to name both sources.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…abelling

Review comments-6915843 SS2.5-2.7: SS4.2's reuse key now says "hash
together with the model and relaxation settings" instead of "hash and
model" -- the settings the notebook keys on include spin and k-point
density, and RELAX_SETTINGS is being folded in too. SS7.1's "reusable by
this notebook or any other" overstated it: the automatic hash-based
lookup exists in this notebook only, so say "reused by later runs of
this notebook" and keep "loadable by name elsewhere" for the separate,
real capability. Also note that pointing the DEFECTIVE_NAME shortcut
at an already-relaxed structure prints the "(relaxed defect)" verdict
label, not "(unrelaxed SCF)".

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
api-examples 032f846a: the invented-metadata reuse design (structure
hash + model + settings tag) is gone. The notebook now resolves an
already-relaxed structure through the relaxation job recorded for that
material under those settings, waiting for one still running instead
of starting a second. Restate SS4.2 in user terms: reused if already
relaxed with these settings, waited on if still running, repeated only
when the model, spin or relaxation settings change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
032f846a dropped the isRelaxed check (isRelaxed = False even on a
genuinely relaxed structure, so it never fired) -- config_label is
keyed on RELAX alone again. The shortcut still prints (unrelaxed SCF);
point the reader at the provenance lines instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rson

SS4.2's list of settings that trigger a fresh relaxation omitted
k-point density, which the notebook keys on alongside model, spin and
relaxation settings. Also replace the page's four "your" instances
with impersonal phrasing ("the account's materials collection"),
matching WRITING-STYLE.md and the rest of this folder.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
SS7.2's code block showed CLUSTER_NAME = None as if it were the
default, contradicting SS5.2's cluster-001. State the default and what
None does instead of just showing the value. SS8.3 said the relaxation
"needs the full 12-hour time limit" while SS5.4 gives the measured ~52
minutes -- 12 hours is the notebook's default ceiling, not a
requirement; state the measured time instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
api-examples 2dbb6779: find_relaxed_material matches on the structure's
content hash only, with no workflow-name or settings filter -- a
deliberate decision (any relaxed version of this structure is better
than none). SS4.2 described a settings-keyed key that no longer exists;
state instead that a relaxed version of the structure is reused
whatever settings produced it, so changing the model, spin or k-point
density does not trigger a fresh relaxation, and a run that needs one
must remove or rename the existing relaxed structure (or use a
different project/account). Also drop "matching" from SS5.3's mention
of the same lookup.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The lookup matches on content hash and owner account only -- renaming
or deleting the relaxed material does not help (project isn't in the
query, and the material is reached through the job's final_structure,
so deleting it would dangle). State what actually works: a different
account, or relaxing separately and pointing DEFECTIVE_NAME at that
structure with RELAX = False. Also: the found-branch prints the
structure's name and id, not a job.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…1 default

Merged origin/main (SOF-8043 PR #400) first. Its SIMULATION tutorial
was rewritten twice after the shape this page originally copied ("as
instructions, not physics", "remove verdict wording") and is now the
settled reference for this page's family. Flattened SS4 to match --
one table, prose, no DFT/Relaxation subsections -- since our
comparison table already carries the this-tutorial-vs-QPOD divergences
a bullet list would restate.

Kept the verdict wording: unlike Gr/Ni (whose notebook stopped
printing a pass/fail verdict, which is why its page dropped the
wording), this notebook still prints one, so the page describing it is
accurate, not physics narrative. Kept Troubleshooting: it is
mechanical (material not found, missing reference, job errors), the
same kind of content the graphene-substitution sibling both pages
follow still carries, not the physics-adjacent asides Gr/Ni's rewrite
removed from its own.

Replaced cluster-001 (our own test cluster) with CLUSTER_NAME = None
(the account's first listed cluster) in SS5.2 and SS7.2, matching the
notebook's own upcoming default; scanned the page for other
environment-specific values (account names, job ids, project names,
absolute paths) and found none.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant