qc2.algorithms.utils.active_space

Module containing active space helper functions.

Classes

ActiveSpace

A data class representing the active space.

Functions

get_active_space_idx(→ Tuple[numpy.ndarray, ...)

Calculates indices for occ, active, and virt orbitals in an active space.

Module Contents

qc2.algorithms.utils.active_space.get_active_space_idx(nao: int, nelectron: int | Tuple[int, int], n_active_orbitals: int, n_active_electrons: int | Tuple[int, int]) Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray][source]

Calculates indices for occ, active, and virt orbitals in an active space.

Parameters:
  • nao (int) – Total number of atomic orbitals.

  • nelectron (Union[int, Tuple[int, int]]) – A list representing the number of electrons in each atom.

  • n_active_orbitals (int) – Number of orbitals in the active space.

  • n_active_electrons (Union[int, Tuple[int, int]]) – A list representing the number of active electrons in each atom.

Returns:

Three numpy arrays representing the indices of occupied, active, and virtual orbitals, respectively.

Return type:

Tuple[np.ndarray, np.ndarray, np.ndarray]

Raises:

ValueError – If the number of core electrons is odd.

class qc2.algorithms.utils.active_space.ActiveSpace[source]

A data class representing the active space.

num_active_electrons: tuple[int, int][source]
num_active_spatial_orbitals: int[source]