You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this PR:
We added UHF examples in 'molecular_hamiltonians.rst',
'generate_molecular_hamiltonians.py'
This part of the doc covers the new update of UHF in #309
The CUDA-Q Solvers library accelerates a wide range of applications in the domain of quantum chemistry.
5
-
To facilitate these calculations, CUDA-Q Solvers provides the `solver.create_molecule` function to allow users to generate basis sets and Hamiltonians for many systems of interest.
6
-
The molecule class contains basis set informations, and the Hamiltonian (`molecule.hamiltonian`) for the target systems.
5
+
To facilitate these calculations, CUDA-Q Solvers provides the `solver.create_molecule` function to allow users to generate the electronic Hamiltonians for many systems of interest.
6
+
The molecule class contains informations about the Hamiltonian (`molecule.hamiltonian`) for the target systems.
7
7
These Hamiltonians can then be used as input into the hybrid quantum-classical solvers that the CUDA-Q Solvers API provides.
8
8
9
9
10
10
Molecular Orbitals and Hamiltonians
11
11
+++++++++++++++++++++++++++++++++++
12
12
13
-
First we define the atomic geometry of the molecule by specifying a array of atomic symbols as strings, and coordinates in 3D space. We then get a molecule object from the `solvers.create_molecule` call.
14
-
Here we create "default" Hamiltonian for the N2 system using complete active space molecular orbitals constructed from Hartree-Fock atomic orbitals.
13
+
First, we define the atomic geometry of the molecule by specifying an array of atomic symbols as strings, and coordinates in 3D space. We then get a molecule object from the `solvers.create_molecule` call.
14
+
Here, we create "default" Hamiltonian for the N2 system using complete active space molecular orbitals constructed from Restricted Hartree-Fock molecular orbitals.
15
15
16
16
.. tab:: Python
17
17
@@ -27,15 +27,32 @@ Here we create "default" Hamiltonian for the N2 system using complete active spa
27
27
verbose=True)
28
28
29
29
We specify:
30
-
- The geometry previously created
31
-
- The single particle basis set (here STO-3G)
32
-
- The total spin
30
+
- The geometry previously created. User can also provide geometry through the path to the XYZ file. For example, `geometry='path/to/xyz/file.xyz'`.
31
+
- The basis set (here STO-3G)
32
+
- The total spin (2 * S)
33
33
- The total charge
34
34
- The number of electrons in the complete active space
35
-
- The number of orbitals in the complete activate space
35
+
- The number of orbitals in the complete active space
36
36
- A verbosity flag to help introspect on the data what was generated.
37
37
38
-
Along with the orbitals and Hamiltonian, we can also view various properties like the Hartree-Fock energy, and the energy of the frozen core orbitals by printing `molecule.energies`.
38
+
Along with the Hamiltonian, we can also view various properties like the Hartree-Fock energy, and the energy of the frozen core orbitals by printing `molecule.energies`.
39
+
40
+
For using Unrestricted Hartree-Fock (UHF) orbitals, user can set the `UR` parameter to `True` in the `create_molecule` function. Here's an example:
@@ -56,12 +73,15 @@ Now we take our same N2 molecule, but generate natural orbitals from second orde
56
73
integrals_natorb=True,
57
74
verbose=True)
58
75
59
-
Note that we use the same API but,toggle `MP2=True` and `integrals_natorb=True`.
76
+
Note that we use the same API but,toggle `MP2=True` and `integrals_natorb=True`. This will generate the molecular orbitals from MP2 natural orbitals, and compute the Hamiltonian integrals in this basis.
77
+
This option is not yet available when using `UR=True`. When using `UR=True`, only UHF molecular orbitals are employed to generate the electronic Hamiltonian.
60
78
61
79
CASSCF Orbitals
62
80
+++++++++++++++
63
81
64
-
Next, we can start from either Hartree-Fock or perturbation theory atomic orbitals and build complete active space self-consistent field (CASSCF) molecular orbitals.
82
+
Next, we can start from either Hartree-Fock or perturbation theory natural orbitals and build complete active space self-consistent field (CASSCF) molecular orbitals.
83
+
84
+
In the example below, we employ the CASSCF procedure starting from RHF molecular orbitals to generate the spin molecular Hamiltonian.
65
85
66
86
.. tab:: Python
67
87
@@ -78,7 +98,8 @@ Next, we can start from either Hartree-Fock or perturbation theory atomic orbita
78
98
integrals_casscf=True,
79
99
verbose=True)
80
100
81
-
For Hartree-Fock, or
101
+
Alternatively, we can also start from RHF, then MP2 natural orbitals and then perform CASSCF to generate the spin molecular Hamiltonian.
102
+
In this case, natural orbitals from MP2 are used to set the active space for the CASSCF procedure.
82
103
83
104
.. tab:: Python
84
105
@@ -97,7 +118,42 @@ For Hartree-Fock, or
97
118
integrals_casscf=True,
98
119
verbose=True)
99
120
100
-
for MP2. In these cases, printing the `molecule.energies` also shows the `R-CASSCF` energy for the system.
121
+
In these cases, printing the `molecule.energies` also shows the `R-CASSCF` energy for the system.
101
122
102
-
Now that we have seen how to generate basis sets and Hamiltonians for quantum chemistry systems, we can use these as inputs to hybrid quantum-classical methods like VQE or adapt VQE via the CUDA-Q Solvers API.
103
123
124
+
For open-shell systems
125
+
++++++++++++++++++++++++++
126
+
127
+
For Restricted Open-shell Hartree-Fock (ROHF) orbitals, user can set the `spin` parameter to a non-zero value while keeping the `charge` parameter as needed. For example, for a molecule with one unpaired electron, you can set `spin=1` and `charge=1`. Here's an example:
For Unrestricted Hartree-Fock (UHF) orbitals, user can set `UR=True` and the `spin` parameter to a non-zero value while keeping the `charge` parameter as needed. Here's an example:
Now that we have seen how to generate the spin molecular Hamiltonians for quantum chemistry systems, we can use these as inputs to hybrid quantum-classical methods like VQE or adapt VQE via the CUDA-Q Solvers API.
0 commit comments