Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2c9fb7b
chore: update gitignore
VsevolodX Jul 18, 2025
6ce09ef
update: slab nb
VsevolodX Jul 18, 2025
22ddd4a
update: import materials as MAterial or Material with build metadata
VsevolodX Jul 18, 2025
7aedb7f
update: area vs strain
VsevolodX Jul 19, 2025
dd67089
update: adataom nb
VsevolodX Jul 19, 2025
ea4b9cc
update: nanoparticles nbs
VsevolodX Jul 20, 2025
5d32a4c
update: gb nbs
VsevolodX Jul 20, 2025
0821a33
update: island nbs
VsevolodX Jul 20, 2025
0fa2f7a
update: nanoribbon nanowire nbs
VsevolodX Jul 20, 2025
b5140f3
update: terrace nb
VsevolodX Jul 20, 2025
8927cd4
update: pair defect nb
VsevolodX Jul 20, 2025
c163253
update: gb nb
VsevolodX Jul 22, 2025
9776990
update: simple interface nb
VsevolodX Jul 22, 2025
bba6509
chore: improt mde
VsevolodX Jul 22, 2025
36172f0
update: nanoribbon nb
VsevolodX Jul 22, 2025
fc593e6
update: zsl nb
VsevolodX Jul 22, 2025
b9b7dc7
update: cleanups
VsevolodX Jul 22, 2025
720f196
update: cleanups 2
VsevolodX Jul 22, 2025
44d796c
update: heterostructure nb
VsevolodX Jul 22, 2025
93d422c
update: nanoribbon interface nb
VsevolodX Jul 22, 2025
28c5075
update: comm lat interface nb
VsevolodX Jul 22, 2025
933a4bf
update: passivate slab surface nb
VsevolodX Jul 22, 2025
eda18c8
update: passivate edge nb
VsevolodX Jul 22, 2025
2a9c86a
update: point defects nb
VsevolodX Jul 22, 2025
7243990
update: made
VsevolodX Jul 22, 2025
9c792e8
update: adatom defects multiple nb
VsevolodX Jul 22, 2025
f41ccb4
update: cluster nb
VsevolodX Jul 22, 2025
7074206
update: monolayer nb
VsevolodX Jul 22, 2025
90a28e1
update: island cylinder nb
VsevolodX Jul 22, 2025
99b3235
update: island custom nb
VsevolodX Jul 22, 2025
721dd68
chore: improt made
VsevolodX Jul 22, 2025
5081375
chore: adjsut to see
VsevolodX Jul 22, 2025
ab821b9
update: use latest made + adatom nb
VsevolodX Jul 28, 2025
df96679
update: interfaces nb
VsevolodX Jul 28, 2025
eff8248
chore: made from gh commit
VsevolodX Jul 28, 2025
c09a222
update: small adjustments
VsevolodX Jul 28, 2025
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ celerybeat-schedule

# Environments
.env
.venv
.venv*
env/
venv/
ENV/
Expand Down
101 changes: 37 additions & 64 deletions other/materials_designer/create_adatom_defect.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,20 @@
{
"cell_type": "code",
"source": [
"DEFECT_CONFIGS = [\n",
" {\n",
" \"defect_type\": \"adatom\",\n",
" \"placement_method\": \"equidistant\",\n",
" \"chemical_element\": \"Si\",\n",
" \"position_on_surface\": [0.5, 0.5],\n",
" \"distance_z\": 2.0,\n",
" \"use_cartesian_coordinates\": False\n",
" },\n",
"]\n",
"from mat3ra.made.tools.build.defect.enums import AdatomPlacementMethodEnum\n",
"from mat3ra.made.tools.build.slab.termination_utils import select_slab_termination\n",
"\n",
"POSITION_ON_SURFACE = [0.5, 0.5] # Position on the surface in crystal coordinates\n",
"DISTANCE_Z = 1.0 # Distance from the surface in Angstroms\n",
"PLACEMENT_METHOD = AdatomPlacementMethodEnum.EXACT_COORDINATE # Method to place the adatom, e.g., \"NEW_CRYSTAL_SITE\", \"EQUIDISTANT\", \"EXACT_COORDINATE\"\n",
"ELEMENT = \"Si\" # Chemical element of the adatom\n",
"\n",
"# Slab parameters\n",
"MILLER_INDICES = (1, 1, 1) # Miller indices of the surface\n",
"SLAB_THICKNESS = 3 # Thickness of the slab in unit cells\n",
"VACUUM = 6 # Vacuum thickness in Angstrom\n",
"SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 1]] # Supercell matrix for the slab"
"VACUUM = 5.0 # Vacuum thickness in Angstrom\n",
"SUPERCELL_MATRIX = [[2, 0, 0], [0, 2, 0], [0, 0, 1]] # Supercell matrix for the slab\n",
"TERMINATION_FORMULA = None # Stoichiometric formula of the slab termination to be used."
],
"metadata": {
"collapsed": false
Expand Down Expand Up @@ -142,24 +141,24 @@
"cell_type": "code",
"source": [
"from mat3ra.made.tools.analyze.lattice_planes import CrystalLatticePlanesMaterialAnalyzer\n",
"from mat3ra.made.tools.build.slab.helpers import create_slab\n",
"from mat3ra.made.tools.build.slab.helpers import create_slab, get_slab_terminations\n",
"from utils.visualize import visualize_materials as visualize\n",
"\n",
"material = materials[0]\n",
"# Create analyzer to get terminations\n",
"analyzer = CrystalLatticePlanesMaterialAnalyzer(material=material, miller_indices=MILLER_INDICES)\n",
"slab_terminations = analyzer.terminations\n",
"# Get termination from analyzer\n",
"terminations = analyzer.terminations\n",
"termination = terminations[0] # Use first termination\n",
"terminations = get_slab_terminations(material, MILLER_INDICES)\n",
"termination = select_slab_termination(terminations, TERMINATION_FORMULA)\n",
"\n",
"slab = create_slab(\n",
" crystal=material,\n",
" termination=termination,\n",
" miller_indices=MILLER_INDICES,\n",
" number_of_layers=1,\n",
" vacuum=0,\n",
" xy_supercell_matrix=[[1, 0], [0, 1]],\n",
" number_of_layers=SLAB_THICKNESS,\n",
" vacuum=VACUUM,\n",
" xy_supercell_matrix=SUPERCELL_MATRIX,\n",
" use_orthogonal_c=True,\n",
" use_conventional_cell=True\n",
")\n",
Expand All @@ -172,63 +171,35 @@
{
"metadata": {},
"cell_type": "markdown",
"source": [
"## 2. Create the Defect\n",
"### 2.1. Set adatom parameters"
],
"source": "## 2. Create the Defect",
"id": "b386c06587b2f843"
},
{
"metadata": {},
"cell_type": "code",
"source": [
"from mat3ra.made.tools.build.defect import AdatomSlabPointDefectConfiguration\n",
"\n",
"defect_configurations = [\n",
" AdatomSlabPointDefectConfiguration(\n",
" crystal=slab,\n",
" defect_type=defect[\"defect_type\"],\n",
" placement_method=defect[\"placement_method\"],\n",
" chemical_element=defect[\"chemical_element\"],\n",
" position_on_surface=defect[\"position_on_surface\"],\n",
" distance_z=defect[\"distance_z\"],\n",
" use_cartesian_coordinates=defect[\"use_cartesian_coordinates\"]\n",
" ) for defect in DEFECT_CONFIGS\n",
"]"
],
"id": "3727ba76ad5101c0",
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"### 2.2. Create the adatom"
],
"metadata": {
"collapsed": false
},
"id": "489b51f0ee122c48"
},
{
"cell_type": "code",
"source": [
"from mat3ra.made.tools.build.defect import create_defects\n",
"from mat3ra.made.tools.build.defect.adatom.helpers import create_adatom_defect\n",
"\n",
"slab_with_adatom = create_defects(defect_configurations)"
"slab_with_adatom = create_adatom_defect(\n",
" slab=slab,\n",
" position_on_surface=POSITION_ON_SURFACE,\n",
" distance_z=DISTANCE_Z,\n",
" placement_method=PLACEMENT_METHOD,\n",
" element=ELEMENT\n",
")"
],
"metadata": {
"collapsed": false
"collapsed": false,
"jupyter": {
"is_executing": true
}
},
"id": "a990fa35742d7269",
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"## 3. Visualize the Slabs with Adatom"
],
"source": "## 3. Visualize the Slab with Adatom",
"metadata": {
"collapsed": false
},
Expand All @@ -240,10 +211,12 @@
"source": [
"from utils.visualize import visualize_materials as visualize\n",
"\n",
"visualize([{\"material\": slab, \"title\": \"Original material\"},\n",
" {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defects\"}],\n",
" viewer=\"wave\"\n",
" )"
"visualize([\n",
" {\"material\": slab, \"title\": \"Original material\"},\n",
" {\"material\": slab_with_adatom, \"title\": f\"Material with adatom defects\"}\n",
"],\n",
" viewer=\"wave\"\n",
")"
],
"id": "256b07fb2dd39ae2",
"outputs": [],
Expand Down
16 changes: 6 additions & 10 deletions other/materials_designer/create_cluster_custom_shape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
"source": [
"RADIUS = 0.3 # in crystal units\n",
"VACUUM = 10.0 # in Angstroms on each side\n",
"SUPERCELL_SIZE = 10 # in crystal units\n",
"Z_ORIENTATION = (0, 0, 1) # Miller indices of the slab orientation along the z-axis for the cluster\n",
"USE_CARTESIAN_COORDINATES = False\n",
"NAME = \"Icosahedron\" # Name of the cluster"
],
"metadata": {
Expand Down Expand Up @@ -115,7 +115,7 @@
"class CustomCoordinateCondition(CoordinateCondition):\n",
" \"\"\"Creates a regular polyhedron shape using SciPy's ConvexHull\"\"\"\n",
" radius: float = 1\n",
" center: List[float] = [0.5, 0.5, 0.5]\n",
" center_coordinate: List[float] = [0.5, 0.5, 0.5]\n",
"\n",
" @property\n",
" def _hull_planes(self):\n",
Expand All @@ -134,7 +134,7 @@
" for plane in self._hull_planes)\n",
"\n",
" \n",
"condition = CustomCoordinateCondition(radius=RADIUS).condition"
"condition = CustomCoordinateCondition(radius=RADIUS)"
],
"metadata": {
"collapsed": false
Expand Down Expand Up @@ -181,13 +181,9 @@
{
"cell_type": "code",
"source": [
"from mat3ra.made.tools.build.nanoparticle import SlabBasedNanoparticleConfiguration\n",
"\n",
"config = SlabBasedNanoparticleConfiguration(\n",
" material=materials[0],\n",
" condition_builder=condition,\n",
" supercell_size=SUPERCELL_SIZE,\n",
")"
"from mat3ra.made.tools.build.nanoparticle.helpers import create_nanoparticle_from_material\n",
"material = materials[0]\n",
"config = create_nanoparticle_from_material(material=material,condition=condition, orientation_z=Z_ORIENTATION, vacuum_padding=VACUUM, use_cartesian_coordinates=USE_CARTESIAN_COORDINATES)"
],
"metadata": {
"collapsed": false
Expand Down
54 changes: 14 additions & 40 deletions other/materials_designer/create_cluster_specific_shape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
},
{
"cell_type": "code",
"outputs": [],
"source": [
"import sys\n",
"\n",
Expand All @@ -65,6 +64,7 @@
"collapsed": false
},
"id": "d9e6be14343d00a1",
"outputs": [],
"execution_count": null
},
{
Expand All @@ -80,11 +80,10 @@
},
{
"cell_type": "code",
"outputs": [],
"source": [
"from mat3ra.made.tools.build.nanoparticle.enums import ASENanoparticleShapesEnum\n",
"from mat3ra.made.tools.build.nanoparticle.enums import NanoparticleShapesEnum\n",
"\n",
"shape = ASENanoparticleShapesEnum.OCTAHEDRON\n",
"shape = NanoparticleShapesEnum.OCTAHEDRON\n",
"parameters = {\n",
" \"length\": 5,\n",
" \"cutoff\": 2\n",
Expand All @@ -94,6 +93,7 @@
"collapsed": false
},
"id": "9d8b1890b34d850a",
"outputs": [],
"execution_count": null
},
{
Expand All @@ -108,7 +108,6 @@
},
{
"cell_type": "code",
"outputs": [],
"source": [
"from utils.jupyterlite import get_materials\n",
"\n",
Expand All @@ -118,13 +117,14 @@
"collapsed": false
},
"id": "be38fdda1984c654",
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"## 2. Create the Target Material\n",
"### 2.1. Set the cluster configuration\n"
"\n"
],
"metadata": {
"collapsed": false
Expand All @@ -133,46 +133,20 @@
},
{
"cell_type": "code",
"outputs": [],
"source": [
"from mat3ra.made.tools.build.nanoparticle import ASEBasedNanoparticleConfiguration, ASEBasedNanoparticleBuilder\n",
"from mat3ra.made.tools.build.nanoparticle.helpers import create_nanoparticle_by_shape\n",
"\n",
"config = ASEBasedNanoparticleConfiguration(\n",
" material=materials[0],\n",
"cluster = create_nanoparticle_by_shape(\n",
" crystal=materials[0],\n",
" shape=shape,\n",
" parameters=parameters\n",
")\n",
"\n",
"builder = ASEBasedNanoparticleBuilder()\n"
],
"metadata": {
"collapsed": false
},
"id": "8fbe260fa14db47a",
"execution_count": null
},
{
"cell_type": "markdown",
"source": [
"#### 2.2. Create the cluster"
],
"metadata": {
"collapsed": false
},
"id": "10799f3efede924d"
},
{
"cell_type": "code",
"outputs": [],
"source": [
"from mat3ra.made.tools.build.nanoparticle import create_nanoparticle\n",
"\n",
"cluster = create_nanoparticle(config, builder)"
")"
],
"metadata": {
"collapsed": false
},
"id": "a990fa35742d7269",
"outputs": [],
"execution_count": null
},
{
Expand All @@ -187,16 +161,16 @@
},
{
"cell_type": "code",
"outputs": [],
"source": [
"from utils.visualize import visualize_materials\n",
"\n",
"visualize_materials([{\"material\": cluster}, {\"material\": cluster, \"rotation\": \"-90x\"}])"
"visualize_materials([{\"material\": cluster}, {\"material\": cluster, \"rotation\": \"-90x\"}],viewer=\"wave\")"
],
"metadata": {
"collapsed": false
},
"id": "509b18661a069e42",
"outputs": [],
"execution_count": null
},
{
Expand All @@ -211,7 +185,6 @@
},
{
"cell_type": "code",
"outputs": [],
"source": [
"from utils.jupyterlite import set_materials\n",
"\n",
Expand All @@ -222,6 +195,7 @@
"collapsed": false
},
"id": "61daa5afcbc078a9",
"outputs": [],
"execution_count": null
}
],
Expand Down
Loading