-
Notifications
You must be signed in to change notification settings - Fork 475
openorbitaloptimizer #3136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openorbitaloptimizer #3136
Conversation
|
Can you rebase the branch @loriab |
jturney
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far!
doc/sphinxman/source/ooo.rst
Outdated
|
|
||
| * The conda package is (for the C++ interface) a header-only library. | ||
|
|
||
| * If using the |PSIfour| binary, OpenOrbitalOptimizer has already been compiled in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Unix at least. There are some Windows build complications that I haven't faced yet.
| BUILD_COMMAND "" | ||
| BUILD_IN_SOURCE 1 | ||
| # master: INSTALL_COMMAND ${Python_EXECUTABLE} -m pip install git+https://github.com/MolSSI/QCManyBody.git#egg=proj | ||
| # master: INSTALL_COMMAND ${Python_EXECUTABLE} -m pip install git+https://github.com/MolSSI/ QCManyBody.git#egg=proj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| # master: INSTALL_COMMAND ${Python_EXECUTABLE} -m pip install git+https://github.com/MolSSI/ QCManyBody.git#egg=proj | |
| # master: INSTALL_COMMAND ${Python_EXECUTABLE} -m pip install git+https://github.com/MolSSI/QCManyBody.git#egg=proj |
psi4/src/psi4/libscf_solver/rhf.cc
Outdated
| #ifdef USING_LAPACK_MKL | ||
| #include <mkl.h> | ||
| #define ARMA_USE_MKL | ||
| #define ARMA_USE_MKL_TYPES | ||
| #endif | ||
| #define ARMA_DONT_USE_FORTRAN_HIDDEN_ARGS | ||
| #define ARMA_DONT_USE_WRAPPER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already done by the psi4/libmints/matrix.h include, no? no need to duplicate the logic here
| if (iteration_ == options_.get_int("MAXITER")) | ||
| printf("%d = |%e| < %e && %e < %e\n", converged, e_delta, e_conv, d_rms, d_conv); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly, no, it's a violation of expected printing location. But practically there's a lot of can't reach convcrit, variation upon repeat, and not all CI modes show the output file, so it's very helpful to have the final line, and it only triggers when the SCF fails.
| if(nalphapi_[h]>0) | ||
| occupations[h].subvec(0,nalphapi_[h]-1).ones(); | ||
| occupations[h] *= 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be generalized to the case of input fractional occupations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added to list
| // We hope that the occupations are integer... | ||
| arma::uvec nonzero(arma::find(occupations[h]>0.0)); | ||
| double diff(arma::norm(occupations[h](nonzero)-2*arma::ones<arma::vec>(nonzero.n_elem),2)); | ||
| if(diff!=0.0) { | ||
| fprintf(stderr,"Non-integer occupations in symmetry block %i\n",h); | ||
| occupations[h].print("occs"); // stdout | ||
| } | ||
| nalphapi_[h] = (int) nonzero.n_elem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fractional occupation logic should be also fixed here
psi4/src/psi4/libscf_solver/sad.cc
Outdated
| #ifdef USING_OpenOrbitalOptimizer | ||
| #ifdef USING_LAPACK_MKL | ||
| #include <mkl.h> | ||
| #define ARMA_USE_MKL | ||
| #define ARMA_USE_MKL_TYPES | ||
| #endif | ||
| #define ARMA_DONT_USE_FORTRAN_HIDDEN_ARGS | ||
| #define ARMA_DONT_USE_WRAPPER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include the matrix header instead instead of duplicating the definitions here
psi4/src/psi4/libscf_solver/sad.cc
Outdated
| auto ints_tolerance_changed = Process::environment.options.use_local(ints_tolerance_key).has_changed(); | ||
| Process::environment.options.set_double("SCF", ints_tolerance_key, 0.0); | ||
|
|
||
| // set_jk(jk); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be dropped altogether?
psi4/src/psi4/libscf_solver/sad.cc
Outdated
|
|
||
| // Setup JK | ||
| std::unique_ptr<JK> jk; | ||
| // std::unique_ptr<JK> jk; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be dropped altogether?
psi4/src/psi4/libscf_solver/sad.cc
Outdated
| psi_C->set(ii, jj, Cp2(ii, jj)); | ||
| } | ||
| } | ||
| // TODO: Build Fock matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // TODO: Build Fock matrix | |
| // Build Fock matrix |
| // TODO save the energies (elements of E_occ) and orbitals (C_occ) and density (P_AO) onto the Chuckel object. but need to resize Chuckel & Ehuckel & density one (sq; atomic_D elsewhere; D (3rd to last) in this fn) | ||
|
|
||
| for(int i=0; i<nbf; i++) | ||
| for(int j=0; j<nbf; j++) | ||
| D->set(i, j, P_AO(i,j)); // /2 | ||
|
|
||
| #if 0 | ||
| // Copy Huckel coefficients and energies | ||
| double** Coccp = Chuckel->pointer(); | ||
| double** Cp = Ca->pointer(); | ||
| for (int i = 0; i < nbf; i++) { | ||
| C_DCOPY(occ_a->dim(), Cp[i], 1, Coccp[i], 1); | ||
| } | ||
| double* Eoccp = Ehuckel->pointer(); | ||
| double* Ep = Ea->pointer(); | ||
| for (int i = 0; i < occ_a->dim(); i++) { | ||
| Eoccp[i] = Ep[i]; | ||
| } | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one should check that the huckel guess works with OOO
psi4/src/psi4/libscf_solver/sad.h
Outdated
| #ifdef USING_OpenOrbitalOptimizer | ||
| #ifdef USING_LAPACK_MKL | ||
| #include <mkl.h> | ||
| #define ARMA_USE_MKL | ||
| #define ARMA_USE_MKL_TYPES | ||
| #endif | ||
| #define ARMA_DONT_USE_FORTRAN_HIDDEN_ARGS | ||
| #define ARMA_DONT_USE_WRAPPER | ||
| #include <armadillo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include the matrix header
psi4/src/psi4/libscf_solver/sad.h
Outdated
| void form_D(); | ||
| void form_C(); | ||
|
|
||
| //void set_jk(std::unique_ptr<JK> & jkin) { jk = jkin; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop this?
psi4/src/psi4/libscf_solver/uhf.cc
Outdated
| #ifdef USING_OpenOrbitalOptimizer | ||
| #ifdef USING_LAPACK_MKL | ||
| #include <mkl.h> | ||
| #define ARMA_USE_MKL | ||
| #define ARMA_USE_MKL_TYPES | ||
| #endif | ||
| #define ARMA_DONT_USE_FORTRAN_HIDDEN_ARGS | ||
| #define ARMA_DONT_USE_WRAPPER |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include the matrix header
Description
Implements OpenOrbitalOptimizer support in Psi4.
User API & Changelog headlines
Dev notes & details
TODO (some need pyooo)
Col::subvec(): indices out of bounds or incorrectly used(mints10, pywrap-all, weird_bases)Checklist
Status