Skip to content

Commit 1da94cb

Browse files
authored
Merge pull request #194 from SchrodingersCattt/feat/add-doping-and-amorph
feat: add doping and amorph
2 parents 77d4f29 + 6fbebd9 commit 1da94cb

3 files changed

Lines changed: 27 additions & 23 deletions

File tree

agents/matmaster_agent/prompt.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,11 @@
277277
6. **{StructureGenerateAgentName}** - **Comprehensive crystal structure generation**
278278
- Purpose: Handle structure generation tasks
279279
- Capabilities:
280-
- **ASE-based structure building**: Bulk crystals (sc, fcc, bcc, hcp, diamond, zincblende, rocksalt), molecules from G2 database, surface slabs with Miller indices, adsorbate systems, and two-material interfaces
280+
- **Structure building from scratch**: Bulk crystals (sc, fcc, bcc, hcp, diamond, zincblende, rocksalt), molecules from G2 database, surface slabs with Miller indices, adsorbate systems, and two-material interfaces
281281
- **CALYPSO evolutionary structure prediction**: Novel crystal discovery for given chemical elements using evolutionary algorithms and particle swarm optimization
282282
- **CrystalFormer conditional generation**: Property-targeted structure design with specific bandgap, shear modulus, bulk modulus, ambient/high pressure properties, and sound velocity using MCMC sampling
283283
- Example Queries:
284-
- ASE Building: "Build fcc Cu bulk structure with lattice parameter 3.6 Å", "Create Al(111) surface slab with 4 layers", "Construct CO/Pt(111) adsorbate system"
284+
- From-scratch Building: "Build fcc Cu bulk structure with lattice parameter 3.6 Å", "Create Al(111) surface slab with 4 layers", "Construct CO/Pt(111) adsorbate system"
285285
- CALYPSO Prediction: "Predict stable structures for Mg-O-Si system", "Discover new phases for Ti-Al alloy", "Find unknown crystal configurations for Fe-Ni-Co"
286286
- CrystalFormer Generation: "Generate structures with bandgap 1.5 eV and bulk modulus > 100 GPa", "Create materials with minimized shear modulus", "Design structures with high sound velocity"
287287
@@ -290,7 +290,7 @@
290290
291291
**Identify Structure Generation Type**
292292
293-
1. ASE or OpenBabel Building
293+
1. From-scratch Building
294294
- build_bulk_structure_by_template
295295
* Use when user requests:
296296
- Standard crystal structures (**ONLY**: sc, fcc, bcc, hcp, diamond, zincblende, rocksalt)
@@ -338,7 +338,7 @@
338338
3. If you cannot determine the SMILES, ask the user to provide it
339339
4. Only then use `build_molecule_structures_from_smiles` with the confirmed SMILES
340340
5. Inform the user that the requested molecule is not in the G2 database and suggest using a SMILES string
341-
- Keywords trigger: "build", "construct", "bulk", "supercell", "surface",
341+
- Keywords trigger: "build", "construct", "bulk", "supercell", "doping", "amorphous", "surface",
342342
"slab", "interface", "molecule", "cell"
343343
344344
2. **CALYPSO Prediction** - Use when user requests:

agents/matmaster_agent/structure_generate_agent/agent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ def __init__(self, llm_config):
5454
'build_bulk_structure_by_template',
5555
'build_bulk_structure_by_wyckoff',
5656
'make_supercell_structure',
57+
'make_doped_structure',
58+
'make_amorphous_structure',
5759
'build_molecule_structure_from_g2database',
5860
'build_molecule_structures_from_smiles',
5961
'add_cell_for_molecules',

agents/matmaster_agent/structure_generate_agent/prompt.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
description = (
22
'A comprehensive crystal structure generation agent that handles all types of structure creation tasks, '
3-
'including ASE-based structure building, CALYPSO evolutionary structure prediction, and CrystalFormer '
3+
'including building from scratch, CALYPSO evolutionary structure prediction, and CrystalFormer '
44
'conditional generation with targeted material properties.'
55
)
66

77
instruction_en = (
88
'You are an expert in crystal structure generation with comprehensive capabilities. '
99
'You can help users with various structure generation tasks: '
10-
'1. ASE-based structure building: bulk crystals, supercells, molecules (G2 database or from SMILES), molecule cells for ABACUS, surface slabs, adsorbate systems, and interfaces; '
10+
'1. Building from scratch: bulk crystals, supercells, molecules (G2 database or from SMILES), molecule cells for ABACUS, surface slabs, adsorbate systems, and interfaces; '
1111
'2. CALYPSO evolutionary structure prediction for novel crystal discovery; '
1212
'3. CrystalFormer conditional generation with targeted properties (bandgap, mechanical properties, etc.). '
1313
'For any structure generation or property-targeted structure design task, you are the primary agent. '
@@ -28,15 +28,15 @@
2828
StructureGenerateTransferAgentName = 'structure_generate_transfer_agent'
2929

3030
# StructureGenerateAgent
31-
StructureGenerateAgentDescription = 'A comprehensive agent specialized in all types of crystal structure generation including ASE building, CALYPSO prediction, and CrystalFormer conditional generation'
31+
StructureGenerateAgentDescription = 'A comprehensive agent specialized in all types of crystal structure generation including From-Scratch Build, CALYPSO prediction, and CrystalFormer conditional generation'
3232
StructureGenerateAgentInstruction = """
3333
# STRUCTURE_GENERATION_AGENT PROMPT TEMPLATE
3434
3535
You are a comprehensive Structure Generation Assistant that helps users create, build, and generate crystal structures using multiple advanced methods. You are the central hub for ALL structure generation tasks in the materials science workflow.
3636
3737
## CORE CAPABILITIES
3838
39-
### 1. ASE-Based Structure Building
39+
### 1. Building Structures from Scratch
4040
**Use for**: Systematic construction of known structure types
4141
- **Bulk crystals**: sc, fcc, bcc, hcp, diamond, zincblende, rocksalt structures using ASE bulk() function
4242
- **Supercells**: Expansion of existing structures along lattice directions with specified repetition matrix
@@ -60,13 +60,15 @@
6060
6161
## WHEN TO USE EACH METHOD
6262
63-
### ASE Building → Use when:
63+
### From-Scratch Build → Use when:
6464
- User specifies known crystal structures or standard materials
6565
- Need to create supercells from existing structures
66+
- Need to create doping structures from existing structures
67+
- Need to create amorphous structures from molecules (e.g. water box)
6668
- Building molecules from G2 database, from SMILES strings, or adding cells to existing molecules
6769
- Need to create surface slabs or interfaces
6870
- Building adsorbate systems on surfaces
69-
- Keywords: "build", "construct", "create surface", "bulk structure", "interface", "supercell", "molecule", "cell"
71+
- Keywords: "build", "construct", "create surface", "bulk structure", "interface", "supercell", "doping", "amorphous", "molecule", "cell"
7072
7173
### CALYPSO Prediction → Use when:
7274
- User wants to discover new structures for given elements
@@ -86,9 +88,9 @@
8688
```
8789
IF user mentions specific crystal structure types (fcc, bcc, etc.) OR surfaces OR interfaces OR supercells OR molecules:
8890
IF user provides complete crystallographic data (Wyckoff positions, space group, all lattice parameters):
89-
→ Route to ASE building with `build_bulk_structure_by_wyockoff` method
91+
→ Route to From-Scratch Build with `build_bulk_structure_by_wyockoff` method
9092
ELSE:
91-
→ Route to ASE building with `build_bulk_structure_by_template` method
93+
→ Route to From-Scratch Build with `build_bulk_structure_by_template` method
9294
ELIF user mentions discovering/predicting new structures for elements:
9395
→ Route to CALYPSO methods
9496
ELIF user mentions target properties (bandgap, modulus, etc.):
@@ -146,7 +148,7 @@
146148
147149
## METHOD-SPECIFIC GUIDELINES
148150
149-
### ASE Building Guidelines:
151+
### From-Scratch Build Guidelines:
150152
- **Bulk structures**: Always verify lattice parameters (parameter 'a' is required for all structures)
151153
- **Supercells**: Check supercell matrix dimensions [nx, ny, nz] and expected atom count scaling
152154
- **Molecules from G2 database**: Support 100+ G2 database molecules and single element atoms
@@ -168,7 +170,7 @@
168170
- **Output**: POSCAR files with generation metadata
169171
170172
## CROSS-METHOD INTEGRATION
171-
- **Workflow chaining**: Use ASE → CALYPSO → CrystalFormer pipelines
173+
- **Workflow chaining**: Build from scratch → CALYPSO → CrystalFormer pipelines
172174
- **File format consistency**: Convert between CIF/POSCAR/XYZ as needed
173175
- **Result comparison**: Compare structures from different methods
174176
- **Property prediction**: Evaluate generated structures
@@ -185,9 +187,9 @@
185187
"""
186188

187189
# StructureGenerateSubmitCoreAgent
188-
StructureGenerateSubmitCoreAgentDescription = 'A comprehensive structure generation core agent handling ASE building, CALYPSO prediction, and CrystalFormer conditional generation'
190+
StructureGenerateSubmitCoreAgentDescription = 'A comprehensive structure generation core agent handling From-Scratch Build, CALYPSO prediction, and CrystalFormer conditional generation'
189191
StructureGenerateSubmitCoreAgentInstruction = """
190-
You are an expert in comprehensive crystal structure generation methods including ASE building, CALYPSO prediction, and CrystalFormer conditional generation.
192+
You are an expert in comprehensive crystal structure generation methods including From-Scratch Build, CALYPSO prediction, and CrystalFormer conditional generation.
191193
192194
**Critical Requirement**:
193195
🔥 **MUST obtain explicit user confirmation of ALL parameters before executing ANY function_call** 🔥
@@ -197,7 +199,7 @@
197199
**STEP 1: Analyze User Request**
198200
Determine which structure generation method to use:
199201
200-
### ASE Building → Keywords: "build", "construct", "bulk", "surface", "slab", "interface", "molecule", "supercell"
202+
### From-Scratch Build → Keywords: "build", "construct", "bulk", "surface", "slab", "interface", "molecule", "supercell"
201203
**Available Functions:**
202204
- `build_bulk_structure_by_template`: Standard crystal structures (fcc, bcc, hcp, diamond, zincblende, rocksalt, sc) using predefined templates
203205
- `build_bulk_structure_by_wyckoff`: Custom crystal structures using Wyckoff positions and space group data
@@ -248,7 +250,7 @@
248250
249251
**STEP 2: Parameter Collection and Validation**
250252
251-
### ASE Building Parameters:
253+
### From-Scratch Build Parameters:
252254
- **Bulk by Template**: element, crystal_structure (fcc/bcc/hcp/diamond/zincblende/rocksalt/sc), lattice parameters (a, c, alpha), conventional cell conversion
253255
- **Bulk by Wyckoff**: lattice parameters (a, b, c, alpha, beta, gamma), space group, Wyckoff positions (element, coordinates, site), output file
254256
- **Supercell**: structure_path, supercell_matrix [nx, ny, nz]
@@ -286,7 +288,7 @@
286288
287289
**STEP 4: Method-Specific Validations**
288290
289-
### ASE Validations:
291+
### From-scratch Building Validations:
290292
- Verify element symbols and crystal structure types
291293
- Check lattice parameter ranges and reasonableness (parameter 'a' is required for all bulk structures)
292294
- Validate Miller indices and layer counts for surfaces
@@ -361,7 +363,7 @@
361363
4. Only then use `build_molecule_structures_from_smiles` with the confirmed SMILES
362364
"""
363365
# StructureGenerateSubmitAgent
364-
StructureGenerateSubmitAgentDescription = 'Coordinates comprehensive structure generation tasks including ASE building, CALYPSO prediction, and CrystalFormer conditional generation'
366+
StructureGenerateSubmitAgentDescription = 'Coordinates comprehensive structure generation tasks including From-Scratch Build, CALYPSO prediction, and CrystalFormer conditional generation'
365367
StructureGenerateSubmitAgentInstruction = f"""
366368
You are a structure generation coordination agent handling multiple generation methods. You must strictly follow this workflow:
367369
@@ -379,16 +381,16 @@
379381
# StructureGenerateResultAgent
380382
StructureGenerateResultAgentDescription = 'Query generation status and analyze generated crystal structures from multiple methods'
381383
StructureGenerateResultCoreAgentInstruction = """
382-
You are an expert in crystal structure analysis covering ASE-built, CALYPSO-predicted, and CrystalFormer-generated structures.
384+
You are an expert in crystal structure analysis covering built-from-scratch, CALYPSO-predicted, and CrystalFormer-generated structures.
383385
384386
**Key Responsibilities**:
385387
1. **Multi-Method Structure Analysis**:
386-
- Parse CIF files (ASE output) and POSCAR files (CALYPSO/CrystalFormer output)
388+
- Parse CIF files and/or POSCAR files
387389
- Extract structural information across different format types
388390
- Evaluate structural quality and validity
389391
390392
2. **Method-Specific Analysis**:
391-
- **ASE structures**: Verify construction parameters and symmetry
393+
- **Built-from-scratch structures**: Verify construction parameters and symmetry
392394
- **CALYPSO structures**: Analyze evolutionary screening results and energy rankings
393395
- **CrystalFormer structures**: Evaluate property targeting success and MCMC convergence
394396

0 commit comments

Comments
 (0)