Skip to content

Create a Solid Solution

1. Introduction

Create a solid solution, such as Hf1-xZrxO2, from a material: a fraction of the atoms of one element is replaced with another, in a supercell sized to reach the target concentration.

2. Open the notebook

In JupyterLite, the notebook is made/create_solid_solution.ipynb, entry 5.1.3 "Solid solution" of made/Introduction.ipynb.

3. Set the parameters

The notebook takes the first of the input materials.

Cell 1.1 holds the parameters:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
SOURCE_ELEMENT = "Ni"       # Element to partially replace
TARGET_ELEMENT = "Co"       # Replacement element
CONCENTRATION = 0.5        # Fraction of SOURCE_ELEMENT sites to replace (0–1)

# Site selection: "random" or "uniform" (Farthest Point Sampling for even spacing)
SITE_SELECTION_METHOD = "uniform"

# Random seed for reproducible site selection
SEED = 0

# Tolerance for matching target concentration (smaller = larger supercell)
TOLERANCE = 0.01

# Maximum supercell size to search when matching concentration
MAX_SUPERCELL_CELLS = 128

SOURCE_ELEMENT is the element partially replaced by TARGET_ELEMENT, and CONCENTRATION the fraction of its sites replaced, from 0 to 1.

SITE_SELECTION_METHOD is "random", or "uniform", which spaces the replaced sites evenly by farthest point sampling. The overview explains SEED.

The supercell is searched up to MAX_SUPERCELL_CELLS unit cells to match the concentration within TOLERANCE; a smaller tolerance gives a larger supercell.

4. Run and read the result

Run the notebook with Run > Run All. The notebook prints the composition, the number of atoms, the target and the reached concentration and the site selection method, shows the solid solution and passes it back with set_materials, as in Structure Notebooks.

5. Interactive JupyterLite notebook

The interactive JupyterLite notebook for creating a solid solution can be accessed below.