Skip to content

Commit

Permalink
fix typos, add todos and edit examples
Browse files Browse the repository at this point in the history
  • Loading branch information
tjira committed Apr 24, 2024
1 parent 4380d71 commit 1e9db1f
Show file tree
Hide file tree
Showing 35 changed files with 91 additions and 34 deletions.
2 changes: 2 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TODO List

- [ ] Split the model solver types into different objects in inputs
- [ ] Make the method field for BAGEL actually work
- [x] Add BAGEL interface with excited state dynamics
- [x] Add Hermitian FFT for spectra calculation
- [x] Add Mulliken analysis
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/configurationinteraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Configuration interaction (CI) is a post-Hartree-Fock, utilizing a linear variat
Let's consider the restricted version of the Full Configuration Interaction (FCI) method, which considers all possible electronic configurations within a given basis set. The FCI wave function is expressed as a linear combination of Slater determinants, where each determinant represents a unique electron configuration. The FCI method provides the most accurate description of the electronic structure, but its computational cost grows exponentially with the number of electrons and basis functions, making it infeasible for large systems.

### The Transformation of Integrals to Molecular Spinorbital Basis
To begin, we need to convert the coefficient matrix $\mathbf{C}$ into the basis of molecular spinorbitals (MS), as this matrix is essential for later transformations of the core Hamiltonian and the Coulomb integrals. Let the number of spatial basis functions be denoted as $n$. The coefficient matrix in the MS basis will then be of dimension $2n \times 2n$, to incorporate the electron spin. In this transformation, each column (orbital) is duplicated and vertically concatenated with itself. The corresponding segments are then zeroed out to respect the Pauli exclusion principle. This is done mathematically using the tiling matrix $\mathbf{P}_{n \times 2n}$, defined as
To begin, we need to convert the coefficient matrix $\mathbf{C}$ into the basis of molecular spinorbitals (MS), as this matrix is essential for later transformations of the core Hamiltonian and the Coulomb integrals. Let the number of spatial basis functions be denoted as $n$. The coefficient matrix in the MS basis will then be of dimension $2n \times 2n$, to incorporate the electron spin. In this transformation, each column (orbital) is duplicated and the result is vertically concatenated with itself. The corresponding segments are then zeroed out to respect the Pauli exclusion principle. This is done mathematically using the tiling matrix $\mathbf{P}_{n \times 2n}$, defined as

\begin{equation}
\mathbf{P}=\begin{pmatrix}e_1&e_1&e_2&e_2&\dots&e_n&e_n\end{pmatrix}
Expand Down Expand Up @@ -83,7 +83,7 @@ The summations extend over all orbitals common between the two compared determin
{:.warning}
> To accurately calculate the differences between two Slater determinants, it's essential to sometimes permute the indices of one determinant for proper alignment before comparison. For instance, consider two determinants, $D_1=\\{1,2,3,4\\}$ and $D_2=\\{1,3,2,4\\}$. To properly compare $D_2$ with $D_1$, you need to permute the indices in $D_2$ to match $D_1$, resulting in $D_2$ being reorganized as $\\{1,2,3,4\\}$. In this case, the number of differences after proper alignment is 0.
>
> Moreover, it’s crucial to remember that each permutation of the orbitals alters the sign of the determinant. Therefore, when computing the matrix elements, this change must be accounted for by multiplying the result by $(−1)^p$, where $p$ is the number of permutations made to align the determinants. This factor is vital for ensuring the correct and sign of the matrix elements, which can significantly impact the results of quantum mechanical calculations.
> Moreover, it’s crucial to remember that each permutation of the orbitals alters the sign of the determinant. Therefore, when computing the matrix elements, this change must be accounted for by multiplying the result by $(−1)^p$, where $p$ is the number of permutations made to align the determinants. This factor is vital for ensuring the correct sign of the matrix elements, which can significantly impact the results of quantum mechanical calculations.
>
> This requirement for alignment and sign adjustment adds complexity to the implementation, as each comparison between determinants not only involves checking for differences but also finding the minimal number of permutations needed for alignment.
Expand Down
3 changes: 2 additions & 1 deletion example/input/ad1d.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"potential" : [["0.5*x^2"]],
"variables" : ["x"],
"limits" : [-16, 16],
"ngrid" : 1024
"ngrid" : 1024,
"mass" : 1
},
"solve" : {
"dynamics" : {
Expand Down
8 changes: 4 additions & 4 deletions example/input/bagel_dyn.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
},
"bagel" : {
"interface" : "../../interface/bagel-gradient.sh",
"method" : "CASSCF(4, 2)",
"nstate" : 3,
"state" : 2,
"dynamics" : {
"iters" : 100,
"step" : 20
},
"method" : "CASSCF(4, 2)",
"nstate" : 3,
"state" : 2
}
}
}
8 changes: 4 additions & 4 deletions example/input/bagel_dyn_thermo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
},
"bagel" : {
"interface" : "../../interface/bagel-gradient-casscf.sh",
"method" : "CASSCF(4, 2)",
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20,
"berendsen" : {
"temp" : 298.15
}
},
"method" : "CASSCF(4, 2)",
"nstate" : 3,
"state" : 1
}
}
}
7 changes: 5 additions & 2 deletions example/input/qad1d_imag.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"potential" : [["0.5*x^2"]],
"variables" : ["x"],
"limits" : [-16, 16],
"ngrid" : 1024
"ngrid" : 1024,
"mass" : 1
},
"solve" : {
"guess" : "exp(-(x-1)^2)",
"real" : false,
"nstate" : 3,
"guess" : "exp(-(x-1)^2)",
"step" : 0.1,
"iters" : 1000,
"savewfn" : true
}
}
8 changes: 6 additions & 2 deletions example/input/qad1d_real.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
"potential" : [["0.5*x^2"]],
"variables" : ["x"],
"limits" : [-16, 16],
"ngrid" : 1024
"ngrid" : 1024,
"mass" : 1
},
"solve" : {
"guess" : "exp(-(x-1)^2)",
"real" : true,
"nstate" : 1,
"guess" : "exp(-(x-1)^2)",
"step" : 0.1,
"iters" : 1000,
"spectrum" : {},
"savewfn" : true
}
Expand Down
7 changes: 5 additions & 2 deletions example/input/qad2d_imag.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"potential" : [["0.5*(x^2+y^2)"]],
"variables" : ["x", "y"],
"limits" : [-16, 16],
"ngrid" : 256
"ngrid" : 256,
"mass" : 1
},
"solve" : {
"guess" : "exp(-(x^2+y^2))",
"real" : false,
"nstate" : 3,
"guess" : "exp(-(x^2+y^2))",
"step" : 0.1,
"iters" : 1000,
"savewfn" : true
}
}
8 changes: 6 additions & 2 deletions example/input/qad2d_real.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
"potential" : [["0.5*(x^2+y^2)"]],
"variables" : ["x", "y"],
"limits" : [-16, 16],
"ngrid" : 256
"ngrid" : 256,
"mass" : 1
},
"solve" : {
"guess" : "exp(-(x^2+y^2))",
"real" : true,
"nstate" : 1,
"guess" : "exp(-(x^2+y^2))",
"step" : 0.1,
"iters" : 1000,
"spectrum" : {},
"savewfn" : true
}
Expand Down
4 changes: 3 additions & 1 deletion example/input/rcid.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
},
"rhf" : {},
"rci" : {
"excitations" : [2]
"excitations" : [2],
"nstate" : 3,
"state" : 1
}
}
2 changes: 2 additions & 0 deletions example/input/rcid_dyn.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [2],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcid_dyn_thermo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [2],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20,
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcid_grad.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [2],
"nstate" : 3,
"state" : 1,
"gradient" : {
"step" : 1e-5
}
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcid_hess.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [2],
"nstate" : 3,
"state" : 1,
"hessian" : {
"step" : 1e-5
}
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcis.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"rhf" : {},
"rci" : {
"excitations" : [1]
"nstate" : 3,
"state" : 1
}
}
2 changes: 2 additions & 0 deletions example/input/rcis_dyn.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcis_dyn_thermo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20,
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcis_grad.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1],
"nstate" : 3,
"state" : 1,
"gradient" : {
"step" : 1e-5
}
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcis_hess.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1],
"nstate" : 3,
"state" : 1,
"hessian" : {
"step" : 1e-5
}
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcisd.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
"rhf" : {},
"rci" : {
"excitations" : [1, 2]
"nstate" : 3,
"state" : 1
}
}
2 changes: 2 additions & 0 deletions example/input/rcisd_dyn.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1, 2],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcisd_dyn_thermo.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1, 2],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20,
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcisd_grad.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1, 2],
"nstate" : 3,
"state" : 1,
"gradient" : {
"step" : 1e-5
}
Expand Down
2 changes: 2 additions & 0 deletions example/input/rcisd_hess.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"rhf" : {},
"rci" : {
"excitations" : [1, 2],
"nstate" : 3,
"state" : 1,
"hessian" : {
"step" : 1e-5
}
Expand Down
6 changes: 5 additions & 1 deletion example/input/rfci.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@
"basis" : "sto-3g"
},
"rhf" : {},
"rci" : {}
"rci" : {
"excitations" : [],
"nstate" : 3,
"state" : 1
}
}
3 changes: 3 additions & 0 deletions example/input/rfci_dyn.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
},
"rhf" : {},
"rci" : {
"excitations" : [],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20
Expand Down
3 changes: 3 additions & 0 deletions example/input/rfci_dyn_thermo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
},
"rhf" : {},
"rci" : {
"excitations" : [],
"nstate" : 3,
"state" : 1,
"dynamics" : {
"iters" : 100,
"step" : 20,
Expand Down
3 changes: 3 additions & 0 deletions example/input/rfci_grad.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
},
"rhf" : {},
"rci" : {
"excitations" : [],
"nstate" : 3,
"state" : 1,
"gradient" : {
"step" : 1e-5
}
Expand Down
3 changes: 3 additions & 0 deletions example/input/rfci_hess.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
},
"rhf" : {},
"rci" : {
"excitations" : [],
"nstate" : 3,
"state" : 1,
"hessian" : {
"step" : 1e-5
}
Expand Down
4 changes: 3 additions & 1 deletion example/input/rmp2.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"basis" : "sto-3g"
},
"rhf" : {},
"rmp" : {}
"rmp" : {
"order" : 2
}
}
1 change: 1 addition & 0 deletions example/input/rmp2_dyn.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"rhf" : {},
"rmp" : {
"order" : 2,
"dynamics" : {
"iters" : 100,
"step" : 20
Expand Down
1 change: 1 addition & 0 deletions example/input/rmp2_dyn_thermo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"rhf" : {},
"rmp" : {
"order" : 2,
"dynamics" : {
"iters" : 100,
"step" : 20,
Expand Down
1 change: 1 addition & 0 deletions example/input/rmp2_grad.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"rhf" : {},
"rmp" : {
"order" : 2,
"gradient" : {
"step" : 1e-5
}
Expand Down
1 change: 1 addition & 0 deletions example/input/rmp2_hess.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"rhf" : {},
"rmp" : {
"order" : 2,
"hessian" : {
"step" : 1e-5
}
Expand Down
Loading

0 comments on commit 1e9db1f

Please sign in to comment.