Operator Grouping

Please refer to Grouping Operator Terms for a detailed explanation of this functionality.

Library

Rather than always relying on the user to provide the group indices themselves, the C API provides a collection of functions which determine the grouping information automatically.

qf_group_terms_by_electronic_structure()

Groups the terms of an operator by their electronic structure.


QfExitCode qf_group_terms_by_electronic_structure(QfFermionOperator *op, uint32_t num_modes, bool two_body_physicist_order)

Groups the terms of an operator by their electronic structure.

This function automatically populates the groups attribute (see also qf_ferm_op_get_groups()) of the provided QfFermionOperator such that terms satisfying a symmetric perturbation present in electronic-structure Hamiltonians are grouped.

Caution

The provided operator must be normal-ordered! This is an underlying assumption of the implementation that is not being verified! See qf_ferm_op_normal_ordered() for how to get an operator of that form.

More concretely, given an electronic-structure Hamiltonian of the form

\[\mathcal{H} = \sum_{ij} c_{ij} a^\dagger_i a_j + \sum_{ijkl} c_{ijkl} a^\dagger_i a^\dagger_j a_k a_l \, ,\]

this function will group 1-body terms with permutational symmetry of (i, j) as well as the 2-body terms with permutational symmetry of (i, j, k, l). For the 2-body terms, not all permutations will be grouped. Instead, the two_body_physicist_order determines how the four indices get grouped into pairs of two within which permutational symmetries exist:

  • two_body_physicist_order=False (default): (i, l) and (j, k)

  • two_body_physicist_order=True: (i, k) and (j, l)

1QfFCIDump *fcidump = qf_fcidump_from_file("molecule.fcidump");
2QfFermionOperator *op = qf_ferm_op_from_fcidump(fcidump);
3
4uint32_t num_modes = 2 * fcidump.norb;
5
6QfFermionOperator *normal = qf_ferm_op_normal_ordered(op);
7
8QfExitCode exit = qf_group_terms_by_electronic_structure(normal, num_modes, false);

Parameters:
  • op – A pointer to the normal-ordered fermionic operator whose terms are to be grouped.

  • num_modes – The number of fermionic modes in the operator.

  • two_body_physicist_order – whether the 2-body terms are stored in physicists order.

Returns:

An exit code.