tangelo.problem_decomposition.incremental package

Submodules

tangelo.problem_decomposition.incremental.incremental_helper module

This file provides helpers in order to import data coming from an incremental job (MIFNO or iFCI) run on QEMIST Cloud, providing the users with both fragment information as well as reference results obtained by the classical solvers in QEMIST Cloud. The fragments can be passed to a quantum solver or be used for a quantum computing experiment.

MIFNO references: - Verma, L. Huntington, M. P. Coons, Y. Kawashima, T. Yamazaki and A. Zaribafiyan The Journal of Chemical Physics 155, 034110 (2021).

iFCI references: - Paul M. Zimmerman, J. Chem. Phys., 146, 104102 (2017). - Paul M. Zimmerman, J Chem. Phys., 146, 224104 (2017). - Alan E. Rask and Paul M. Zimmerman, J. Phys. Chem. A, 125, 7, 1598-1609 (2021).

class tangelo.problem_decomposition.incremental.incremental_helper.MethodOfIncrementsHelper(log_file=None, full_result=None)

Bases: object

Python class to post-process, fetch and manipulate QEMIST Cloud incremental results. This is referring to the Method of Increments (MI). MI-FNO and iFCI results are both supported by this class.

e_tot

Total incremental energy.

Type:

float

e_corr

Correlation energy (e_tot - e_mf).

Type:

float

e_mf

Mean-field energy.

Type:

float

frag_info

Information about each fragment. The keys are related to the truncation number (int) . The nested dictionaries have keys

refering to the sampled active space (e.g. ‘(1,)’ or ‘(0, 2)’) They

contain information about the correction term, epsilon, list of truncated orbitals and more.

Type:

dict

Properties:
to_dataframe (pandas.DataFrame): Converted frag_info dict into a pandas

DataFrame.

fragment_ids (list of str): List of all fragment identifiers. frag_info_flattened (dictionary): The nested frag_info without the first

layer (keys = truncation number).

compute_fermionoperator(molecule, frag_id)

Compute the fermionic Hamiltonian for an incremental fragment.

Parameters:
  • molecule (SecondQuantizedMolecule) – Full molecule description.

  • frag_id (str) – Fragment id, e.g. “(0, )”, “(1, 2)”, …

Returns:

FermionOperator – Fermionic operator for the specified fragment id.

property frag_info_flattened

Output the nested frag_info without the first layer.

property fragment_ids

Output the fragment ids in a list.

mi_summation(user_provided_energies=None)

Recompute the total energy for the method of increments (MI). Each increment corresponds to “new” correlation energy from the n-body problem. This method makes computing the total energy with new results possible.

It computes the epsilons: epsilon_{i} = E_c(i) epsilon_{ij} = E_c(ij) - epsilon_{i} - epsilon_{i} epsilon_{ijk} = E_c(ijk) - epsilon_{ij} - epsilon_{ik}

  • epsilon_{jk} - epsilon_{i} - epsilon_{j} - epsilon_{k}

etc.

A correction term per fragment is considered if applicable. For MI-FNO, there is an MP2 correction for the truncated virtual space. For iFCI, there is no such correction.

Parameters:

user_provided_energies (dict) – New energy values provided by the user, used instead of the corresponding pre-computed ones. E.g. {“(0, )”: -1.234} or {“(1, )”: -1.234, “(0, 1)”: -5.678}.

Returns:

float – Method of increment total energy.

n_electrons_spinorbs(frag_id)

Output the number of electrons and spinorbitals for a given fragment.

Parameters:

frag_id (str) – Fragment id, e.g. “(0, )”, “(1, 2)”, …

Returns:

int, int – Number of electrons, number of spinorbitals.

static read_mi_info(full_result)

Method to filter the relevant information in the full_result dictionary.

Parameters:

full_result (dict) – QEMIST Cloud output for the MI problem.

Returns:

(dict) – Simplified version of the MI result dictionary.

retrieve_mo_coeff(source_folder='/Users/valentinsenicourt/Desktop/Tangelo/docs', prefix='mo_coefficients_', suffix='.h5')

Function to fetch molecular orbital coefficients. The array is stored in the [“mo_coefficients”] entry in the frag_info dictionary attribute. Each MO coefficient file name should contain the QEMIST Cloud problem handle for this fragment.

Parameters:
  • source_folder (str) – Users can specify a path to a folder, where the files containing the coefficients are stored. The default value is the directory where the user’s python script is run.

  • prefix (str) – Prefix for the file names. Default is “mo_coeffcients_”.

  • suffix (str) – Suffix for the file name structure, including the file extension. Default is “.h5”.

property to_dataframe

Outputs fragment information as a pandas.DataFrame.

Module contents