evangelistalab / forte

http://www.evangelistalab.org
GNU Lesser General Public License v3.0
50 stars 28 forks source link

Grand unification plan #35

Open fevangelista opened 7 years ago

fevangelista commented 7 years ago

Use polymorphism to encode different combinations of theories.

   // 1.
   SharedActiveSpaceSolver solver = build_active_space_solver(options.get_str("CAS_TYPE"));
   solver->compute_energy();
   auto references = solver->build_reference({0,1});
   code to average reference1 and reference2

   // 2. For all (h,S,M_S) or just one?
   SharedActiveSpaceSolver solver = build_active_space_solver(options.get_str("CAS_TYPE"));
   solver->set_states({2},{1,1}); // two states each with weight = 1
   solver->do_average(true);
   solver->compute_energy();
   auto reference = solver->reference();

   SemiCanonical semi(ref_wfn, options, ints, mo_space_info);
   semi.semicanonicalize(reference);
   auto cm = std::make_shared<CorrelationMethod>(ref_wfn, options, ints,mo_space_info,reference));
   cm->compute_energy();
jeffschriber commented 7 years ago

I have a few thoughts on how to decouple the integrals from the determinant class. It would require every CI code to commit to the WFNOperator class, but I think it makes sense. It could look something like:

    // Build a determinant in the active space and compute its energy
    WFNOperator active_op( ints_, active_symmetry_ );
    STLBitsetDeterminant a_det1( occupation );
    active_op.energy( a_det1 );

   // Slater Rules would look like this
    double sign = active_op.slater_rules_single_alpha( a_det1, i, a );
    STLBitsetDeterminant a_det2( occupation2 );
    double en = active_op.slater_rules( a_det1, a_det2 );

   // Now we can easily make detereminants with different dimensions
   WFNOperator corr_op( ints_, correlated_sym );
   STLBitsetDeterminant c_det( occ );
   corr_op.energy( c_det );   

It would be up to us to avoid things like:

    corr_op.energy( a_det );
fevangelista commented 7 years ago

Solution with multiple FCIIntegral objects

    // Build a determinant in the active space and compute its energy
    FCIIntegrals fciints(ints_,active_mo,rdocc_mo); // only active
    FCIIntegrals fciints2(ints_,active_mo2,rdocc_mo2); // docc + active + virt
    STLBitsetDeterminant det = fciints->determinant();
    STLBitsetDeterminant det2 = fciints2->determinant();
    STLBitsetDeterminant det3;
    // map det -> det2.     20++0  -> 2222 20++0 00000
   fciints->energy(det2);
lcyyork commented 7 years ago

Here are the workflows of SS- and SA-DSRG. I will start implementing those TODOs in semicanonicalize class and integrating the DSRG codes with a SuperDSRG class. 758acd39-32b0-4a00-a0b6-fb8dbcea86ad-1-2048x1536-oriented 3451858d-96fa-4ea6-8ac0-da953f93b097-1-2048x1536-oriented a951fa15-e34c-4977-a38d-5629a26a6a24-1-2048x1536-oriented