|
17 | 17 | "source": [
|
18 | 18 | "# Imports\n",
|
19 | 19 | "\n",
|
20 |
| - "from pymatgen.core import Structure\n", |
| 20 | + "from pymatgen.core import Structure, Lattice\n", |
21 | 21 | "from smact import Species\n",
|
22 | 22 | "from smact.oxidation_states import Oxidation_state_probability_finder"
|
23 | 23 | ]
|
|
58 | 58 | "output_type": "stream",
|
59 | 59 | "text": [
|
60 | 60 | "The species included in the probability table for the oxidation states model are show below \n",
|
61 |
| - "['O-2', 'Cl-1', 'Se-2', 'F-1', 'I-1', 'S-2', 'Te-2', 'Br-1', 'Ag2', 'Re4', 'Sc3', 'Mn2', 'Ag3', 'Re3', 'Ir5', 'La2', 'Bi5', 'Ge2', 'Ir4', 'Tm2', 'W5', 'Hg1', 'W2', 'Eu2', 'Ta4', 'In3', 'Hg2', 'Cu3', 'Cr2', 'K1', 'Ir3', 'Hf2', 'Sc1', 'Er3', 'Mo2', 'Co2', 'Yb2', 'Fe2', 'Re2', 'Ni2', 'Bi3', 'U4', 'Co3', 'Eu3', 'Fe3', 'Ru3', 'Ge4', 'Pd4', 'Mg2', 'Nd3', 'Cd2', 'Rh1', 'Fe4', 'Ho2', 'Ta2', 'Ru5', 'Tl3', 'Co1', 'Ti4', 'La1', 'Mn6', 'Ru4', 'Tl1', 'In1', 'Nb3', 'Ta3', 'Ga3', 'Re6', 'U6', 'Sr2', 'Zr4', 'Pr3', 'W3', 'U5', 'Al3', 'Cr3', 'Sn2', 'Ag1', 'Cu2', 'Zr1', 'Re7', 'Ti2', 'Re5', 'Pr2', 'Cr6', 'Mn3', 'Co4', 'Ni1', 'V3', 'Zn2', 'Sm3', 'Sn3', 'Tb1', 'Ru6', 'Y2', 'Tm3', 'Tb4', 'Cs1', 'Nb1', 'Th4', 'Cr5', 'Ni4', 'Rh4', 'W4', 'Sb5', 'Dy2', 'Pb2', 'Ni3', 'Ce3', 'Bi1', 'Sb3', 'Mn7', 'Nb5', 'Ti3', 'Ho3', 'Ga2', 'Th3', 'Rb1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2', 'Cr2', 'Dy3', 'Zr4', 'Zr1', 'Mo5', 'Sn3', 'Ba2', 'Th4', 'Co1', 'Cs1', 'Ru3', 'U2', 'Rh4', 'Tb2', 'Mn2', 'La3', 'Mn3', 'Cr5', 'Zr2', 'Ti4', 'Ni4', 'Ni3', 'Ru6', 'V2', 'Re4', 'Pb2', 'Y1', 'W6', 'Tl1', 'Ru4', 'La1', 'Ga2', 'Re7', 'Sb5', 'Tb4', 'Mo4', 'Fe4', 'In3', 'Dy2', 'Sc1', 'Lu3', 'In1', 'Yb3', 'Pd2', 'Pd3', 'Ti2', 'Ge3', 'Ir6', 'Cd2', 'Sc2', 'Re2', 'Sb3', 'Tb1', 'Ir5', 'Ca2', 'Th3', 'Zr3', 'Cu3', 'Yb2', 'Ir3', 'Sb4', 'V4', 'Mo6', 'Fe3', 'Mn7', 'Co3', 'Cu1', 'Na1', 'Ru5', 'Eu3', 'V3', 'Hf4', 'Tm3', 'Cr6', 'La2']\n" |
62 | 62 | ]
|
63 | 63 | }
|
64 | 64 | ],
|
|
90 | 90 | "name": "stdout",
|
91 | 91 | "output_type": "stream",
|
92 | 92 | "text": [
|
93 |
| - " The probability of Al existing in 3+ oxidation states with O in a 2- oxidation state is 1.0\n" |
| 93 | + " The probability of Al existing in a 3+ oxidation state with O in a 2- oxidation state is 1.0\n" |
94 | 94 | ]
|
95 | 95 | }
|
96 | 96 | ],
|
|
99 | 99 | "O = Species(\"O\", oxidation=-2, coordination=6)\n",
|
100 | 100 | "\n",
|
101 | 101 | "print(\n",
|
102 |
| - " f\" The probability of Al existing in 3+ oxidation states with O in a 2- oxidation state is {ox_prob_finder.pair_probability(Al,O)}\"\n", |
| 102 | + " f\" The probability of Al existing in a 3+ oxidation state with O in a 2- oxidation state is {ox_prob_finder.pair_probability(Al,O)}\"\n", |
103 | 103 | ")"
|
104 | 104 | ]
|
105 | 105 | },
|
|
152 | 152 | "name": "stdout",
|
153 | 153 | "output_type": "stream",
|
154 | 154 | "text": [
|
155 |
| - "The structure of mp-540839 CsPbI3:\n", |
| 155 | + "The structure of CsPbI3:\n", |
156 | 156 | "\n",
|
157 |
| - "Full Formula (Cs4 Pb4 I12)\n", |
| 157 | + "Full Formula (Cs1 Pb1 I3)\n", |
158 | 158 | "Reduced Formula: CsPbI3\n",
|
159 |
| - "abc : 4.847142 10.650447 18.031199\n", |
| 159 | + "abc : 6.410000 6.410000 6.410000\n", |
160 | 160 | "angles: 90.000000 90.000000 90.000000\n",
|
161 | 161 | "pbc : True True True\n",
|
162 |
| - "Sites (20)\n", |
163 |
| - " # SP a b c\n", |
164 |
| - "--- ---- ---- -------- --------\n", |
165 |
| - " 0 Cs+ 0.75 0.581276 0.17212\n", |
166 |
| - " 1 Cs+ 0.25 0.418724 0.82788\n", |
167 |
| - " 2 Cs+ 0.75 0.081276 0.32788\n", |
168 |
| - " 3 Cs+ 0.25 0.918724 0.67212\n", |
169 |
| - " 4 Pb2+ 0.25 0.661849 0.439217\n", |
170 |
| - " 5 Pb2+ 0.75 0.338151 0.560783\n", |
171 |
| - " 6 Pb2+ 0.25 0.161849 0.060783\n", |
172 |
| - " 7 Pb2+ 0.75 0.838151 0.939217\n", |
173 |
| - " 8 I- 0.75 0.837211 0.502045\n", |
174 |
| - " 9 I- 0.25 0.162789 0.497955\n", |
175 |
| - " 10 I- 0.75 0.337211 0.997955\n", |
176 |
| - " 11 I- 0.25 0.662789 0.002045\n", |
177 |
| - " 12 I- 0.25 0.529272 0.612308\n", |
178 |
| - " 13 I- 0.75 0.470728 0.387692\n", |
179 |
| - " 14 I- 0.25 0.029272 0.887692\n", |
180 |
| - " 15 I- 0.75 0.970728 0.112308\n", |
181 |
| - " 16 I- 0.25 0.796317 0.287306\n", |
182 |
| - " 17 I- 0.75 0.203683 0.712694\n", |
183 |
| - " 18 I- 0.25 0.296317 0.212694\n", |
184 |
| - " 19 I- 0.75 0.703683 0.787306\n", |
| 162 | + "Sites (5)\n", |
| 163 | + " # SP a b c\n", |
| 164 | + "--- ---- --- --- ---\n", |
| 165 | + " 0 Pb2+ 0 0 0\n", |
| 166 | + " 1 Cs+ 0.5 0.5 0.5\n", |
| 167 | + " 2 I- 0 0.5 0\n", |
| 168 | + " 3 I- 0.5 0 0\n", |
| 169 | + " 4 I- 0 0 0.5\n", |
185 | 170 | "\n",
|
186 | 171 | "The compound probability for CsPbI3 is 1.0.\n"
|
187 | 172 | ]
|
188 | 173 | }
|
189 | 174 | ],
|
190 | 175 | "source": [
|
191 |
| - "# Load the structure file\n", |
| 176 | + "# Create the structure\n", |
192 | 177 | "\n",
|
193 |
| - "struct = Structure.from_file(\"cspbi3.cif\")\n", |
194 |
| - "print(\"The structure of mp-540839 CsPbI3:\\n\")\n", |
195 |
| - "print(struct)\n", |
| 178 | + "CsPbI3 = Structure.from_spacegroup(\n", |
| 179 | + "'Pm-3m', # Spacegroup for a cubic perovskite\n", |
| 180 | + "Lattice.cubic(6.41), # Cubic spacing of 6.41 Å\n", |
| 181 | + "['Pb2+', 'Cs+', 'I-'], # Unique species of the ABX3 compound\n", |
| 182 | + "[[0.,0.,0.],[0.5,0.5,0.5],[0.,0.,0.5]] # Fractional atomic coordinates of each site\n", |
| 183 | + ")\n", |
| 184 | + "print(\"The structure of CsPbI3:\\n\")\n", |
| 185 | + "print(CsPbI3)\n", |
196 | 186 | "\n",
|
197 | 187 | "\n",
|
198 | 188 | "# Get the compound probability for CsPbI3\n",
|
199 |
| - "prob = ox_prob_finder.compound_probability(struct)\n", |
| 189 | + "prob = ox_prob_finder.compound_probability(CsPbI3)\n", |
200 | 190 | "\n",
|
201 | 191 | "print(f\"\\nThe compound probability for CsPbI3 is {prob_compound}.\")"
|
202 | 192 | ]
|
203 | 193 | }
|
204 | 194 | ],
|
205 | 195 | "metadata": {
|
206 | 196 | "kernelspec": {
|
207 |
| - "display_name": "Python 3.8.13 ('smact_tests')", |
| 197 | + "display_name": "smact_dev", |
208 | 198 | "language": "python",
|
209 | 199 | "name": "python3"
|
210 | 200 | },
|
|
218 | 208 | "name": "python",
|
219 | 209 | "nbconvert_exporter": "python",
|
220 | 210 | "pygments_lexer": "ipython3",
|
221 |
| - "version": "3.11.5" |
222 |
| - }, |
223 |
| - "vscode": { |
224 |
| - "interpreter": { |
225 |
| - "hash": "9f89bce96645c075fd87ba4308874c26726cf41cb3962e47a97b7697a60dd355" |
226 |
| - } |
| 211 | + "version": "3.10.14" |
227 | 212 | }
|
228 | 213 | },
|
229 | 214 | "nbformat": 4,
|
|
0 commit comments