# cis

This module contains a CIS program.

## The user point of view

The cis program performs the CI of the ROHF-like + all single excitations on top of it. This program can be very useful to :

- Ground state calculations: generate a guess for the ground state wave function if one is not sure that the `scf()` program gave the lowest SCF solution. In combination with `save_natorb()` it can produce new MOs in order to reperform an `scf()` optimization.
- Excited states calculations: generate guess for all the `determinants n_states` wave functions, that will be used by the `fci()` program.

The main keywords/options to be used are:

- `determinants n_states` : number of states to consider for the CIS calculation
- `determinants s2_eig` : force all states to have the desired value of \(S^2\)
- `determinants expected_s2` : desired value of \(S^2\)

## The programmer point of view

This module have been built by setting the following rules:

- The only generator determinant is the Hartree-Fock (single-reference method)
- All generated singly excited determinants are included in the wave function (no perturbative selection)

These rules are set in the `H_apply.irp.f` file.

## EZFIO parameters

`energy```

  Variational CIS energy

## Programs

> - cis

## Subroutines / functions

`h_apply_cis:`()

  File : `h_apply.irp.f_shell_8`

      subroutine H_apply_cis()

  Calls H_apply on the HF determinant and selects all connected single and double excitations (of the same symmetry). Auto-generated by the `generate_h_apply` script.

  Needs:

  `psi_coef` `n_states` `generators_bitmask` `mo_num` `mo_two_e_integrals_in_map` | `h_apply_buffer_allocated` `n_det` `s2_eig` `n_det_generators` `i_bitmask_gen` | `n_int` `psi_det` `psi_det_generators` `psi_det_generators`

  Calls:

  `build_fock_tmp()` `copy_h_apply_buffer_to_wf()` `dsort()` | `h_apply_cis_diexc()` `h_apply_cis_monoexc()` | `make_s2_eigenfunction()` `wall_time()`

  Touches:

  `n_det` `psi_occ_pattern` `c0_weight` | `psi_coef` `psi_det_sorted_bit` `psi_det` | `psi_det_size` `psi_det_sorted_bit` `psi_occ_pattern`

`h_apply_cis_diexc:`()

  File : `h_apply.irp.f_shell_8`

      subroutine H_apply_cis_diexc(key_in, key_prev, hole_1,particl_1, hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in  )

  Needs:

  `n_int` | `n_det` | `mo_num`

  Called by:

  `h_apply_cis()` |  |

  Calls:

  `h_apply_cis_diexcp()` |  |

`h_apply_cis_diexcorg:`()

  File : `h_apply.irp.f_shell_8`

      subroutine H_apply_cis_diexcOrg(key_in,key_mask,hole_1,particl_1,hole_2, particl_2, fock_diag_tmp, i_generator, iproc_in  )

  Generate all double excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided.

  Needs:

  `n_int` | `elec_alpha_num` | `mo_num`

  Called by:

  `h_apply_cis_diexcp()` |  |

  Calls:

  `bitstring_to_list_ab()` | `fill_h_apply_buffer_no_selection()` |

`h_apply_cis_diexcp:`()

  File : `h_apply.irp.f_shell_8`

      subroutine H_apply_cis_diexcP(key_in, fs1, fh1, particl_1, fs2, fh2, particl_2, fock_diag_tmp, i_generator, iproc_in  )

  Needs:

  `n_int` | `n_det` | `mo_num`

  Called by:

  `h_apply_cis_diexc()` |  |

  Calls:

  `h_apply_cis_diexcorg()` |  |

`h_apply_cis_monoexc:`()

  File : `h_apply.irp.f_shell_8`

      subroutine H_apply_cis_monoexc(key_in, hole_1,particl_1,fock_diag_tmp,i_generator,iproc_in  )

  Generate all single excitations of key_in using the bit masks of holes and particles. Assume N_int is already provided.

  Needs:

  `n_int` | `elec_alpha_num` | `mo_num`

  Called by:

  `h_apply_cis()` |  |

  Calls:

  `bitstring_to_list_ab()` | `fill_h_apply_buffer_no_selection()` |