generated from Exabyte-io/template-definitions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from Exabyte-io/feat/SOF-7123
SOF-7123: support DFT+U+V and DFT+U+J0 calculations in QE
- Loading branch information
Showing
6 changed files
with
230 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { HubbardUContextProvider } from "./HubbardUContextProvider"; | ||
|
||
const defaultHubbardConfig = { | ||
paramType: "U", | ||
atomicSpecies: "", | ||
atomicOrbital: "2p", | ||
value: 1.0, | ||
}; | ||
|
||
export class HubbardJContextProvider extends HubbardUContextProvider { | ||
get defaultData() { | ||
return [ | ||
{ | ||
...defaultHubbardConfig, | ||
atomicSpecies: this.uniqueElements?.length > 0 ? this.uniqueElements[0] : "", | ||
}, | ||
]; | ||
} | ||
|
||
get uiSchemaStyled() { | ||
return { | ||
"ui:options": { | ||
addable: true, | ||
orderable: true, | ||
removable: true, | ||
}, | ||
title: { | ||
"ui:classNames": "col-xs-12", | ||
}, | ||
items: { | ||
paramType: this.defaultFieldStyles, | ||
atomicSpecies: this.defaultFieldStyles, | ||
atomicOrbital: this.defaultFieldStyles, | ||
value: this.defaultFieldStyles, | ||
}, | ||
}; | ||
} | ||
|
||
get jsonSchema() { | ||
return { | ||
$schema: "http://json-schema.org/draft-04/schema#", | ||
title: "", | ||
description: "Hubbard parameters for DFT+U+J calculation.", | ||
type: "array", | ||
items: { | ||
type: "object", | ||
properties: { | ||
paramType: { | ||
type: "string", | ||
title: "Species", | ||
enum: ["U", "J", "B", "E2", "E3"], | ||
default: defaultHubbardConfig.paramType, | ||
}, | ||
atomicSpecies: { | ||
type: "string", | ||
title: "Species", | ||
enum: this.uniqueElements, | ||
default: this.uniqueElements?.length > 0 ? this.uniqueElements[0] : "", | ||
}, | ||
atomicOrbital: { | ||
type: "string", | ||
title: "Orbital", | ||
enum: this.orbitalList, | ||
default: defaultHubbardConfig.atomicOrbital, | ||
}, | ||
value: { | ||
type: "number", | ||
title: "Value (eV)", | ||
default: defaultHubbardConfig.value, | ||
}, | ||
}, | ||
}, | ||
minItems: 1, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import { HubbardUContextProvider } from "./HubbardUContextProvider"; | ||
|
||
const defaultHubbardConfig = { | ||
atomicSpecies: "", | ||
atomicOrbital: "2p", | ||
atomicSpecies2: "", | ||
atomicOrbital2: "2p", | ||
siteIndex: 1, | ||
siteIndex2: 1, | ||
hubbardVValue: 1.0, | ||
}; | ||
|
||
export class HubbardVContextProvider extends HubbardUContextProvider { | ||
get defaultData() { | ||
return [ | ||
{ | ||
...defaultHubbardConfig, | ||
atomicSpecies: this.firstSpecies, | ||
atomicSpecies2: this.secondSpecies, | ||
siteIndex2: this.uniqueElements?.length > 1 ? 2 : defaultHubbardConfig.siteIndex2, | ||
}, | ||
]; | ||
} | ||
|
||
get firstSpecies() { | ||
return this.uniqueElements?.length > 0 ? this.uniqueElements[0] : ""; | ||
} | ||
|
||
get secondSpecies() { | ||
return this.uniqueElements?.length > 1 ? this.uniqueElements[1] : this.firstSpecies; | ||
} | ||
|
||
get uiSchemaStyled() { | ||
return { | ||
"ui:options": { | ||
addable: true, | ||
orderable: true, | ||
removable: true, | ||
}, | ||
title: { | ||
"ui:classNames": "col-xs-12", | ||
}, | ||
items: { | ||
atomicSpecies: this.defaultFieldStyles, | ||
atomicOrbital: this.defaultFieldStyles, | ||
atomicSpecies2: this.defaultFieldStyles, | ||
atomicOrbital2: this.defaultFieldStyles, | ||
siteIndex: this.defaultFieldStyles, | ||
siteIndex2: this.defaultFieldStyles, | ||
hubbardVValue: this.defaultFieldStyles, | ||
}, | ||
}; | ||
} | ||
|
||
get jsonSchema() { | ||
return { | ||
$schema: "http://json-schema.org/draft-04/schema#", | ||
title: "", | ||
description: "Hubbard V parameters for DFT+U+V calculation.", | ||
type: "array", | ||
items: { | ||
type: "object", | ||
properties: { | ||
atomicSpecies: { | ||
type: "string", | ||
title: "Species 1", | ||
enum: this.uniqueElements, | ||
default: this.firstSpecies, | ||
}, | ||
siteIndex: { | ||
type: "integer", | ||
title: "Site no 1", | ||
default: defaultHubbardConfig.siteIndex, | ||
}, | ||
atomicOrbital: { | ||
type: "string", | ||
title: "Orbital 1", | ||
enum: this.orbitalList, | ||
default: defaultHubbardConfig.atomicOrbital, | ||
}, | ||
atomicSpecies2: { | ||
type: "string", | ||
title: "Species 2", | ||
enum: this.uniqueElements, | ||
default: this.secondSpecies, | ||
}, | ||
siteIndex2: { | ||
type: "integer", | ||
title: "Site no 2", | ||
default: | ||
this.uniqueElements?.length > 1 ? 2 : defaultHubbardConfig.siteIndex2, | ||
}, | ||
atomicOrbital2: { | ||
type: "string", | ||
title: "Orbital 2", | ||
enum: this.orbitalList, | ||
default: defaultHubbardConfig.atomicOrbital, | ||
}, | ||
hubbardVValue: { | ||
type: "number", | ||
title: "V (eV)", | ||
default: defaultHubbardConfig.hubbardVValue, | ||
}, | ||
}, | ||
}, | ||
minItems: 1, | ||
}; | ||
} | ||
} |