.. _mrci:

***********************************************
Multireference configuration interaction (MRCI)
***********************************************

===========
Description
===========
Fully internally contracted multireference configuration interactions up to the two-electron excitation (MRCISD).
This is implemented with the automatical code generator SMITH3.
By default, the Davidson corrected (+Q) energy is also printed.

Title: ``smith``, method: ``mrci``

==================
Prerequisites
==================

A reference wavefunction generated by a :ref:`HF <hf>` or :ref:`CASSCF <casscf>` calculation.

========
Keywords
========
CASSCF keywords
---------------
See :ref:`casscf`.

SMITH keywords
--------------

The default values are recommended unless mentioned otherwise.

.. topic:: ``thresh``

   | **Description:** Convergence threshold.
   | **Datatype:** double precision
   | **Default:** 1.0e-8 (gradient) 1.0e-6 (otherwise)

.. topic:: ``thresh_overlap``

   | **Description:** Overlap threshold.
   | **Datatype:** double precision
   | **Default:** 1.0e-9

.. topic:: ``frozen``

   | **Description**: Freeze core orbitals. 
   | **Datatype**: bool
   | **Default**: true

.. topic:: ``ncore``

   | **Description:** Number of frozen core orbitals.
   | **Datatype:** int 
   | **Default:** If ``frozen`` is true, subvalence orbitals are frozen. If false, zero. 

.. topic:: ``nfrozenvirt``

   | **Description:** Number of frozen virtual orbitals.
   | **Datatype:** int
   | **Default:** 0

.. topic:: ``maxiter``

   | **Description:** Maximum number of iterations in MRCI calculations.
   | **Datatype:** int
   | **Default:** 50

.. topic:: ``maxtile``

   | **Description:** Maximum number of orbitals in a single data tile used in SMITH3.
   | **Datatype:** int
   | **Default:** 10

.. topic:: ``davidson_subspace``

   | **Description:**  Number of vectors retained in the limited-memory Davidson algorithm.
   | **Datatype:** int
   | **Default:** 10
   | **Recommendation:** Reduce if an insufficient amount of memory is available (do not reduce to a value lower than 3). 

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

.. code-block:: javascript

   { "bagel" : [ 
   
   {
     "title" : "molecule",
     "basis" : "svp",
     "df_basis" : "svp-jkfit",
     "angstrom" : true,
     "geometry" : [ 
        { "atom" : "O",  "xyz" : [   -0.000000,     -0.000000,      1.210000]},
        { "atom" : "O",  "xyz" : [   -0.000000,     -0.000000,      0.000000]}
     ]
   },
   
   {
     "title" : "casscf",
     "nclosed" : 7,
     "nact" : 2 
   },
   
   {
     "title" : "smith",
     "method" : "mrci"
   }
   
   ]}

from which one obtains

.. code-block:: javascript

    * freezing 2 orbitals
    * XMS rotation is only appropriate for CASPT2, and will not be used with mrci
       - MO integral evaluation                    0.01
    - linear dependency detected:    3 /    4    min eigenvalue:     0.0000e+00    max eigenvalue:     0.0000e+00
    - linear dependency detected:    3 /    4    min eigenvalue:    -3.9968e-15    max eigenvalue:    -1.1102e-15
    - linear dependency detected:    4 /    8    min eigenvalue:    -1.0380e-15    max eigenvalue:     2.9134e-15
    - linear dependency detected:    6 /    8    min eigenvalue:     0.0000e+00    max eigenvalue:     0.0000e+00
    - linear dependency detected:    6 /    8    min eigenvalue:    -1.2102e-15    max eigenvalue:     9.1101e-16
       - RDM + denominator evaluation              0.00

    * Zeroth order energy : state  0       -0.4388085255

      ---- iteration ----

        0   0  -149.74880423     0.00455295      0.06
        1   0  -149.76848791     0.00088584      0.06
        2   0  -149.76925804     0.00021094      0.06
        3   0  -149.76932381     0.00006783      0.07
        4   0  -149.76932906     0.00001772      0.07
        5   0  -149.76932932     0.00000337      0.06
        6   0  -149.76932933     0.00000065      0.07

      -------------------

       - MRCI energy evaluation                    0.46

        0   0  -149.80276480     0.00000000      0.00

       - MRCI+Q energy evaluation                  0.00

    * METHOD: SMITH                                0.48


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

Fully internally contracted MRCI itself is not particularly new.

BAGEL References
----------------

+---------------------------------------------------+-------------------------------------------------------------------------------------+
|          Description of Reference                 |                         Reference                                                   |
+===================================================+=====================================================================================+
| SMITH3                                            | M\. K. MacLeod and T. Shiozaki, J. Chem. Phys. **142**, 010507 (2015)               |
+---------------------------------------------------+-------------------------------------------------------------------------------------+
|  Relativistic extension                           | T\. Shiozaki and W. Mizukami, J. Chem. Theory Comput. **11**, 4733 (2015)           |
+---------------------------------------------------+-------------------------------------------------------------------------------------+

General References
------------------
+---------------------------------------------------+-------------------------------------------------------------------------------------+
|          Description of Reference                 |                         Reference                                                   |
+===================================================+=====================================================================================+
|  Fully internally contracted MRCI                 | H\.-J\. Werner and E.-A. Reinsch, J. Chem. Phys. **76**, 3144 (1982)                |
+---------------------------------------------------+-------------------------------------------------------------------------------------+
|  Modern implementation                            | M\. Saitow, Y. Kurashige, and T. Yanai, J. Chem. Phys. **139**, 044118 (2013)       |
+---------------------------------------------------+-------------------------------------------------------------------------------------+

