|
| 1 | +--- |
| 2 | +title: Pymatgen JSON |
| 3 | +--- |
| 4 | + |
| 5 | +## Specification |
| 6 | + |
| 7 | +@Note [Reference](https://pymatgen.org) |
| 8 | + |
| 9 | +Pymatgen formatted JSON files are identified by the extension ``pmgjson`` and parsed following the ``Molecule`` or ``Structure`` format. |
| 10 | + |
| 11 | + |
| 12 | +## Example |
| 13 | + |
| 14 | +Water molecules using ``Molecule`` schema. |
| 15 | + |
| 16 | +```json |
| 17 | +{ |
| 18 | + "@module": "pymatgen.core.structure", |
| 19 | + "@class": "Molecule", |
| 20 | + "charge": 0, |
| 21 | + "spin_multiplicity": 1, |
| 22 | + "sites": [ |
| 23 | + { |
| 24 | + "name": "O", |
| 25 | + "species": [{"element": "O", "occu": 1}], |
| 26 | + "xyz": [1.1847029, 1.1150792, -0.0344641], |
| 27 | + "properties": {}, |
| 28 | + "label": "O" |
| 29 | + }, |
| 30 | + { |
| 31 | + "name": "H", |
| 32 | + "species": [{"element": "H", "occu": 1}], |
| 33 | + "xyz": [0.4939088, 0.9563767, 0.6340089], |
| 34 | + "properties": {}, |
| 35 | + "label": "H" |
| 36 | + }, |
| 37 | + { |
| 38 | + "name": "H", |
| 39 | + "species": [{"element": "H", "occu": 1}], |
| 40 | + "xyz": [2.0242676, 1.0811246, 0.4301417], |
| 41 | + "properties": {}, |
| 42 | + "label": "H" |
| 43 | + }, |
| 44 | + { |
| 45 | + "name": "O", |
| 46 | + "species": [{"element": "O", "occu": 1}], |
| 47 | + "xyz": [-1.1469443, 0.0697649, 1.1470196], |
| 48 | + "properties": {}, |
| 49 | + "label": "O" |
| 50 | + }, |
| 51 | + { |
| 52 | + "name": "H", |
| 53 | + "species": [{"element": "H", "occu": 1}], |
| 54 | + "xyz": [-1.2798308, -0.5232169, 1.8902833], |
| 55 | + "properties": {}, |
| 56 | + "label": "H" |
| 57 | + }, |
| 58 | + { |
| 59 | + "name": "H", |
| 60 | + "species": [{"element": "H", "occu": 1}], |
| 61 | + "xyz": [-1.0641398, -0.4956693, 0.356925], |
| 62 | + "properties": {}, |
| 63 | + "label": "H" |
| 64 | + }, |
| 65 | + { |
| 66 | + "name": "O", |
| 67 | + "species": [{"element": "O", "occu": 1}], |
| 68 | + "xyz": [-0.1633508, -1.0289346, -1.2401808], |
| 69 | + "properties": {}, |
| 70 | + "label": "O" |
| 71 | + }, |
| 72 | + { |
| 73 | + "name": "H", |
| 74 | + "species": [{"element": "H", "occu": 1}], |
| 75 | + "xyz": [0.4914771, -0.3248733, -1.0784838], |
| 76 | + "properties": {}, |
| 77 | + "label": "H" |
| 78 | + }, |
| 79 | + { |
| 80 | + "name": "H", |
| 81 | + "species": [{"element": "H", "occu": 1}], |
| 82 | + "xyz": [-0.5400907, -0.8496512, -2.1052499], |
| 83 | + "properties": {}, |
| 84 | + "label": "H" |
| 85 | + } |
| 86 | + ], |
| 87 | + "properties": {} |
| 88 | +} |
| 89 | +``` |
| 90 | + |
| 91 | +Rutile using ``Structure`` schema: |
| 92 | + |
| 93 | +```json |
| 94 | +{ |
| 95 | + "@module": "pymatgen.core.structure", |
| 96 | + "@class": "Structure", |
| 97 | + "charge": 0.0, |
| 98 | + "lattice": { |
| 99 | + "matrix": [ |
| 100 | + [5.59003664376222, 0.0, 0.0], |
| 101 | + [0.0, 8.68089159045265, 0.0], |
| 102 | + [0.0, 0.0, 8.68089159045265] |
| 103 | + ], |
| 104 | + "pbc": [true, true, true], |
| 105 | + "a": 5.59003664376222, |
| 106 | + "b": 8.68089159045265, |
| 107 | + "c": 8.68089159045265, |
| 108 | + "alpha": 90.0, |
| 109 | + "beta": 90.0, |
| 110 | + "gamma": 90.0, |
| 111 | + "volume": 421.253303917213 |
| 112 | + }, |
| 113 | + "properties": {}, |
| 114 | + "sites": [ |
| 115 | + { |
| 116 | + "species": [{"element": "Ti", "occu": 1}], |
| 117 | + "abc": [0.0, 0.0, 0.0], |
| 118 | + "properties": {}, |
| 119 | + "label": "Ti", |
| 120 | + "xyz": [0.0, 0.0, 0.0] |
| 121 | + }, |
| 122 | + { |
| 123 | + "species": [{"element": "Ti", "occu": 1}], |
| 124 | + "abc": [0.5, 0.5000000000000007, 0.5000000000000007], |
| 125 | + "properties": {}, |
| 126 | + "label": "Ti", |
| 127 | + "xyz": [2.79501832188111, 4.340445795226331, 4.340445795226331] |
| 128 | + }, |
| 129 | + { |
| 130 | + "species": [{"element": "O", "occu": 1}], |
| 131 | + "abc": [0.0, 0.30530000000000074, 0.30530000000000074], |
| 132 | + "properties": {}, |
| 133 | + "label": "O", |
| 134 | + "xyz": [0.0, 2.6502762025652005, 2.6502762025652005] |
| 135 | + }, |
| 136 | + { |
| 137 | + "species": [{"element": "O", "occu": 1}], |
| 138 | + "abc": [0.0, 0.6947000000000005, 0.6947000000000005], |
| 139 | + "properties": {}, |
| 140 | + "label": "O", |
| 141 | + "xyz": [0.0, 6.03061538788746, 6.03061538788746] |
| 142 | + }, |
| 143 | + { |
| 144 | + "species": [{"element": "O", "occu": 1}], |
| 145 | + "abc": [0.5, 0.1946999999999999, 0.8053000000000002], |
| 146 | + "properties": {}, |
| 147 | + "label": "O", |
| 148 | + "xyz": [2.79501832188111, 1.69016959266113, 6.99072199779152] |
| 149 | + }, |
| 150 | + { |
| 151 | + "species": [{"element": "O", "occu": 1}], |
| 152 | + "abc": [0.5, 0.8053000000000002, 0.1946999999999999], |
| 153 | + "properties": {}, |
| 154 | + "label": "O", |
| 155 | + "xyz": [2.79501832188111, 6.99072199779152, 1.69016959266113] |
| 156 | + } |
| 157 | + ] |
| 158 | +} |
| 159 | +``` |
| 160 | + |
| 161 | +## Missing features |
| 162 | + |
| 163 | +The schema is not verified on completeness and not all data is stored in the final structure type. |
| 164 | + |
| 165 | +@Note Feel free to contribute support for missing features |
| 166 | + or bring missing features to our attention by opening an issue. |
0 commit comments