.. _rasci:

*********************************************************
Restricted active space configuration interaction (RASCI)
*********************************************************

===========
Description
===========

The Restricted Active Space (RAS) method constrains the types of excitations that generate the determinant space.
The user has to specify three "active" subspaces, R1, R2 and R3, which are three sets of orbitals,
with the maximium number of holes in R1 and the maximium number of electrons in R3.
These active spaces must be selected with caution.

==================
Prerequisites
==================
A reference wavefunction generated by a :ref:`hf` or :ref:`casscf` calculation.

============
Keywords
============
All of the keywords in FCI apply and are not duplicated in this section.

.. topic:: ``active``

   | **Description:** Specifies the three active spaces used to generate the functions in the CI expansion.
   | **Datatype:** Three arrays of integers. 
   | **Values:** Three arrays containing the indexes that specify the orbitals in the R1, R2, and R3 subspaces. 
   | **Default:** Must be specified. 

.. topic:: ``max_holes``

   | **Description:** Maximum number of particles in R1.
   | **Datatype:** int
   | **Default:** 0


.. topic:: ``max_particles``

   | **Description:** Maximum number of particles in R3.
   | **Datatype:** int
   | **Default:** 0

.. topic:: ``batchsize``

   | **Description:** Number of terms from the RASCI interaction to be evaluated simulataneously.
   | **Datatype:** int
   | **Default:** 512
   | **Recommendation:** Use default. 

=======
Example
=======

Below is a sample input for a RASCI calculation for the water molecule.
The first active space, R1, contains the oxygen 1s orbital; the second active space, R2, contains the 1a1, 1b1, 2a1, and 2b1 orbitals;
and the third active space, R3, contains the 3a1 and 2b2 antibonding orbitals.

Sample input
============

.. code-block:: javascript

 { "bagel" : [

 { "title" : "molecule",
   "basis" : "tzvpp",
   "df_basis" : "tzvpp-jkfit",
   "angstrom" : true,
   "geometry" : [
    { "atom" : "H", "xyz" : [ -0.22767998367, -0.82511994081,  -2.66609980874] },
    { "atom" : "O", "xyz" : [  0.18572998668, -0.14718998944,  -3.25788976629] },
    { "atom" : "H", "xyz" : [  0.03000999785,  0.71438994875,  -2.79590979943] }
  ]
 },

 {
  "title" : "hf",
  "thresh" : 1.0e-12
 },

 { "title" : "ras",
  "nstate" : 2,
  "active" : [ [1],
             [2, 3, 4, 5],
             [6, 7] ],
  "max_holes" : 1,
  "max_particles" : 2,
  "maxiter" : 10,
  "thresh" : 1.0e-7
 }
 ]}


from which one obtains

.. code-block:: javascript

     * ci vector   0, <S^2> = 0.0000, E =      -76.06133473
       2-2222-..     0.9989778414

     * ci vector   1, <S^2> = 0.0000, E =      -75.73609103
       2-222a-b.    -0.6985148618
       2-222b-a.    -0.6985148618
       2-2a2b-ab    -0.0695352914
       2-2b2a-ba    -0.0695352914
       2-2b2b-aa    -0.0513545763
       2-2a2a-bb    -0.0513545763
       2-22ab-2.    -0.0510585950
       2-22ba-2.    -0.0510585950

==========
References
==========

+-----------------------------------------------+---------------------------------------------------------------------+
|          Description of Reference             |                           Reference                                 |
+===============================================+=====================================================================+
| RASCI algorithm                               | J\. Olsen, B. O. Roos, P. Jorgensen, and H. J. A.-Jensen, J. Chem.  |
|                                               | Phys. **89**, 2185-2192 (1988).                                     |
+-----------------------------------------------+---------------------------------------------------------------------+


