forte2._forte2 ============== .. py:module:: forte2._forte2 Module Contents --------------- .. py:class:: CIStrings(na: int, nb: int, symmetry: int, orbital_symmetry: collections.abc.Sequence[collections.abc.Sequence[int]], gas_min: collections.abc.Sequence[int], gas_max: collections.abc.Sequence[int]) .. py:property:: alfa_address :type: std::__1::shared_ptr .. py:property:: na :type: int .. py:property:: nb :type: int .. py:property:: symmetry :type: int .. py:property:: nas :type: int .. py:property:: nbs :type: int .. py:property:: ndet :type: int .. py:property:: ngas_spaces :type: int .. py:property:: gas_size :type: list[int] .. py:property:: gas_alfa_occupations :type: list[list[int]] .. py:property:: gas_beta_occupations :type: list[list[int]] .. py:property:: gas_occupations :type: list[tuple[int, int]] .. py:method:: determinant(address: int) -> Determinant .. py:method:: determinant_index(d: Determinant) -> int .. py:method:: make_determinants() -> list[Determinant] .. py:class:: CISigmaBuilder(lists: CIStrings, E: float, H: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))], V: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))], log_level: int = 3) .. py:method:: set_algorithm(algorithm: str) -> None Set the sigma build algorithm (options = kh, hz) .. !! processed by numpydoc !! .. py:method:: get_algorithm() -> str Get the current sigma build algorithm .. !! processed by numpydoc !! .. py:method:: set_memory(memory: int) -> None Set the memory limit for the builder (in MB) .. !! processed by numpydoc !! .. py:method:: form_Hdiag_csf(dets: collections.abc.Sequence[Determinant], spin_adapter: CISpinAdapter, spin_adapt_full_preconditioner: bool = False) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)] .. py:method:: energy_csf(dets: collections.abc.Sequence[Determinant], spin_adapter: CISpinAdapter, I: int) -> float Compute the energy of a CSF .. !! processed by numpydoc !! .. py:method:: form_H_csf(dets: collections.abc.Sequence[Determinant], spin_adapter: CISpinAdapter) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Form the full Hamiltonian matrix in the CSF basis .. !! processed by numpydoc !! .. py:method:: slater_rules_csf(dets: collections.abc.Sequence[Determinant], spin_adapter: CISpinAdapter, I: int, J: int) -> float .. py:method:: Hamiltonian(basis: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], sigma: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> None .. py:method:: sf_1rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the spin-free one-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: sf_2rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the spin-free two-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: sf_3rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None, None, None))] Compute the spin-free three-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: sf_2cumulant(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the spin-free two-electron cumulant .. !! processed by numpydoc !! .. py:method:: sf_3cumulant(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None, None, None))] Compute the spin-free three-electron cumulant .. !! processed by numpydoc !! .. py:method:: a_1rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the alpha one-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: b_1rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the beta one-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: aa_2rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the alpha-alpha two-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: bb_2rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the beta-beta two-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: ab_2rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the alpha-beta two-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: aaa_3rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the alpha-alpha-alpha three-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: aab_3rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the alpha-alpha-beta three-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: abb_3rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the alpha-beta-beta three-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: bbb_3rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the beta-beta-beta three-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: avg_build_time() -> list[float] .. py:method:: set_log_level(level: int) -> None Set the logging level for the class .. !! processed by numpydoc !! .. py:method:: a_1rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], alfa: bool) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] .. py:method:: aa_2rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], alfa: bool) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the two-electron same-spin reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: ab_2rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the two-electron mixed-spin reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: aaa_3rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], alfa: bool) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the three-electron same-spin reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: aab_3rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the aab mixed-spin three-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: abb_3rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the abb mixed-spin three-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: aaaa_4rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], alfa: bool) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the four-electron same-spin reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: aaab_4rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the aaab mixed-spin four-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: aabb_4rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the aabb mixed-spin four-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: abbb_4rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the abbb mixed-spin four-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: sf_1rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))] Compute the spin-free one-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: sf_2rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the spin-free two-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: sf_3rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None, None, None))] Compute the spin-free three-electron reduced density matrix for debugging purposes .. !! processed by numpydoc !! .. py:method:: sf_2cumulant_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))] Compute the spin-free two-electron cumulant for debugging purposes .. !! processed by numpydoc !! .. py:method:: sf_3cumulant_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None, None, None))] Compute the spin-free three-electron cumulant for debugging purposes .. !! processed by numpydoc !! .. py:class:: RelCISigmaBuilder(lists: CIStrings, E: float, H: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None))], V: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None))], log_level: int = 3) .. py:method:: set_algorithm(algorithm: str) -> None Set the sigma build algorithm (options = kh, hz) .. !! processed by numpydoc !! .. py:method:: get_algorithm() -> str Get the current sigma build algorithm .. !! processed by numpydoc !! .. py:method:: set_memory(memory: int) -> None Set the memory limit for the builder (in MB) .. !! processed by numpydoc !! .. py:method:: form_Hdiag(dets: collections.abc.Sequence[Determinant]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)] .. py:method:: slater_rules(dets: collections.abc.Sequence[Determinant], I: int, J: int) -> complex .. py:method:: Hamiltonian(basis: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], sigma: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> None .. py:method:: so_1rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None))] Compute the spin-orbital one-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: so_2rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None))] Compute the spin-orbital two-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: so_2cumulant(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None))] Compute the spin-orbital two-electron cumulant .. !! processed by numpydoc !! .. py:method:: so_3rdm(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None, None, None))] Compute the spin-orbital three-electron reduced density matrix .. !! processed by numpydoc !! .. py:method:: so_3cumulant(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None, None, None))] Compute the spin-orbital three-electron cumulant .. !! processed by numpydoc !! .. py:method:: so_1rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None))] .. py:method:: so_2rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None))] .. py:method:: so_3rdm_debug(C_left: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)], C_right: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=None)]) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None, None, None))] .. py:class:: CISpinAdapter(twoS: int, twoMs: int, norb: int) .. py:method:: prepare_couplings(dets: collections.abc.Sequence[Determinant]) -> None .. py:method:: csf_C_to_det_C(csf_C: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], det_C: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> None .. py:method:: det_C_to_csf_C(det_C: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)], csf_C: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=None)]) -> None .. py:method:: ncsf() -> int .. py:method:: set_log_level(level: int) -> None Set the logging level for the class .. !! processed by numpydoc !! .. py:class:: Determinant(arg: Determinant) Determinant(arg: str, /) .. py:method:: zero() -> Determinant :staticmethod: .. py:method:: set_na(arg0: int, arg1: bool, /) -> None .. py:method:: set_nb(arg0: int, arg1: bool, /) -> None .. py:method:: na(arg: int, /) -> bool .. py:method:: nb(arg: int, /) -> bool .. py:method:: count_a() -> int .. py:method:: count_b() -> int .. py:method:: count() -> int .. py:method:: create_a(n: int) -> float Apply an alpha creation operator to the determinant at the specified orbital index and return the sign .. !! processed by numpydoc !! .. py:method:: create_b(n: int) -> float Apply a beta creation operator to the determinant at the specified orbital index and return the sign .. !! processed by numpydoc !! .. py:method:: destroy_a(n: int) -> float Apply an alpha destruction operator to the determinant at the specified orbital index and return the sign .. !! processed by numpydoc !! .. py:method:: destroy_b(n: int) -> float Apply a beta destruction operator to the determinant at the specified orbital index and return the sign .. !! processed by numpydoc !! .. py:method:: spin_flip() -> Determinant Spin flip the determinant, i.e., swap alpha and beta orbitals .. !! processed by numpydoc !! .. py:method:: slater_sign(arg: int, /) -> float Get the sign of the Slater determinant .. !! processed by numpydoc !! .. py:method:: slater_sign_reverse(arg: int, /) -> float Get the sign of the Slater determinant .. !! processed by numpydoc !! .. py:method:: gen_excitation(arg0: collections.abc.Sequence[int], arg1: collections.abc.Sequence[int], arg2: collections.abc.Sequence[int], arg3: collections.abc.Sequence[int], /) -> float Apply a generic excitation .. !! processed by numpydoc !! .. py:method:: excitation_connection(arg: Determinant, /) -> list[list[int]] Get the excitation connection between this and another determinant .. !! processed by numpydoc !! .. py:method:: str(n: int = 64) -> str Get the string representation of the Slater determinant .. !! processed by numpydoc !! .. py:function:: hilbert_space(nmo: int, na: int, nb: int, nirrep: int = 1, mo_symmetry: collections.abc.Sequence[int] = [], symmetry: int = 0) -> list[Determinant] hilbert_space(nmo: int, na: int, nb: int, ref: Determinant, truncation: int, nirrep: int = 1, mo_symmetry: collections.abc.Sequence[int] = [], symmetry: int = 0) -> list[Determinant] Generate the Hilbert space for a given number of electrons, orbitals, and the truncation level.If information about the symmetry of the MOs is not provided, it assumes that all MOs have symmetry 0.A reference determinant must be provided to establish the excitation rank. .. !! processed by numpydoc !! .. py:class:: Configuration Configuration(arg: Determinant, /) .. py:method:: str(n: int = 64) -> str Get the string representation of the Slater determinant .. !! processed by numpydoc !! .. py:method:: is_empt(n: int) -> bool Is orbital n empty? .. !! processed by numpydoc !! .. py:method:: is_docc(n: int) -> bool Is orbital n doubly occupied? .. !! processed by numpydoc !! .. py:method:: is_socc(n: int) -> bool Is orbital n singly occupied? .. !! processed by numpydoc !! .. py:method:: set_occ(n: int, value: int) -> None Set the value of an alpha bit .. !! processed by numpydoc !! .. py:method:: count_docc() -> int Count the number of doubly occupied orbitals .. !! processed by numpydoc !! .. py:method:: count_socc() -> int Count the number of singly occupied orbitals .. !! processed by numpydoc !! .. py:method:: get_docc_vec() -> list[int] Get a list of the doubly occupied orbitals .. !! processed by numpydoc !! .. py:method:: get_socc_vec() -> list[int] Get a list of the singly occupied orbitals .. !! processed by numpydoc !! .. py:function:: set_log_level(arg: int, /) -> None Set the logging verbosity level (0=NONE, 1=ERROR, 2=WARNING, 3=INFO, 4=DEBUG) .. !! processed by numpydoc !! .. py:function:: get_log_level() -> int Get the current logging verbosity level .. !! processed by numpydoc !! .. py:class:: SlaterRules(norb: int, scalar_energy: float, one_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))], two_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))]) .. py:method:: energy(arg: Determinant, /) -> float .. py:method:: slater_rules(lhs: Determinant, rhs: Determinant) -> float .. py:class:: RelSlaterRules(nspinor: int, scalar_energy: float, one_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None))], two_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None))]) .. py:method:: energy(arg: Determinant, /) -> float .. py:method:: slater_rules(lhs: Determinant, rhs: Determinant) -> complex .. py:class:: SparseState SparseState(arg: SparseState) SparseState(arg: collections.abc.Mapping[Determinant, complex], /) SparseState(det: Determinant, val: complex = 1) A class to represent a vector of determinants .. !! processed by numpydoc !! .. py:method:: items() -> collections.abc.Iterator[tuple[Determinant, complex]] .. py:method:: str(arg: int, /) -> str .. py:method:: size() -> int .. py:method:: norm(p: int = 2) -> float Calculate the p-norm of the SparseState (default p = 2, p = -1 for infinity norm) .. !! processed by numpydoc !! .. py:method:: add(arg0: Determinant, arg1: complex, /) -> None .. py:method:: map() -> ankerl::unordered_dense::v4_5_0::detail::table, std::__1::complex, std::__1::hash>, std::__1::equal_to>, std::__1::allocator, std::__1::complex>>, ankerl::unordered_dense::v4_5_0::bucket_type::standard, ankerl::unordered_dense::v4_5_0::detail::default_container_t, false> .. py:method:: elements() -> ankerl::unordered_dense::v4_5_0::detail::table, std::__1::complex, std::__1::hash>, std::__1::equal_to>, std::__1::allocator, std::__1::complex>>, ankerl::unordered_dense::v4_5_0::bucket_type::standard, ankerl::unordered_dense::v4_5_0::detail::default_container_t, false> .. py:method:: apply(arg: SparseOperator, /) -> SparseState Apply an operator to this SparseState and return a new SparseState .. !! processed by numpydoc !! .. py:method:: apply_antiherm(arg: SparseOperator, /) -> SparseState Apply the antihermitian combination of the operator (op - op^dagger) to this SparseState and return a new SparseState .. !! processed by numpydoc !! .. py:method:: number_project(arg0: int, arg1: int, /) -> SparseState .. py:method:: spin2() -> complex Calculate the expectation value of S^2 for this SparseState .. !! processed by numpydoc !! .. py:method:: overlap(arg: SparseState, /) -> complex Calculate the overlap between this SparseState and another SparseState .. !! processed by numpydoc !! .. py:function:: apply_op(sop: SparseOperator, state0: SparseState, screen_thresh: float = 1e-12) -> SparseState .. py:function:: apply_antiherm(sop: SparseOperator, state0: SparseState, screen_thresh: float = 1e-12) -> SparseState .. py:function:: apply_number_projector(arg0: int, arg1: int, arg2: SparseState, /) -> SparseState .. py:function:: get_projection(arg0: SparseOperatorList, arg1: SparseState, arg2: SparseState, /) -> list[complex] .. py:function:: spin2(arg0: SparseState, arg1: SparseState, /) -> complex Calculate the expectation value .. !! processed by numpydoc !! .. py:function:: overlap(arg0: SparseState, arg1: SparseState, /) -> complex .. py:function:: normalize(arg: SparseState, /) -> SparseState Returns a normalized version of the input SparseState .. !! processed by numpydoc !! .. py:class:: SparseOperator SparseOperator(arg: SparseOperator) SparseOperator(arg: collections.abc.Mapping[SQOperatorString, complex], /) SparseOperator(sqop: SQOperatorString, coefficient: complex = ...) A class to represent a sparse operator .. !! processed by numpydoc !! .. py:method:: add(sqop: SQOperatorString, coefficient: complex = ...) -> None add(str: SparseOperator.add.str, coefficient: complex = ..., allow_reordering: bool = False) -> None add(acre: collections.abc.Sequence[int], bcre: collections.abc.Sequence[int], aann: collections.abc.Sequence[int], bann: collections.abc.Sequence[int], coeff: complex = ...) -> None Add a term to the operator by passing lists of creation and annihilation indices. This version is faster than the string version and does not check for reordering .. !! processed by numpydoc !! .. py:method:: remove(arg: str, /) -> None Remove a term .. !! processed by numpydoc !! .. py:method:: coefficient(arg: str, /) -> complex Get the coefficient of a term .. !! processed by numpydoc !! .. py:method:: set_coefficient(arg0: str, arg1: complex, /) -> None Set the coefficient of a term .. !! processed by numpydoc !! .. py:method:: commutator(arg: SparseOperator, /) -> SparseOperator Compute the commutator of two SparseOperator objects .. !! processed by numpydoc !! .. py:method:: copy(arg: SparseOperator, /) -> None Create a copy of this SparseOperator .. !! processed by numpydoc !! .. py:method:: norm() -> float Compute the norm of the operator .. !! processed by numpydoc !! .. py:method:: str() -> list[str] Get a string representation of the operator .. !! processed by numpydoc !! .. py:method:: latex() -> str Get a LaTeX representation of the operator .. !! processed by numpydoc !! .. py:method:: adjoint() -> SparseOperator Get the adjoint .. !! processed by numpydoc !! .. py:method:: apply_to_state(state: SparseState, screen_thresh: float = 1e-12) -> SparseState Apply the operator to a state .. !! processed by numpydoc !! .. py:method:: matrix(dets: collections.abc.Sequence[Determinant], screen_thresh: float = 1e-12) -> Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None))] Compute the matrix elements of the operator between a list of determinants .. !! processed by numpydoc !! .. py:function:: sparse_operator(s: str, coefficient: complex = ..., allow_reordering: bool = False) -> SparseOperator sparse_operator(list: collections.abc.Sequence[tuple[str, complex]], allow_reordering: bool = False) -> SparseOperator sparse_operator(s: SQOperatorString, coefficient: complex = ...) -> SparseOperator sparse_operator(list: collections.abc.Sequence[tuple[SQOperatorString, complex]]) -> SparseOperator Create a SparseOperator object from a list of Tuple[SQOperatorString, complex] .. !! processed by numpydoc !! .. py:function:: new_product(arg0: SparseOperator, arg1: SparseOperator, /) -> SparseOperator .. py:function:: sparse_operator_hamiltonian(scalar_energy: float, one_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None))], two_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', shape=(None, None, None, None))], screen_thresh: float = 1e-12) -> SparseOperator sparse_operator_hamiltonian(scalar_energy: float, one_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None))], two_electron_integrals: Annotated[numpy.typing.ArrayLike, dict(dtype='complex128', shape=(None, None, None, None))], screen_thresh: float = 1e-12) -> SparseOperator .. py:class:: SparseOperatorList SparseOperatorList(arg: SparseOperatorList) A class to represent a list of sparse operators .. !! processed by numpydoc !! .. py:method:: add(arg0: SQOperatorString, arg1: complex, /) -> None add(str: SparseOperatorList.add.str, coefficient: complex = ..., allow_reordering: bool = False) -> None add(acre: collections.abc.Sequence[int], bcre: collections.abc.Sequence[int], aann: collections.abc.Sequence[int], bann: collections.abc.Sequence[int], coeff: complex = ...) -> None Add a term to the operator by passing lists of creation and annihilation indices. This version is faster than the string version and does not check for reordering .. !! processed by numpydoc !! .. py:method:: add_term(op_list: collections.abc.Sequence[std::__1::tuple], value: float = 0.0, allow_reordering: bool = False) -> None .. py:method:: to_operator() -> SparseOperator .. py:method:: remove(arg: str, /) -> None Remove a specific element from the vector space .. !! processed by numpydoc !! .. py:method:: coefficients() -> list[complex] .. py:method:: set_coefficients(arg: collections.abc.Sequence[complex], /) -> None .. py:method:: reverse() -> SparseOperatorList Reverse the order of the operators .. !! processed by numpydoc !! .. py:method:: pop_left() -> SparseOperatorList Remove the leftmost operator .. !! processed by numpydoc !! .. py:method:: pop_right() -> SparseOperatorList Remove the rightmost operator .. !! processed by numpydoc !! .. py:method:: slice(start: int, end: int) -> SparseOperatorList Return a slice of the operator .. !! processed by numpydoc !! .. py:method:: apply_to_state(state: SparseState, screen_thresh: float = 1e-12) -> SparseState Apply the operator to a state .. !! processed by numpydoc !! .. py:function:: operator_list(s: str, coefficient: complex = ..., allow_reordering: bool = False) -> SparseOperatorList operator_list(list: collections.abc.Sequence[tuple[str, complex]], allow_reordering: bool = False) -> SparseOperatorList operator_list(s: SQOperatorString, coefficient: complex = ...) -> SparseOperatorList operator_list(list: collections.abc.Sequence[tuple[SQOperatorString, complex]]) -> SparseOperatorList Create a SparseOperatorList object from a list of Tuple[SQOperatorString, complex] .. !! processed by numpydoc !! .. py:class:: SparseExp(maxk: int = 19, screen_thresh: float = 1e-12) A class to compute the exponential of a sparse operator .. !! processed by numpydoc !! .. py:method:: apply_op(sop: SparseOperator, state: SparseState, scaling_factor: float = 1.0) -> SparseState apply_op(sop: SparseOperatorList, state: SparseState, scaling_factor: float = 1.0) -> SparseState Apply the exponential of a SparseOperatorList to a state: exp(scaling_factor * sop) |state> .. !! processed by numpydoc !! .. py:method:: apply_antiherm(sop: SparseOperator, state: SparseState, scaling_factor: float = 1.0) -> SparseState apply_antiherm(sop: SparseOperatorList, state: SparseState, scaling_factor: float = 1.0) -> SparseState Apply the antihermitian exponential of a SparseOperatorList to a state: exp(scaling_factor * (sop - sop^dagger)) |state .. !! processed by numpydoc !! .. py:class:: SparseFactExp(screen_thresh: float = 1e-12) A class to compute the product exponential of a sparse operator using factorization .. !! processed by numpydoc !! .. py:method:: apply_op(sop: SparseOperatorList, state: SparseState, inverse: bool = False, reverse: bool = False) -> SparseState Apply the factorized exponential of a SparseOperator to a state: ... exp(op2) exp(op1) |state>. inverse=True computes the inverse, and reverse=Trueapplies the operators in reverse order .. !! processed by numpydoc !! .. py:method:: apply_antiherm(sop: SparseOperatorList, state: SparseState, inverse: bool = False, reverse: bool = False) -> SparseState Apply the factorized antihermitian exponential of a SparseOperator to a state: ... exp(op2 - op2^dagger) exp(op1 - op1^dagger) |state>. inverse=True computes the inverse, and reverse=True applies the operators in reverse order .. !! processed by numpydoc !! .. py:method:: apply_antiherm_deriv(sqop: SQOperatorString, t: complex, state: SparseState) -> tuple[SparseState, SparseState] .. py:class:: SQOperatorString(arg0: Determinant, arg1: Determinant, /) A class to represent a string of creation/annihilation operators .. !! processed by numpydoc !! .. py:method:: cre() -> Determinant Get the creation operator string .. !! processed by numpydoc !! .. py:method:: ann() -> Determinant Get the annihilation operator string .. !! processed by numpydoc !! .. py:method:: str() -> str Get the string representation of the operator string .. !! processed by numpydoc !! .. py:method:: count() -> int Get the number of operators .. !! processed by numpydoc !! .. py:method:: adjoint() -> SQOperatorString Get the adjoint operator string .. !! processed by numpydoc !! .. py:method:: spin_flip() -> SQOperatorString Get the spin-flipped operator string .. !! processed by numpydoc !! .. py:method:: number_component() -> SQOperatorString Get the number component of the operator string .. !! processed by numpydoc !! .. py:method:: non_number_component() -> SQOperatorString Get the non-number component of the operator string .. !! processed by numpydoc !! .. py:method:: latex() -> str Get the LaTeX representation of the operator string .. !! processed by numpydoc !! .. py:method:: latex_compact() -> str Get the compact LaTeX representation of the operator string .. !! processed by numpydoc !! .. py:method:: is_identity() -> bool Check if the operator string is the identity operator .. !! processed by numpydoc !! .. py:method:: is_nilpotent() -> bool Check if the operator string is nilpotent .. !! processed by numpydoc !! .. py:method:: op_tuple() -> std::__1::vector, std::__1::allocator>> Get the operator tuple .. !! processed by numpydoc !! .. py:function:: sqop(s: str, allow_reordering: bool = False) -> tuple[SQOperatorString, float] Create an operator string from a string representation (default: no not allow reordering) .. !! processed by numpydoc !! .. py:class:: CommutatorType(*args, **kwds) Bases: :py:obj:`enum.Enum` Create a collection of name/value pairs. Example enumeration: >>> class Color(Enum): ... RED = 1 ... BLUE = 2 ... GREEN = 3 Access them by: - attribute access: >>> Color.RED - value lookup: >>> Color(1) - name lookup: >>> Color['RED'] Enumerations can be iterated over, and know how many members they have: >>> len(Color) 3 >>> list(Color) [, , ] Methods can be added to enumerations, and members can have their own attributes -- see the documentation for details. .. !! processed by numpydoc !! .. py:attribute:: commute :value: 0 .. py:attribute:: anticommute :value: 1 .. py:attribute:: may_not_commute :value: 2 .. py:function:: commutator_type(lhs: SQOperatorString, rhs: SQOperatorString) -> CommutatorType Get the commutator type of two operator strings .. !! processed by numpydoc !!