7.58. orca_2json¶
This utility program supports the exchange of external ORCA data like geometry, orbitals and basisets but also of internal ORCA data like 1-electron and 2-electron integals with other programs.
7.58.1. Export ORCA data¶
The program reads information like geometries, basis sets, MOs etc.
stored in the .gbw
file or other equivalent ones as .uno
, .mp2nat
,
.qro
etc. and calculates integrals to export them in JSON standard
output formats. For density information the .densities
file must also
be available. The program is called as a standalone via command line.
Syntax:
orca_2json BaseName.gbw -options
or
orca_2json BaseName.mp2nat -options
or
orca_2json BaseName.uno -options
The following ASCII and binary JSON-formats are available as command line options. It is possible to specify more than one format option.
-json Write ASCII JSON file (default)
-bson Write binary JSON file
-ubjson Write universal binary JSON specification file
-msgpack Write MessagePack file
In addition two more options are availble. The first of them is used to translate a basename.property.txt file to a corresponding one in JSON format (see Property File).
-property Translate a *.txt property file to a *.json one
Finally, orca_2json has the ability to create a .gbw file from a json file. For this one needs to use the ‘-gbw’ option (see Import JSON data into ORCA).
-gbw Create a GBW file from a json one
7.58.2. Configuration file¶
The data stored in the json file can be configured more individually. Some information like atom information, geometry and charge are always written in the outputfile (see Basic Information). Other data can be requested via keywords in a JSON-formatted configuration file that either exists for every ORCA output file or for all files in a directory. Without these configuration files ALL available data are stored except for the densities and the integrals. Because of the huge amount of data these are only available when explicitly requested in the configuration file.
You can specify a basename-dependend configuration file
BaseName.json.conf
or a global file used for all requests in a directory.
orca.json.conf
Most keywords in the configuration file can be activated or deactivated with true or false but some keywords like densities or output formats have more options and require a list of values. If an option is not specifically selected it is omitted.
Structure of the configuration file:
{
"keyword": true/false,
...
"keyword": true/false,
"keyword": ["option",...."option"]
...
}
Example
{
"MOCoefficients":false,
"BasisSet":false
}
Using the above configuration file in the working directory, orca_2json will not export the molecular coefficients and the basis set information.
Example
Here is an example configuration file with most available keywords where everything is disabled except for the basis set information and the specified Integrals, all densities stored in the density file are requested and the output format should be ascii json and binary json.
{
"MOCoefficients": false,
"Basisset": true,
"1elPropertyIntegrals": ["dipole", "quadrupole", "velocity", "printLinMom", "angular_momentum", "higherMoment"],
"1elPropertyRelIntegrals": ["dipole", "quadrupole", "angular_momentum"],
"1elIntegrals": ["H", "S", "T", "V", "HMO"],
"1elIntegralsRel": ["H", "S", "T", "V", "HMO"],
"Vaux": false,
"AuxBasisType": "AuxC"
"FullTrafo": false,
"OrbWin": [0,0,0,0,0,0,0,0].
"2elIntegrals": [ "MO_IJKL", "RI_IAV", "RI_IJKL"],
"2elNonRedIntegrals": false,
"2elNonRedRIIntegrals": false,
"MullikenCharge": false,
"LoewdinCharge": false,
"Densities": ["all"], <--- here you specify the names like "scfp" or "scfr" or all
"JSONFormats": ["json", "bson"]
}
7.58.3. Available information¶
7.58.3.1. Property File¶
Beside all information that we will see orca_2json can create, it can also translate the property file of ORCA (basename.property.txt) to a JSON file. This option gives access to all properties stored in the property file. (For more information on property file see Property File).
The syntax is:
orca_2json basename -property
Where
basename is the name of the property file without the extension property.txt.
Example
If we use the following ORCA input (with the name test.inp):
!HF
*xyz 0 1
H 0.0 0.0 0.0
H 0.0 0.0 0.8
*
ORCA will create and store on disk, a file named “test.property.txt”. The start of the file will look like this:
*************************************************
******************* ORCA 6.0 *******************
*************************************************
$Calculation_Status
&GeometryIndex 1
&ListStatus OUT
&VERSION [&Type "String"] "6.0"
&PROGNAME [&Type "String"] "LeanSCF"
&STATUS [&Type "String"] "NORMAL TERMINATION"
$End
$Geometry
&GeometryIndex 1
&ListStatus OUT
&NATOMS [&Type "Integer"] 2
&NCORELESSECP [&Type "Integer"] 0
&NGHOSTATOMS [&Type "Integer"] 0
&CartesianCoordinates [&Type "Coordinates", &Dim(2,4), &Units "Bohr"]
H 0.000000000000 0.000000000000 0.000000000000
H 0.000000000000 0.000000000000 1.511780907137
$End
$SCF_Energy
&GeometryIndex 1
&ListStatus OUT
&SCF_ENERGY [&Type "Double"] -1.1271129220233238e+00
$End
Then running orca_2json in the following way:
orca_2json test -property
ORCA will create a new file on disk, named “test.property.json”. The start of this file will look like this:
{
"Calculation_Status" : {
"PropertyName" : "Calculation_Status",
"GeometryIndex" : 1,
"VERSION" : "6.0" ,
"PROGNAME" : "LeanSCF" ,
"STATUS" : "NORMAL TERMINATION"
},
"Geometry_1" : {
"Geometry" : {
"PropertyName" : "Geometry",
"GeometryIndex" : 1,
"NATOMS" : 2 ,
"NCORELESSECP" : 0 ,
"NGHOSTATOMS" : 0 ,
"Coordinates" : {
"Type": "Cartesians",
"Units": "Bohr",
"Cartesians": [
["H ", 0.000000000000, 0.000000000000, 0.000000000000],
["H ", 0.000000000000, 0.000000000000, 1.511780907137]
]
}
},
"SCF_Energy" : {
"PropertyName" : "SCF_Energy",
"GeometryIndex" : 1,
"SCF_ENERGY" : -1.1271129220233238e+00
},
7.58.3.2. Basic Information¶
Some basic information will always be written into the JSON-file as
per Atom |
- |
Coords |
- |
ElementLabel |
|
- |
ElementNumber |
|
- |
Idx |
|
- |
NuclearCharge |
|
per molecule |
- |
BaseName |
- |
Charge |
|
- |
CoordinateUnits |
|
- |
HFTyp |
|
- |
Multiplicity |
|
- |
PointGroup |
For example using the following configuration file where we set everything to false:
{
"MOCoefficients": false,
"Basisset": false,
"MullikenCharge": false,
"LoewdinCharge": false,
"JSONFormats": ["json"]
}
will still produce a json file which for the case of a H2 molecule should look like:
{
"Molecule": {
"Atoms": [
{
"Coords": [
0.0,
0.0,
0.0
],
"ElementLabel": "H",
"ElementNumber": 1,
"Idx": 0,
"NuclearCharge": 1.0
},
{
"Coords": [
0.0,
0.0,
0.8
],
"ElementLabel": "H",
"ElementNumber": 1,
"Idx": 1,
"NuclearCharge": 1.0
}
],
"BaseName": "test",
"Charge": 0,
"CoordinateUnits": "Angs",
"HFTyp": "RHF",
"Multiplicity": 1,
"PointGroup": "C1"
},
"ORCA Header": {
"Date": "2024-06-03 00:06:37 +0200",
"Git": "548015a5a0",
"Version": " Program Version 6.0 - CURRENT -\n"
}
}
7.58.3.3. Densities¶
orca_2json can also export calculated densities in json format.
Densities |
- |
densities as available in the .densities file |
Syntax “Densities” : [list of densities]
Where list of densities should be a list of strings with the expected densities.
NOTE By default densities, due to their potential size, are not exported to a json file.
NOTE An empty bracket syntax (“Densities” : []) will cause the program to crash.
NOTE There is the string “All” available where the program will export all available densities.
7.58.3.4. Electron Integrals¶
The list of available electron integrals is shown in the next table.
1elIntegrals |
- |
1-electron integrals |
1elPropertyIntegrals |
- |
1-electron property integrals |
1elIntegralsRel |
- |
relativistic 1-electron integrals |
1elPropertyRelIntegrals |
- |
relativistic 1-electron property integrals |
2elIntegrals |
- |
two-electron integrals |
2elNonRedIntegrals |
- |
non-redundant two-electron integrals |
2elNonRedRIIntegrals |
- |
non-redundant two-electron RI integrals |
7.58.3.4.1. 1-electron integrals¶
For 1-electron integrals we use the following notation:
H |
- |
one electron matrix |
HMO |
- |
one electron matrix in MO basis |
S |
- |
overlap matrix |
T |
- |
kinetic energy matrix |
V |
- |
nuclear attraction matrix |
Example
{
"1elIntegrals": ["H", "S"],
"JSONFormats": ["json"]
}
will produce a json file were only the H-Matrix and the Overlap matrix are printed (beside the basic information). Please note that for the one electron relativistic integrals there is a separate variable (see 1-electron relativistic integrals)
7.58.3.4.2. 1-electron property integrals¶
Also available are 1-electron property integrals.
1elPropertyIntegrals |
- |
1-electron property integrals |
Currently the following options are valid:
angular_momentum |
- |
Angular momentum integrals |
dipole |
- |
Dipole moment integrals |
higherMoment |
- |
Octupole moment integrals |
quadrupole |
- |
Quadrupole moment integrals |
velocity |
- |
Velocity integrals |
Example
{
"1elPropertyIntegrals": ["dipole", "quadrupole"],
"JSONFormats": ["json"]
}
7.58.3.4.3. 1-electron relativistic integrals¶
1-electron relativistic integrals follow the same notation as the corresponding non-relativistic ones (see 1-electron integrals).
Example
{
"1elIntegralsRel":["H", "T", "V"],
"JSONFormats": ["json"]
}
This example will produce and store in the corresponding json file the X2C-transformed H-Matrix, as well as the separate potential and kinetic contributions. Note that while the “relativistic” overlap matrix is available for completeness, in X2C it is identical to the non-relativistic overlap by construction.
7.58.3.4.4. 1-electron relativistic property integrals¶
Also available are 1-electron relativistic (X2C) property integrals similar to the non-relativistic ones but with reduced options.
1elPropertyRelIntegrals |
- |
relativistic 1-electron property integrals |
Currently the following options are valid:
angular_momentum |
- |
Angular momentum integrals |
dipole |
- |
Dipole moment integrals |
quadrupole |
- |
Quadrupole moment integrals |
Example
{
"1elPropertyRelIntegrals": ["dipole","quadrupole","angular_momentum"]
}
7.58.3.4.5. Origin setting¶
The origin of the electric property is per default the Cartesian origin but also the center of mass and the center of nuclear charges can be selected. Additionally an arbitrary position can be given as x,y,z coordinates when ori_el = 3 is chosen. Currently the following options are valid:
ori_el |
- |
0 - Cartesian origin |
- |
1 - center of mass |
|
- |
2 - center of nuclear charge |
|
- |
3 - arbitrary position |
|
ori_el_xyz |
- |
position of the origin(x,y,z) |
Example
{
"1elPropertyIntegrals": ["dipole","quadrupole"],
"ori_el": 3,
"ori_el_xyz": [0.0, 1.0, 1.0]
}
7.58.3.4.6. 2-electron integrals¶
ORCA_2json can produce and write on disk three main categories of 2-electron integrals.
Two-electron integrals in atomic basis (2-electron integrals in AO basis)
Two-electron integrals in molecular basis (2-electron integrals in MO basis)
Two-electron integrals using the resolution of identity approximation (RI). (RI 2-electron integrals)
7.58.3.4.6.1. 2-electron integrals in AO basis¶
In atomic basis the two-electron integrals can be saved in Coulomb order or in Exchange order. The keywords for the two options are shown in the next table.
AO_PQRS |
- |
AO basis integrals in Coulomb order |
AO_PRQS |
- |
AO basis integrals in Exchange order |
7.58.3.4.6.2. 2-electron integrals in MO basis¶
In molecular basis, ORCA follows the accepted notation where by I,J,K and L we specify “internal” orbitals, meaning occupied in the reference wavefunction while by A,B,C and D we specify “external” orbitals, meaning orbitals that are empty in the reference wavefunction. With P,Q,R and S we specify all possible orbitals, meaning both “internal” and “external”. The available keywords in “orca_2json” for the two-electron integrals in the molecular basis are the ones shown in the table below:
MO_IJKL |
- |
Coulomb 0-external |
MO_IJKA |
- |
Coulomb 1-external |
MO_IJAB |
- |
Coulomb 2-external |
MO_IABC |
- |
Coulomb 3-external |
MO_ABCD |
- |
Coulomb 4-external |
MO_PQRS |
- |
Coulomb ALL integrals |
MO_IKJL |
- |
Exchange 0-external |
MO_IKJA |
- |
Exchange 1-external |
MO_IAJB |
- |
Exchange 2-external |
MO_IBAC |
- |
Exchange 3-external |
MO_ACBD |
- |
Exchange 4-external |
MO_PRQS |
- |
Exchange ALL integrals |
Example
{
"2elIntegrals":["MO_IJKL", "MO_ABCD"],
"Thresh": 1e-8
}
7.58.3.4.6.3. RI 2-electron integrals¶
Using the Resolution of Identity (RI) one can create the integrals in a more efficient way. There are two main categories of RI integrals: the 3-index integrals, where only only half of the transformation has taken place, and the 4-index integrlas where the integrals are totally transformed in the molecular basis. The notation of the integrals follows the one we just described for the two-electron integrals in the molecular basis.
RI_IJV |
- |
RI 3-index 0-external |
RI_IAV |
- |
RI 3-index 1-external |
RI_ABV |
- |
RI 3-index 2-external |
RI_IJKL |
- |
RI 4-index Coulomb 0-external |
RI_IJKA |
- |
RI 4-index Coulomb 1-external |
RI_IJAB |
- |
RI 4-index Coulomb 2-external |
RI_IABC |
- |
RI 4-index Coulomb 3-external |
RI_ABCD |
- |
RI 4-index Coulomb 4-external |
RI_IKJL |
- |
RI 4-index Exchange 0-external |
RI_IKJA |
- |
RI 4-index Exchange 1-external |
RI_IAJB |
- |
RI 4-index Exchange 2-external |
RI_IBAC |
- |
RI 4-index Exchange 3-external |
RI_ACBD |
- |
RI 4-index Exchange 4-external |
In addition to the integrals in case of RI integrals also the used RI Metric is available through the option Vaux:
Vaux |
- |
true/false |
Example
{
"2elIntegrals":["RI_IJKL", "RI_IJV"],
"Vaux":true
}
7.58.3.4.6.4. Full Integral Transformation¶
The full transformation integrals can be selected via the FullTrafo keyword.
FullTrafo |
- |
true/false |
7.58.3.4.6.5. More 2-electron integrals¶
Also the non-redundant 2-electron integrals are available for the RI and the nonRI case. Therefore the options 2elNonRedIntegrals or 2elNonRedRIIntegrals must be specified.
2elNonRedIntegrals |
- |
true/false |
2elNonRedRIIntegrals |
- |
true/false |
7.58.3.4.6.6. Orbital Windows, AuxBasisType and Threshold¶
The orbital window can either be selected automatically by the transformation routine or given by the user via the OrbWin keyword. The internal and external space (i0,i1,a0,a1) is defined via an integer list.
for example:
OrbWin |
- |
[0,8,9,15] |
- |
[0,12,13,30,0,12,13,30] |
The default AUX basis type is AuxC but can be changed with the keyword AuxBasisType. Please keep in mind that only those basis types used during the ORCA run can be selected.
AuxBasisType |
- |
AuxJ |
- |
AuxJK |
|
- |
AuxC |
To reduce the number of the integrals the keyword Thresh can be used to decrease the selected integrals to save disk space. This effects ONLY the printing and not the accuracy of the generated integrals. The default print threshold is 1.e-15.
Thresh |
- |
printout threshold (default 1.e-15) |
Example
{
"OrbWin": [0,7,8,85,0,0,0,0],
"Thresh": 1e-8,
"AuxBasisType": "AuxC",
"Vaux": true,
"2elIntegrals": ["RI_IJKL"]
}
7.58.3.5. TDDFT amplitude data (CIS/RPA)¶
The TDDFT amplitudes and root informations can be requested (no triplet information yet). The available options are:
CIS |
- |
TDDFT amplitudes |
CISNRoots |
- |
informations of all roots |
CISROOT |
- |
List of roots |
Example
{
"CIS": true,
"CISNRoots": false,
"CISRoot": [1,4,7,12]
}
Example
{
"CIS": true,
"CISNRoots": true
}
7.58.3.6. JSON Format¶
The JSON Format that is created can also be defined in the configuration file through the JSONFormats variable.
JSONFormats |
- |
JSON output format |
The available JSON formats are:
json |
- |
ASCII JSON format |
bson |
- |
binary JSON format |
ubjson |
- |
universal binary json format |
msgpck |
- |
MessagePack format |
Example
{
"JSONFormats":["json","bson","ubjson","msgpck"]
}
7.58.3.7. MO Coefficients¶
MOCoefficients |
- |
molecule orbital information (true\false) |
Example
{
"MOCoefficients": true
}
7.58.4. Import JSON data into ORCA¶
Some information like geometry, basis set and Molecular orbitals stored in the json format written by orca_2json can be used to create a new gbw-file to be specified as an orbital file in the orca input. The program is called as a standalone via command line.
orca_2json BaseName.json -gbw
7.58.4.1. Basic Information¶
In order to create a functional gbw-file the following information must be provided:
per Atom |
- |
Basis |
- |
Coords |
|
- |
ElementNumber |
|
- |
NuclearCharge |
|
per molecule |
- |
Charge |
- |
CoordinateUnits |
|
- |
HFTyp |
|
- |
Multiplicity |
|
- |
MolecularOrbitals |
NOTE
Please keep in mind that MolecularOrbitals is a composite of 2 different components, namely “EnergyUnit” and “MOs”. Then “MOs” contains “MOCoefficients”, “Occupancy”, “OrbitalEnergy”, “OrbitalSymLabel”* and “OrbitalSymmetry”*.
Example
The following file (let’s call it filename.json) is a json file for H_2 molecule with STO-3G basis set.
{
"Molecule": {
"Atoms": [
{"Basis": [
{"Coefficients": [ 0.1543289707029839,
0.5353281424384732,0.44463454202535485],
"Exponents": [3.42525091,0.62391373,0.1688554],
"Shell": "s"}],
"Coords": [0.0,0.0,0.0],
"ElementNumber": 1,
"NuclearCharge": 1.0},
{"Basis": [
{"Coefficients": [0.1543289707029839,
0.5353281424384732,0.44463454202535485],
"Exponents": [3.42525091,0.62391373,0.1688554],
"Shell": "s"}],
"Coords": [0.0,0.0,0.8],
"ElementNumber": 1,
"NuclearCharge": 1.0}],
"Charge": 0,
"CoordinateUnits": "Angs",
"HFTyp": "RHF",
"MolecularOrbitals": {
"EnergyUnit": "Eh",
"MOs": [{"MOCoefficients": [
-0.5554171364661243,-0.5554171364661241],
"Occupancy": 2.0,
"OrbitalEnergy": -0.5544958795933514,
"OrbitalSymLabel": "A",
"OrbitalSymmetry": 0},
{"MOCoefficients": [
-1.1482994800696493,1.1482994800696493],
"Occupancy": 0.0,
"OrbitalEnergy": 0.6126180830925017,
"OrbitalSymLabel": "A",
"OrbitalSymmetry": 0}]},
"Multiplicity": 1}
}
running then the command
orca_2json filename.json -gbw
should create a gbw file that ORCA can read.
7.58.4.2. Definition of the real solid harmonic Gaussian orbitals¶
When integrals over real solid harmonic Gaussian orbitals are issued into a JSON file, the precise definition of these orbitals becomes important. ORCA uses its own peculiar conventions for the arrangement and the phases of the individual components of the orbital shells.
The definitions of the angular parts of all shell components up to angular momentum \(k\) (\(\ell=8\)) are documented below. These correspond to the real solid harmonics \(S_{\ell,m}(x,y,z)\) that are normalized the following way:
\(R_\ell(r)\) is the common radial part of a shell with angular momentum \(\ell\) that consists of a specific basis set dependent linear combination of Gaussian primitives. It is normalized independently:
The factors \(r^2\) and \(\sin\vartheta\) in these integrals arise from the volume element in spherical polar coordinates: