Skip to content

Commit

Permalink
Merge pull request #74 from loriab/qcsk_export_2
Browse files Browse the repository at this point in the history
snapshot v2 input/output schemas
  • Loading branch information
bennybp committed Aug 14, 2020
2 parents 76617fb + 6d106f8 commit 1b2a0a6
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 26 deletions.
2 changes: 2 additions & 0 deletions qcschema/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""
Full versions of the schema will be inserted here.
python -c "import qcschema, json; print(json.dumps(qcschema.get_schema('output', 'dev')))"
"""
1 change: 1 addition & 0 deletions qcschema/data/v2/qc_schema_input.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$schema": "http://json-schema.org/draft-04/schema#", "name": "qcschema_input", "version": "1.dev", "description": "The MolSSI Quantum Chemistry Schema", "type": "object", "properties": {"molecule": {"$schema": "http://json-schema.org/draft-04/schema#", "name": "qcschema_molecule", "version": "2.dev", "description": "The physical cartesian representation of the molecular system", "type": "object", "properties": {"schema_name": {"guidance": "required properties schema_name within molecule block (instead of 'qcschema_[in|out]put' from one level higher) starts with schema_name=qcschema_molecule and schema_version=2", "type": "string", "pattern": "^(qcschema_molecule)$"}, "schema_version": {"type": "integer"}, "symbols": {"description": "(nat, ) atom symbols in title case.", "type": "array", "items": {"type": "string"}}, "geometry": {"description": "(3 * nat, ) vector of XYZ coordinates [a0] of the atoms.", "guidance": "Atom ordering is fixed; that is, a consumer who shuffles atoms must not reattach the input (pre-shuffling) molecule schema instance to any output (post-shuffling) per-atom results (e.g., gradient).", "type": "array", "items": {"type": "number"}}, "masses": {"description": "(nat, ) atom masses [u]; canonical weights assumed if not given.", "type": "array", "items": {"type": "number"}}, "atomic_numbers": {"description": "(nat, ) atomic numbers, nuclear charge for atoms. Ghostedness should be indicated through 'real' field, not zeros here.", "type": "array", "items": {"type": "number", "multipleOf": 1.0}}, "mass_numbers": {"description": "(nat, ) mass numbers for atoms, if known isotope, else -1.", "type": "array", "items": {"type": "number", "multipleOf": 1.0}}, "atom_labels": {"description": "(nat, ) atom labels with any user tagging information.", "type": "array", "items": {"type": "string"}}, "name": {"description": "The name of the molecule.", "type": "string"}, "comment": {"description": "Any additional comment one would attach to the molecule.", "type": "string"}, "molecular_charge": {"description": "The overall charge of the molecule.", "type": "number", "default": 0.0}, "molecular_multiplicity": {"description": "The overall multiplicity of the molecule.", "type": "number", "multipleOf": 1.0, "default": 1}, "real": {"description": "(nat, ) list describing if atoms are real (T) or ghost (F).", "type": "array", "items": {"type": "boolean"}}, "connectivity": {"description": "A list describing bonds within a molecule. Each element is a (atom1, atom2, order) tuple.", "guidance": "Bonds may be freely reordered and inverted.", "type": "array", "items": {"type": "array", "minItems": 3, "maxItems": 3, "items": [{"description": "Atom number (0-indexed) at one end of bond.", "type": "number", "multipleOf": 1.0}, {"description": "Atom number (0-indexed) at other end of bond.", "type": "number", "multipleOf": 1.0}, {"description": "Bond order.", "type": "number", "minimum": 0, "maximum": 5}]}}, "fragments": {"description": "(nfr, <varies>) list of indices (0-indexed) grouping atoms into molecular fragments within the topology.", "guidance": "Fragment ordering is fixed; that is, a consumer who shuffles fragments must not reattach the input (pre-shuffling) molecule schema instance to any output (post-shuffling) per-fragment results (e.g., n-body energy arrays).", "type": "array", "items": {"type": "array", "items": {"type": "number", "multipleOf": 1.0}}}, "fragment_charges": {"description": "(nfr, ) list of charges associated with each fragment tuple.", "type": "array", "items": {"type": "number"}}, "fragment_multiplicities": {"description": "(nfr, ) list of multiplicities associated with each fragment tuple.", "type": "array", "items": {"type": "number", "multipleOf": 1.0}}, "fix_com": {"description": "Whether translation of geometry is allowed (fix F) or disallowed (fix T).", "guidance": "A consumer who translates the geometry must not reattach the input (pre-translation) molecule schema instance to any output (post-translation) origin-sensitive results (e.g., an ordinary energy when EFP present).", "type": "boolean", "default": false}, "fix_orientation": {"description": "Whether rotation of geometry is allowed (fix F) or disallowed (fix T).", "guidance": "A consumer who rotates the geometry must not reattach the input (pre-rotation) molecule schema instance to any output (post-rotation) frame-sensitive results (e.g., molecular vibrations).", "type": "boolean", "default": false}, "fix_symmetry": {"description": "Maximal point group symmetry at which `geometry` should be treated. Lowercase.", "type": "string"}, "provenance": {"type": "object", "$ref": "#/definitions/provenance"}}, "required": ["symbols", "geometry", "schema_name", "schema_version"]}, "schema_name": {"type": "string", "pattern": "^(qc_?schema_input)$"}, "schema_version": {"type": "integer"}, "driver": {"definition": "The type of computation requested", "enum": ["energy", "gradient", "hessian"]}, "model": {"definition": "The method and basis specification requested", "properties": {"method": {"type": "string"}, "basis": {"anyOf": [{"$schema": "http://json-schema.org/draft-04/schema#", "name": "qcschema_basis", "version": "1.dev", "description": "The MolSSI Quantum Chemistry Basis Set Schema", "type": "object", "required": ["center_data", "atom_map", "name"], "additionalProperties": false, "properties": {"schema_name": {"type": "string", "pattern": "^(qcschema_basis)$"}, "schema_version": {"type": "integer"}, "name": {"description": "Name of the basis set", "type": "string"}, "description": {"description": "Brief description of the basis set", "type": "string"}, "center_data": {"description": "Shared basis data for all atoms/centers in the molecule", "type": "object", "additionalProperties": {"$ref": "#/definitions/center_basis"}}, "atom_map": {"description": "Mapping of all atoms/centers in the molecule to data in center_data", "type": "array", "items": {"type": "string"}}}}, {"description": "Name of the basis set to apply to the whole molecule", "type": "string"}]}}, "required": ["method", "basis"], "description": "The quantum chemistry model to be run."}, "keywords": {"type": "object", "description": "Program specific parameters to be used."}, "provenance": {"anyOf": [{"type": "object", "$ref": "#/definitions/provenance"}, {"type": "array", "items": {"type": "object", "$ref": "#/definitions/provenance"}}]}}, "required": ["schema_name", "schema_version", "molecule", "driver", "keywords", "model"], "definitions": {"error": {"properties": {"error_type": {"description": "The type of error raised.", "enum": ["convergence_error", "file_error", "memory_error"]}, "error_message": {"description": "A description of the raised error.", "type": "string"}}, "required": ["error_type", "error_message"], "description": "The type of error message raised.", "additionalProperties": false}, "provenance": {"properties": {"creator": {"description": "The name of the person or program who created this object.", "type": "string"}, "version": {"description": "The version of the program which created this object, blank otherwise. Suggest that versions be interpretable by PEP 440 (https://www.python.org/dev/peps/pep-0440/).", "type": "string"}, "routine": {"description": "The routine of the program which created this object, blank otherwise.", "type": "string"}}, "required": ["creator", "version", "routine"], "description": "A short provenance of the object.", "additionalProperties": true}, "electron_shell": {"description": "Information for a single electronic shell", "additionalProperties": false, "required": ["angular_momentum", "harmonic_type", "exponents", "coefficients"], "properties": {"angular_momentum": {"description": "Angular momentum (as an array of integers)", "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "integer", "minimum": 0}}, "harmonic_type": {"description": "Whether this shell is spherical or cartesian", "type": "string", "enum": ["spherical", "cartesian"]}, "exponents": {"description": "Exponents for this contracted shell", "type": "array", "minItems": 1, "items": {"type": "string"}}, "coefficients": {"description": "General contraction coefficients for this contracted shell", "type": "array", "minItems": 1, "items": {"description": "Segmented contraction coefficients", "type": "array", "minItems": 1, "items": {"type": "string"}}}}}, "ecp_potential": {"description": "ECP potential", "additionalProperties": false, "required": ["ecp_type", "angular_momentum", "r_exponents", "gaussian_exponents", "coefficients"], "properties": {"ecp_type": {"description": "Type of the ECP Potential", "type": "string", "enum": ["scalar", "spinorbit"]}, "angular_momentum": {"description": "Angular momentum (as an array of integers)", "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "integer", "minimum": 0}}, "r_exponents": {"description": "Exponents of the r term", "type": "array", "minItems": 1, "items": {"type": "integer"}}, "gaussian_exponents": {"description": "Exponents of the gaussian term", "type": "array", "minItems": 1, "items": {"type": "string"}}, "coefficients": {"description": "General contraction coefficients for this potential", "type": "array", "minItems": 1, "items": {"description": "Segmented contraction coefficients", "type": "array", "minItems": 1, "items": {"type": "string"}}}}}, "center_basis": {"description": "Data for a single atom/center in the basis set", "type": "object", "additionalProperties": false, "properties": {"electron_shells": {"description": "(Electronic) shells for this element", "type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/definitions/electron_shell"}}, "ecp_electrons": {"description": "Number of electrons replaced by ECP", "type": "integer", "minimum": 1}, "ecp_potentials": {"description": "Effective Core Potential for this element", "type": "array", "minItems": 1, "uniqueItems": true, "items": {"$ref": "#/definitions/ecp_potential"}}}}}}
1 change: 1 addition & 0 deletions qcschema/data/v2/qc_schema_molecule.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"$schema": "http://json-schema.org/draft-04/schema#", "name": "qcschema_molecule", "version": "2.dev", "description": "The physical cartesian representation of the molecular system", "type": "object", "properties": {"schema_name": {"guidance": "required properties schema_name within molecule block (instead of 'qcschema_[in|out]put' from one level higher) starts with schema_name=qcschema_molecule and schema_version=2", "type": "string", "pattern": "^(qcschema_molecule)$"}, "schema_version": {"type": "integer"}, "symbols": {"description": "(nat, ) atom symbols in title case.", "type": "array", "items": {"type": "string"}}, "geometry": {"description": "(3 * nat, ) vector of XYZ coordinates [a0] of the atoms.", "guidance": "Atom ordering is fixed; that is, a consumer who shuffles atoms must not reattach the input (pre-shuffling) molecule schema instance to any output (post-shuffling) per-atom results (e.g., gradient).", "type": "array", "items": {"type": "number"}}, "masses": {"description": "(nat, ) atom masses [u]; canonical weights assumed if not given.", "type": "array", "items": {"type": "number"}}, "atomic_numbers": {"description": "(nat, ) atomic numbers, nuclear charge for atoms. Ghostedness should be indicated through 'real' field, not zeros here.", "type": "array", "items": {"type": "number", "multipleOf": 1.0}}, "mass_numbers": {"description": "(nat, ) mass numbers for atoms, if known isotope, else -1.", "type": "array", "items": {"type": "number", "multipleOf": 1.0}}, "atom_labels": {"description": "(nat, ) atom labels with any user tagging information.", "type": "array", "items": {"type": "string"}}, "name": {"description": "The name of the molecule.", "type": "string"}, "comment": {"description": "Any additional comment one would attach to the molecule.", "type": "string"}, "molecular_charge": {"description": "The overall charge of the molecule.", "type": "number", "default": 0.0}, "molecular_multiplicity": {"description": "The overall multiplicity of the molecule.", "type": "number", "multipleOf": 1.0, "default": 1}, "real": {"description": "(nat, ) list describing if atoms are real (T) or ghost (F).", "type": "array", "items": {"type": "boolean"}}, "connectivity": {"description": "A list describing bonds within a molecule. Each element is a (atom1, atom2, order) tuple.", "guidance": "Bonds may be freely reordered and inverted.", "type": "array", "items": {"type": "array", "minItems": 3, "maxItems": 3, "items": [{"description": "Atom number (0-indexed) at one end of bond.", "type": "number", "multipleOf": 1.0}, {"description": "Atom number (0-indexed) at other end of bond.", "type": "number", "multipleOf": 1.0}, {"description": "Bond order.", "type": "number", "minimum": 0, "maximum": 5}]}}, "fragments": {"description": "(nfr, <varies>) list of indices (0-indexed) grouping atoms into molecular fragments within the topology.", "guidance": "Fragment ordering is fixed; that is, a consumer who shuffles fragments must not reattach the input (pre-shuffling) molecule schema instance to any output (post-shuffling) per-fragment results (e.g., n-body energy arrays).", "type": "array", "items": {"type": "array", "items": {"type": "number", "multipleOf": 1.0}}}, "fragment_charges": {"description": "(nfr, ) list of charges associated with each fragment tuple.", "type": "array", "items": {"type": "number"}}, "fragment_multiplicities": {"description": "(nfr, ) list of multiplicities associated with each fragment tuple.", "type": "array", "items": {"type": "number", "multipleOf": 1.0}}, "fix_com": {"description": "Whether translation of geometry is allowed (fix F) or disallowed (fix T).", "guidance": "A consumer who translates the geometry must not reattach the input (pre-translation) molecule schema instance to any output (post-translation) origin-sensitive results (e.g., an ordinary energy when EFP present).", "type": "boolean", "default": false}, "fix_orientation": {"description": "Whether rotation of geometry is allowed (fix F) or disallowed (fix T).", "guidance": "A consumer who rotates the geometry must not reattach the input (pre-rotation) molecule schema instance to any output (post-rotation) frame-sensitive results (e.g., molecular vibrations).", "type": "boolean", "default": false}, "fix_symmetry": {"description": "Maximal point group symmetry at which `geometry` should be treated. Lowercase.", "type": "string"}, "provenance": {"type": "object", "$ref": "#/definitions/provenance"}}, "required": ["symbols", "geometry", "schema_name", "schema_version"]}
1 change: 1 addition & 0 deletions qcschema/data/v2/qc_schema_output.schema

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions qcschema/dev/wavefunction/core_wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"type": "array",
"description": "Alpha-spin core (one-electron) Hamiltonian in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


core_wavefunction["h_core_b"] = {
"type": "array",
"description": "Beta-spin core (one-electron) Hamiltonian in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


Expand All @@ -26,13 +26,13 @@
"type": "array",
"description": "Alpha-spin effective core (one-electron) Hamiltonian in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


core_wavefunction["h_effective_b"] = {
"type": "array",
"description": "Beta-spin effective core (one-electron) Hamiltonian in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}
8 changes: 4 additions & 4 deletions qcschema/dev/wavefunction/localized_wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"description": "Localized alpha-spin orbitals in the AO basis. "
"All nmo orbitals are included, even if only a subset were localized.",
"items": {"type": "number"},
"shape": {"nao", "nmo"}
"shape": ["nao", "nmo"]
}


Expand All @@ -19,7 +19,7 @@
"description": "Localized beta-spin orbitals in the AO basis. "
"All nmo orbitals are included, even if only a subset were localized.",
"items": {"type": "number"},
"shape": {"nao", "nmo"}
"shape": ["nao", "nmo"]
}


Expand All @@ -29,7 +29,7 @@
"description": "Alpha-spin Fock matrix in the localized molecular orbital basis. "
"All nmo orbitals are included, even if only a subset were localized.",
"items": {"type": "number"},
"shape": {"nmo", "nmo"}
"shape": ["nmo", "nmo"]
}


Expand All @@ -38,7 +38,7 @@
"description": "Beta-spin Fock matrix in the localized molecular orbital basis. "
"All nmo orbitals are included, even if only a subset were localized.",
"items": {"type": "number"},
"shape": {"nmo", "nmo"}
"shape": ["nmo", "nmo"]
}

# Note that localized density, eigenvalues, and occupations are not included since they are the same as the SCF density
28 changes: 14 additions & 14 deletions qcschema/dev/wavefunction/scf_wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,31 @@
"type": "array",
"description": "SCF alpha-spin orbitals in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nmo"}
"shape": ["nao", "nmo"]
}


scf_wavefunction["scf_orbitals_b"] = {
"type": "array",
"description": "SCF beta-spin orbitals in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nmo"}
"shape": ["nao", "nmo"]
}

# Density
scf_wavefunction["scf_density_a"] = {
"type": "array",
"description": "SCF alpha-spin density in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


scf_wavefunction["scf_density_b"] = {
"type": "array",
"description": "SCF beta-spin density in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


Expand All @@ -42,47 +42,47 @@
"type": "array",
"description": "SCF alpha-spin Fock matrix in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


scf_wavefunction["scf_fock_b"] = {
"type": "array",
"description": "SCF beta-spin Fock matrix in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


scf_wavefunction["scf_coulomb_a"] = {
"type": "array",
"description": "SCF alpha-spin Coulomb matrix in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


scf_wavefunction["scf_coulomb_b"] = {
"type": "array",
"description": "SCF beta-spin Coulomb matrix in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


scf_wavefunction["scf_exchange_a"] = {
"type": "array",
"description": "SCF alpha-spin exchange matrix in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


scf_wavefunction["scf_exchange_b"] = {
"type": "array",
"description": "SCF beta-spin exchange matrix in the AO basis.",
"items": {"type": "number"},
"shape": {"nao", "nao"}
"shape": ["nao", "nao"]
}


Expand All @@ -91,15 +91,15 @@
"type": "array",
"description": "SCF alpha-spin orbital eigenvalues.",
"items": {"type": "number"},
"shape": {"nmo"}
"shape": ["nmo"]
}


scf_wavefunction["scf_eigenvalues_b"] = {
"type": "array",
"description": "SCF beta-spin orbital eigenvalues.",
"items": {"type": "number"},
"shape": {"nmo"}
"shape": ["nmo"]
}


Expand All @@ -108,14 +108,14 @@
"type": "array",
"description": "SCF alpha-spin orbital occupations.",
"items": {"type": "number"},
"shape": {"nmo"}
"shape": ["nmo"]
}


scf_wavefunction["scf_occupations_b"] = {
"type": "array",
"description": "SCF beta-spin orbital occupations.",
"items": {"type": "number"},
"shape": {"nmo"}
"shape": ["nmo"]
}

6 changes: 3 additions & 3 deletions qcschema/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

_data_path = Path(__file__).resolve().parent / "data"

_input_version_list = ["dev", 1]
_output_version_list = ["dev", 1]
_molecule_version_list = ["dev", 1]
_input_version_list = ["dev", 1, 2]
_output_version_list = ["dev", 1, 2]
_molecule_version_list = ["dev", 1, 2]

_schema_input_dict = {"dev": dev.input_dev_schema}
_schema_output_dict = {"dev": dev.output_dev_schema}
Expand Down

0 comments on commit 1b2a0a6

Please sign in to comment.