From 4097b77f7247254c4708aaa4f7f61ad1649720ca Mon Sep 17 00:00:00 2001 From: Alexander Zech Date: Fri, 8 Sep 2023 16:30:14 -0700 Subject: [PATCH 1/5] feat: add dielectric tensor schema + example --- .../non-scalar/dielectric_tensor.json | 31 ++++++++++++++ .../non-scalar/dielectric_tensor.json | 41 +++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 example/properties_directory/non-scalar/dielectric_tensor.json create mode 100644 schema/properties_directory/non-scalar/dielectric_tensor.json diff --git a/example/properties_directory/non-scalar/dielectric_tensor.json b/example/properties_directory/non-scalar/dielectric_tensor.json new file mode 100644 index 000000000..de008d2c5 --- /dev/null +++ b/example/properties_directory/non-scalar/dielectric_tensor.json @@ -0,0 +1,31 @@ +{ + "name": "dielectric_tensor", + "diagonalReal": { + "frequencies": [ + 0.000000000, + 0.060120240, + 0.120240481, + 0.180360721 + ], + "dielectricComponents": [ + [20.137876673, 20.137876704, 20.137849785], + [20.143821034, 20.143821066, 20.143794147], + [20.161680126, 20.161680158, 20.161653237], + [20.191532277, 20.191532311, 20.191505388] + ] + }, + "diagonalImaginary": { + "frequencies": [ + 0.000000000, + 0.060120240, + 0.120240481, + 0.180360721 + ], + "dielectricComponents": [ + [0.000000000, 0.000000000, 0.000000000], + [0.019862988, 0.019862988, 0.019862987], + [0.039813564, 0.039813565, 0.039813563], + [0.059940387, 0.059940389, 0.059940385] + ] + } +} diff --git a/schema/properties_directory/non-scalar/dielectric_tensor.json b/schema/properties_directory/non-scalar/dielectric_tensor.json new file mode 100644 index 000000000..12599880c --- /dev/null +++ b/schema/properties_directory/non-scalar/dielectric_tensor.json @@ -0,0 +1,41 @@ +{ + "$id": "properties-directory/non-scalar/dielectric-tensor", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "dielectric tensor property", + "properties": { + "name": { + "enum": [ + "dielectric_tensor" + ] + }, + "diagonalReal": { + "description": "Real parts of the dielectric tensor diagonal components", + "$ref": "#/definitions/dielectric-function" + }, + "diagonalImaginary": { + "description": "Imaginary parts of the dielectric tensor diagonal components", + "$ref": "#/definitions/dielectric-function" + } + }, + "definitions": { + "dielectric-function": { + "type": "object", + "properties": { + "frequencies": { + "description": "Frequencies in eV", + "type": "array", + "items": { + "type": "number" + } + }, + "dielectricComponents": { + "description": "Dielectric components, e.g. espr_x, espr_y, espr_z", + "type": "array", + "items": { + "$ref": "../../core/primitive/array_of_3_numbers.json" + } + } + } + } + } +} From 2bb455992de84613bed6a9a4a341a8d3016be6bd Mon Sep 17 00:00:00 2001 From: Alexander Zech Date: Fri, 8 Sep 2023 16:30:45 -0700 Subject: [PATCH 2/5] chore: add dielectric tensor property to manifest --- manifest/properties.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manifest/properties.yaml b/manifest/properties.yaml index 35ca3a385..15133f989 100644 --- a/manifest/properties.yaml +++ b/manifest/properties.yaml @@ -193,6 +193,10 @@ average_potential_profile: schemaId: properties-directory/non-scalar/average-potential-profile isResult: true +dielectric_tensor: + schemaId: properties-directory/non-scalar/dielectric-tensor + isResult: true + # STRUCTURAL basis: defaults: From 0494f58bbfbe7dd856b61849a12e5b709ef5e009 Mon Sep 17 00:00:00 2001 From: Alexander Zech Date: Fri, 8 Sep 2023 18:31:55 -0700 Subject: [PATCH 3/5] refactor: generalize frequency component schema --- .../reusable/frequency_function_matrix.json | 23 ++++++++++++++ .../non-scalar/dielectric_tensor.json | 31 +++++-------------- 2 files changed, 31 insertions(+), 23 deletions(-) create mode 100644 schema/core/reusable/frequency_function_matrix.json diff --git a/schema/core/reusable/frequency_function_matrix.json b/schema/core/reusable/frequency_function_matrix.json new file mode 100644 index 000000000..5086acde1 --- /dev/null +++ b/schema/core/reusable/frequency_function_matrix.json @@ -0,0 +1,23 @@ +{ + "$id": "core/reusable/frequency-function-matrix", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "", + "description": "Schema for a function of frequency yielding a nx3 matrix", + "type": "object", + "properties": { + "frequencies": { + "description": "Frequencies", + "type": "array", + "items": { + "type": "number" + } + }, + "components": { + "description": "Matrix with 3 columns, e.g. x, y, z", + "type": "array", + "items": { + "$ref": "../primitive/array_of_3_numbers.json" + } + } + } +} diff --git a/schema/properties_directory/non-scalar/dielectric_tensor.json b/schema/properties_directory/non-scalar/dielectric_tensor.json index 12599880c..823836ea4 100644 --- a/schema/properties_directory/non-scalar/dielectric_tensor.json +++ b/schema/properties_directory/non-scalar/dielectric_tensor.json @@ -10,32 +10,17 @@ }, "diagonalReal": { "description": "Real parts of the dielectric tensor diagonal components", - "$ref": "#/definitions/dielectric-function" + "$ref": "../../core/reusable/frequency_function_matrix.json" }, "diagonalImaginary": { "description": "Imaginary parts of the dielectric tensor diagonal components", - "$ref": "#/definitions/dielectric-function" + "$ref": "../../core/reusable/frequency_function_matrix.json" + }, + "spin": { + "type": "number" } }, - "definitions": { - "dielectric-function": { - "type": "object", - "properties": { - "frequencies": { - "description": "Frequencies in eV", - "type": "array", - "items": { - "type": "number" - } - }, - "dielectricComponents": { - "description": "Dielectric components, e.g. espr_x, espr_y, espr_z", - "type": "array", - "items": { - "$ref": "../../core/primitive/array_of_3_numbers.json" - } - } - } - } - } + "required": [ + "name" + ] } From 17234571a4b0daf27190b2b2a8b160afc7f5d1fa Mon Sep 17 00:00:00 2001 From: Alexander Zech Date: Fri, 8 Sep 2023 19:50:02 -0700 Subject: [PATCH 4/5] chore: fix example --- .../properties_directory/non-scalar/dielectric_tensor.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example/properties_directory/non-scalar/dielectric_tensor.json b/example/properties_directory/non-scalar/dielectric_tensor.json index de008d2c5..74891553f 100644 --- a/example/properties_directory/non-scalar/dielectric_tensor.json +++ b/example/properties_directory/non-scalar/dielectric_tensor.json @@ -7,7 +7,7 @@ 0.120240481, 0.180360721 ], - "dielectricComponents": [ + "components": [ [20.137876673, 20.137876704, 20.137849785], [20.143821034, 20.143821066, 20.143794147], [20.161680126, 20.161680158, 20.161653237], @@ -21,7 +21,7 @@ 0.120240481, 0.180360721 ], - "dielectricComponents": [ + "components": [ [0.000000000, 0.000000000, 0.000000000], [0.019862988, 0.019862988, 0.019862987], [0.039813564, 0.039813565, 0.039813563], From 9ceaa182c8af3ff90a178fa2a9b2fc6f976d1462 Mon Sep 17 00:00:00 2001 From: Alexander Zech Date: Fri, 8 Sep 2023 20:58:07 -0700 Subject: [PATCH 5/5] chore: restructure dielectric tensor property --- .../non-scalar/dielectric_tensor.json | 158 ++++++++++++++---- .../reusable/dielectric_tensor_component.json | 28 ++++ .../non-scalar/dielectric_tensor.json | 16 +- 3 files changed, 164 insertions(+), 38 deletions(-) create mode 100644 schema/core/reusable/dielectric_tensor_component.json diff --git a/example/properties_directory/non-scalar/dielectric_tensor.json b/example/properties_directory/non-scalar/dielectric_tensor.json index 74891553f..37b6176cd 100644 --- a/example/properties_directory/non-scalar/dielectric_tensor.json +++ b/example/properties_directory/non-scalar/dielectric_tensor.json @@ -1,31 +1,133 @@ { "name": "dielectric_tensor", - "diagonalReal": { - "frequencies": [ - 0.000000000, - 0.060120240, - 0.120240481, - 0.180360721 - ], - "components": [ - [20.137876673, 20.137876704, 20.137849785], - [20.143821034, 20.143821066, 20.143794147], - [20.161680126, 20.161680158, 20.161653237], - [20.191532277, 20.191532311, 20.191505388] - ] - }, - "diagonalImaginary": { - "frequencies": [ - 0.000000000, - 0.060120240, - 0.120240481, - 0.180360721 - ], - "components": [ - [0.000000000, 0.000000000, 0.000000000], - [0.019862988, 0.019862988, 0.019862987], - [0.039813564, 0.039813565, 0.039813563], - [0.059940387, 0.059940389, 0.059940385] - ] - } + "values": [ + { + "part": "real", + "spin": 0.5, + "frequencies": [ + 0.000000000, + 0.060120240, + 0.120240481, + 0.180360721 + ], + "components": [ + [ + 0.000000000, + 0.000000000, + 0.000000000 + ], + [ + 0.019862988, + 0.019862988, + 0.019862987 + ], + [ + 0.039813564, + 0.039813565, + 0.039813563 + ], + [ + 0.059940387, + 0.059940389, + 0.059940385 + ] + ] + }, + { + "part": "imaginary", + "spin": 0.5, + "frequencies": [ + 0.000000000, + 0.060120240, + 0.120240481, + 0.180360721 + ], + "components": [ + [ + 0.000000000, + 0.000000000, + 0.000000000 + ], + [ + 0.019862988, + 0.019862988, + 0.019862987 + ], + [ + 0.039813564, + 0.039813565, + 0.039813563 + ], + [ + 0.059940387, + 0.059940389, + 0.059940385 + ] + ] + }, + { + "part": "real", + "spin": -0.5, + "frequencies": [ + 0.000000000, + 0.060120240, + 0.120240481, + 0.180360721 + ], + "components": [ + [ + 0.000000000, + 0.000000000, + 0.000000000 + ], + [ + 0.019862988, + 0.019862988, + 0.019862987 + ], + [ + 0.039813564, + 0.039813565, + 0.039813563 + ], + [ + 0.059940387, + 0.059940389, + 0.059940385 + ] + ] + }, + { + "part": "imaginary", + "spin": -0.5, + "frequencies": [ + 0.000000000, + 0.060120240, + 0.120240481, + 0.180360721 + ], + "components": [ + [ + 0.000000000, + 0.000000000, + 0.000000000 + ], + [ + 0.019862988, + 0.019862988, + 0.019862987 + ], + [ + 0.039813564, + 0.039813565, + 0.039813563 + ], + [ + 0.059940387, + 0.059940389, + 0.059940385 + ] + ] + } + ] } diff --git a/schema/core/reusable/dielectric_tensor_component.json b/schema/core/reusable/dielectric_tensor_component.json new file mode 100644 index 000000000..c30234ac4 --- /dev/null +++ b/schema/core/reusable/dielectric_tensor_component.json @@ -0,0 +1,28 @@ +{ + "$id": "core/reusable/dielectric-tensor-component", + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "Dielectric Tensor", + "allOf": [ + { + "$ref": "./frequency_function_matrix.json" + } + ], + "properties": { + "part": { + "description": "Real or imaginary part of the dielectric tensor component", + "type": "string", + "enum": [ + "real", + "imaginary" + ] + }, + "spin": { + "type": "number" + } + }, + "required": [ + "part", + "frequencies", + "components" + ] +} diff --git a/schema/properties_directory/non-scalar/dielectric_tensor.json b/schema/properties_directory/non-scalar/dielectric_tensor.json index 823836ea4..02daebac7 100644 --- a/schema/properties_directory/non-scalar/dielectric_tensor.json +++ b/schema/properties_directory/non-scalar/dielectric_tensor.json @@ -2,22 +2,18 @@ "$id": "properties-directory/non-scalar/dielectric-tensor", "$schema": "http://json-schema.org/draft-04/schema#", "title": "dielectric tensor property", + "description": "The real and imaginary parts of the diagonal elements of the dieletric tensor", "properties": { "name": { "enum": [ "dielectric_tensor" ] }, - "diagonalReal": { - "description": "Real parts of the dielectric tensor diagonal components", - "$ref": "../../core/reusable/frequency_function_matrix.json" - }, - "diagonalImaginary": { - "description": "Imaginary parts of the dielectric tensor diagonal components", - "$ref": "../../core/reusable/frequency_function_matrix.json" - }, - "spin": { - "type": "number" + "values": { + "type": "array", + "items": { + "$ref": "../../core/reusable/dielectric_tensor_component.json" + } } }, "required": [