Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 36 additions & 37 deletions other/materials_designer/specific_examples/Introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,44 @@
"Domain (`P` - Pristine, `C` - Compound Pristine, `D` - Defective, `X` - Processed) - Dimensionality - Category - Variant (if applicable)\n",
"\n",
"\n",
"| M-CODE | Category | Structure | Simulation | Reference |\n",
"| ------ | -------- |----------------------------------------------------------------------------------------------------------------------|---------------|---|\n",
"| `P-3D-CRY` | Ideal Crystal | *To be added* | — | — |\n",
"| `P-2D-MNL` | Monolayer | *To be added* | — | — |\n",
"| `P-2D-SLB-S` | Slab | [Simple Slab: SrTiO₃](slab_strontium_titanate.ipynb) | *To be added* | [[1]](#ref1) |\n",
"| `P-2D-SLB-R` | Slab | *Reconstructed slab. To be added* | — | — |\n",
"| `P-1D-NTP` | Nanotape | *To be added* | — | — |\n",
"| `P-1D-NWR` | Nanowire | *To be added* | — | — |\n",
"| `P-0D-NPR` | Nanoparticle | [Gold Nanocluster](nanocluster_gold.ipynb) | *To be added* | [[2]](#ref2) |\n",
"| `P-0D-NRB` | Nanoribbon | *To be added* | — | — |\n",
"| `C-2D-HST` | Heterostack | [Si/SiO₂/HfO₂/TiN Heterostructure](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb) | *To be added* | [[3]](#ref3) |\n",
"| `C-2D-INT-S` | Interface Simple | *To be added* | — | — |\n",
"| `C-2D-INT-Z` | Interface ZSL | [BN/Graphene 2D–2D Interface](interface_2d_2d_boron_nitride_graphene.ipynb) | *To be added* | [[4]](#ref4) |\n",
"| `C-2D-INT-Z` | Interface ZSL | [Graphene/SiO₂ 2D–3D Interface](interface_2d_3d_graphene_silicon_dioxide.ipynb) | *To be added* | [[5]](#ref5) |\n",
"| `C-2D-INT-Z` | Interface ZSL | [Cu/Cristobalite 3D–3D Interface](interface_3d_3d_copper_cristobalite.ipynb) | *To be added* | [[6]](#ref6) |\n",
"| `C-2D-INT-Z` | Interface ZSL | [Graphene/Ni Interface Film XY Position Optimization](optimization_interface_film_xy_position_graphene_nickel.ipynb) | *To be added* | [[7]](#ref7) |\n",
"| `C-2D-INT-T` | Interface Twisted | *To be added* | — | — |\n",
"| M-CODE | Category | Structure | Simulation | Reference |\n",
"|--------------|--------------------------------|----------------------------------------------------------------------------------------------------------------------|---------------|---|\n",
"| `P-3D-CRY` | Ideal Crystal | *To be added* | — | — |\n",
"| `P-2D-MNL` | Monolayer | *To be added* | — | — |\n",
"| `P-2D-SLB-S` | Slab | [Simple Slab: SrTiO₃](slab_strontium_titanate.ipynb) | *To be added* | [[1]](#ref1) |\n",
"| `P-2D-SLB-R` | Slab | *Reconstructed slab. To be added* | — | — |\n",
"| `P-1D-NTP` | Nanotape | *To be added* | — | — |\n",
"| `P-1D-NWR` | Nanowire | *To be added* | — | — |\n",
"| `P-0D-NPR` | Nanoparticle | [Gold Nanocluster](nanocluster_gold.ipynb) | *To be added* | [[2]](#ref2) |\n",
"| `P-0D-NRB` | Nanoribbon | *To be added* | — | — |\n",
"| `C-2D-HST` | Heterostack | [Si/SiO₂/HfO₂/TiN Heterostructure](heterostructure_silicon_silicon_dioxide_hafnium_dioxide_titanium_nitride.ipynb) | *To be added* | [[3]](#ref3) |\n",
"| `C-2D-INT-S` | Interface Simple | *To be added* | — | — |\n",
"| `C-2D-INT-Z` | Interface ZSL | [BN/Graphene 2D–2D Interface](interface_2d_2d_boron_nitride_graphene.ipynb) | *To be added* | [[4]](#ref4) |\n",
"| `C-2D-INT-Z` | Interface ZSL | [Graphene/SiO₂ 2D–3D Interface](interface_2d_3d_graphene_silicon_dioxide.ipynb) | *To be added* | [[5]](#ref5) |\n",
"| `C-2D-INT-Z` | Interface ZSL | [Cu/Cristobalite 3D–3D Interface](interface_3d_3d_copper_cristobalite.ipynb) | *To be added* | [[6]](#ref6) |\n",
"| `C-2D-INT-Z` | Interface ZSL | [Graphene/Ni Interface Film XY Position Optimization](optimization_interface_film_xy_position_graphene_nickel.ipynb) | *To be added* | [[7]](#ref7) |\n",
"| `C-2D-INT-T` | Interface Twisted | *To be added* | — | — |\n",
"| `C-2D-INT-C` | Interface Commensurate Lattice | [Twisted Commensurate MoS₂ Bilayer](interface_bilayer_twisted_commensurate_lattices_molybdenum_disulfide.ipynb) | *To be added* | [[8]](#ref8) |\n",
"| `C-2D-MLT` | Multi-Layer | *To be added* | — | — |\n",
"| `C-2D-MLT` | Multi-Layer | *To be added* | — | — |\n",
"| `C-0D-INT-R` | Nanoribbons Interface Rotation | [Twisted BN Nanoribbon Bilayer](interface_bilayer_twisted_nanoribbons_boron_nitride.ipynb) | *To be added* | [[9]](#ref9) |\n",
"| `D-3D-AMO` | Amorphous | *To be added* | — | — |\n",
"| `D-2D-ADA` | Adatom | [Pt Adatom/Island on MoS₂](defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb) | *To be added* | [[10]](#ref10) |\n",
"| `D-2D-ADA` | Adatom | [Adatom on Graphene](defect_surface_adatom_graphene.ipynb) | *To be added* | [[11]](#ref11) |\n",
"| `D-2D-GBP` | Grain Boundary Planar | [Grain Boundary in 2D BN](defect_planar_grain_boundary_2d_boron_nitride.ipynb) | *To be added* | [[12]](#ref12) |\n",
"| `D-2D-GBP` | Grain Boundary Planar | [Grain Boundary in 3D FCC Cu](defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb) | *To be added* | [[13]](#ref13) |\n",
"| `D-2D-ISL` | Island | [TiN Island on Surface](defect_surface_island_titanium_nitride.ipynb) | *To be added* | [[14]](#ref14) |\n",
"| `D-2D-TER` | Terrace | [Step/Terrace on Pt Surface](defect_surface_step_platinum.ipynb) | *To be added* | [[15]](#ref15) |\n",
"| `D-1D-GBL` | Grain Boundary Linear | *To be added* | — | — |\n",
"| `D-0D-DFP` | Defect Pair | [Defect Pair in GaN](defect_point_pair_gallium_nitride.ipynb) | *To be added* | [[16]](#ref16) |\n",
"| `D-0D-INT` | Interstitial | [Interstitial in SnO₂](defect_point_interstitial_tin_oxide.ipynb) | *To be added* | [[17]](#ref17) |\n",
"| `D-0D-SUB` | Substitution | [N-doped Graphene](defect_point_substitution_graphene.ipynb) | [N-doped Graphene Band Structure](defect_point_substitution_graphene_simulation.ipynb) | [[18]](#ref18) |\n",
"| `D-0D-VAC` | Vacancy | [Vacancy in BN](defect_point_vacancy_boron_nitride.ipynb) | *To be added* | [[19]](#ref19) |\n",
"| `X-3D-PER` | Perturbation | *To be added* | — | — |\n",
"| `X-3D-ANL` | Annealed Crystal | *To be added* | — | — |\n",
"| `X-2D-PER` | Perturbation | [Ripple Perturbation in Graphene](perturbation_ripple_graphene.ipynb) | *To be added* | [[20]](#ref20) |\n",
"| `X-2D-PAS` | Passivated Surface | [Silicon Surface Passivation](passivation_surface_silicon.ipynb) | *To be added* | [[21]](#ref21) |\n",
"| `X-1D-PAS` | Passivated Edge | [Si Nanowire Edge Passivation](passivation_edge_nanowire_silicon.ipynb) | *To be added* | [[22]](#ref22) |\n",
"| `X-0D-PAS` | Passivated Edge | *To be added* | — | — |\n",
"| `X-0D-CUT` | Slab Cutout | [Custom Cutout in Etched Silicon](custom_cutout_etched_silicon.ipynb) | *To be added* | — |\n",
"| `D-3D-AMO` | Amorphous | *To be added* | — | — |\n",
"| `D-2D-ADA` | Adatom | [Pt Adatom/Island on MoS₂](defect_point_adatom_island_molybdenum_disulfide_platinum.ipynb) | *To be added* | [[10]](#ref10) |\n",
"| `D-2D-ADA` | Adatom | [Adatom on Graphene](defect_surface_adatom_graphene.ipynb) | *To be added* | [[11]](#ref11) |\n",
"| `D-2D-GBP` | Grain Boundary Planar | [Grain Boundary in 3D FCC Cu](defect_planar_grain_boundary_3d_fcc_metals_copper.ipynb) | *To be added* | [[13]](#ref13) |\n",
"| `D-2D-ISL` | Island | [TiN Island on Surface](defect_surface_island_titanium_nitride.ipynb) | *To be added* | [[14]](#ref14) |\n",
"| `D-2D-TER` | Terrace | [Step/Terrace on Pt Surface](defect_surface_step_platinum.ipynb) | *To be added* | [[15]](#ref15) |\n",
"| `D-1D-GBL` | Grain Boundary Linear | [Grain Boundary in 2D BN](defect_planar_grain_boundary_2d_boron_nitride.ipynb) | *To be added* | [[12]](#ref12) |\n",
"| `D-0D-DFP` | Defect Pair | [Defect Pair in GaN](defect_point_pair_gallium_nitride.ipynb) | *To be added* | [[16]](#ref16) |\n",
"| `D-0D-INT` | Interstitial | [Interstitial in SnO₂](defect_point_interstitial_tin_oxide.ipynb) | *To be added* | [[17]](#ref17) |\n",
"| `D-0D-SUB` | Substitution | [N-doped Graphene](defect_point_substitution_graphene.ipynb) | [N-doped Graphene Band Structure](defect_point_substitution_graphene_simulation.ipynb) | [[18]](#ref18) |\n",
"| `D-0D-VAC` | Vacancy | [Vacancy in BN](defect_point_vacancy_boron_nitride.ipynb) | *To be added* | [[19]](#ref19) |\n",
"| `X-3D-PER` | Perturbation | *To be added* | — | — |\n",
"| `X-3D-ANL` | Annealed Crystal | *To be added* | — | — |\n",
"| `X-2D-PER` | Perturbation | [Ripple Perturbation in Graphene](perturbation_ripple_graphene.ipynb) | *To be added* | [[20]](#ref20) |\n",
"| `X-2D-PAS` | Passivated Surface | [Silicon Surface Passivation](passivation_surface_silicon.ipynb) | *To be added* | [[21]](#ref21) |\n",
"| `X-1D-PAS` | Passivated Edge | [Si Nanowire Edge Passivation](passivation_edge_nanowire_silicon.ipynb) | *To be added* | [[22]](#ref22) |\n",
"| `X-0D-PAS` | Passivated Edge | *To be added* | — | — |\n",
"| `X-0D-CUT` | Slab Cutout | [Custom Cutout in Etched Silicon](custom_cutout_etched_silicon.ipynb) | *To be added* | — |\n",
"\n",
"## References\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"# Grain boundary parameters\n",
"TARGET_TWIST_ANGLE = 9.0 # in degrees\n",
"BOUNDARY_GAP = 0.0 # Gap between two orientations in X direction, in Angstroms\n",
"OVERLAP_TOLERANCE = 0.8 # Tolerance to remove overlapping atoms, in Angstroms\n",
"OVERLAP_TOLERANCE = 1.2 # Tolerance to remove overlapping atoms, in Angstroms\n",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for documentation, tests, or related discussions about this tolerance value

# Search for references to OVERLAP_TOLERANCE in other files
rg -n -C3 'OVERLAP_TOLERANCE|overlap.*tolerance|resolve_colliding_coordinates' --type ipynb --type py

# Search for any validation or test files related to grain boundaries
fd -e py -e ipynb -e md . -x rg -l 'grain.*boundary.*test|validate.*grain|boron.*nitride' {}

# Check git log for commits related to this parameter
git log -p --all -S "OVERLAP_TOLERANCE" -- "**/*grain*boundary*.ipynb"

Repository: Exabyte-io/api-examples

Length of output: 553


🏁 Script executed:

#!/bin/bash
# Read the notebook file to examine line 47 and surrounding context
# Jupyter notebooks are JSON format, so we can use jq to extract cell contents

# First, let's check the file size and structure
wc -l other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb

# Extract the notebook cells to find the OVERLAP_TOLERANCE definition
python <<'EOF'
import json

notebook_path = "other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb"

with open(notebook_path, 'r') as f:
    notebook = json.load(f)

# Find cells containing OVERLAP_TOLERANCE
for idx, cell in enumerate(notebook['cells']):
    if cell['cell_type'] == 'code':
        source = ''.join(cell['source'])
        if 'OVERLAP_TOLERANCE' in source:
            print(f"\n=== Cell {idx} (code) ===")
            print(source)
            print(f"Execution count: {cell.get('execution_count', 'N/A')}")

EOF

Repository: Exabyte-io/api-examples

Length of output: 1434


🏁 Script executed:

#!/bin/bash
# Check other related boron nitride notebooks for OVERLAP_TOLERANCE or similar tolerance parameters

notebooks=$(fd -e ipynb . -x rg -l 'boron.*nitride' {})

for nb in $notebooks; do
    echo "=== Checking $nb ==="
    python <<EOF
import json

try:
    with open("$nb", 'r') as f:
        notebook = json.load(f)
    
    for idx, cell in enumerate(notebook['cells']):
        if cell['cell_type'] == 'code':
            source = ''.join(cell['source'])
            if 'OVERLAP_TOLERANCE' in source or 'overlap' in source.lower() or 'tolerance' in source.lower():
                print(f"Cell {idx}: Found tolerance-related parameter")
                # Print just the parameter line
                for line in source.split('\n'):
                    if 'tolerance' in line.lower() or 'overlap' in line.lower():
                        print(f"  {line.strip()}")
except Exception as e:
    print(f"Error: {e}")
EOF
done

Repository: Exabyte-io/api-examples

Length of output: 1519


🏁 Script executed:

#!/bin/bash
# Check git history for this specific file and parameter
cd other/materials_designer/specific_examples

# Get the git history for this file
git log --oneline -- defect_planar_grain_boundary_2d_boron_nitride.ipynb | head -20

# Get the last few commits with more details
echo -e "\n=== Recent commits affecting this file ==="
git log --format="%h %ai %s" -- defect_planar_grain_boundary_2d_boron_nitride.ipynb | head -10

# Check if there's a specific commit that changed OVERLAP_TOLERANCE
echo -e "\n=== Commits affecting OVERLAP_TOLERANCE ==="
git log -p --all -- defect_planar_grain_boundary_2d_boron_nitride.ipynb | grep -A5 -B5 'OVERLAP_TOLERANCE' | head -50

cd ../../../

Repository: Exabyte-io/api-examples

Length of output: 291


🏁 Script executed:

#!/bin/bash
# Search for documentation about the reference manuscript or validation in the notebook

python <<'EOF'
import json

notebook_path = "other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb"

with open(notebook_path, 'r') as f:
    notebook = json.load(f)

# Check all cells for references to manuscript, validation, or expected values
print("=== All cells with potential references to validation or manuscript ===\n")
for idx, cell in enumerate(notebook['cells']):
    source = ''.join(cell['source'])
    
    # Look for references to manuscript, ACS, figures, validation, or expected values
    keywords = ['manuscript', 'ACS', 'figure', 'figure 2', 'validation', 'validate', 'expected', 'atom count', 'reference', 'paper']
    
    if any(keyword in source.lower() for keyword in keywords):
        print(f"=== Cell {idx} ({cell['cell_type']}) ===")
        print(source[:500])
        print("...\n")

# Also check for any comments or markdown that might reference the original work
print("\n=== Markdown cells (for context) ===\n")
for idx, cell in enumerate(notebook['cells']):
    if cell['cell_type'] == 'markdown':
        source = ''.join(cell['source'])
        if len(source) < 800:  # Only show shorter cells to find titles/descriptions
            print(f"=== Cell {idx} (markdown) ===")
            print(source)
            print()

EOF

Repository: Exabyte-io/api-examples

Length of output: 1525


🏁 Script executed:

#!/bin/bash
# Check for README or documentation in the materials_designer directory

find other/materials_designer -name "README*" -o -name "*.md" | head -20

echo -e "\n=== Checking README content ==="
find other/materials_designer -name "README*" | xargs cat 2>/dev/null | head -100

Repository: Exabyte-io/api-examples

Length of output: 231


🏁 Script executed:

#!/bin/bash
# Search for any references to atom overlap, grain boundary, or tolerance in documentation

rg -A5 -B5 'grain.*boundary|atom.*overlap|OVERLAP|resolve_colliding' --type md . | head -50

Repository: Exabyte-io/api-examples

Length of output: 49


Document the rationale for the OVERLAP_TOLERANCE change and add validation against the reference structure.

The OVERLAP_TOLERANCE parameter was changed to 1.2 Angstroms with the commit message "adjust the tolerance for better result," but this provides no specific justification. Since this parameter controls which atoms are removed at the grain boundary interface and directly affects the resulting structure, the change requires documentation.

The notebook correctly cites the reference manuscript (Qiucheng Li et al., ACS Nano 2015, 9(6), 6308-6315), but there is no visible validation showing that the grain boundary structure matches the expected result (e.g., Figure 2.c from the paper).

Please:

  1. Add a code comment explaining why 1.2 Angstroms produces better results—what metric improved and why this value was chosen
  2. Add validation code that compares the generated structure against the reference manuscript, such as checking atom count or visualizing the boundary
  3. Consider documenting expected structural properties (e.g., number of atoms in the grain boundary region)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@other/materials_designer/specific_examples/defect_planar_grain_boundary_2d_boron_nitride.ipynb`
at line 47, Explain and justify the change to OVERLAP_TOLERANCE by adding a
concise comment next to the variable (OVERLAP_TOLERANCE = 1.2) that states which
metric improved (e.g., reduced spurious atom removals at the GB, better match to
reference atom counts/coordination) and why 1.2 Å was chosen (empirically
minimized difference vs. reference structure). Then add validation after the GB
construction step (the routine that uses OVERLAP_TOLERANCE) that: (a) loads or
defines the reference structure from the manuscript, (b) compares simple metrics
such as total atom count, atom count within the grain-boundary region (atoms
within X Å of the interface), and coordination statistics between the generated
structure and reference, and (c) raises an assertion or prints a clear pass/fail
summary; also add a quick visualization call (e.g., plotting or snapshot) to
show the boundary region for human inspection. Finally, document expected
structural properties (e.g., expected atoms in GB region or expected
coordination defects) in a short comment or markdown cell to make the validation
criteria explicit.

"\n",
"# Search algorithm parameters\n",
"MAX_REPETITION = None # Maximum supercell matrix element value\n",
Expand Down
Loading