Electronic Integrals
The constructor functions listed here generally take the coefficients of electronic structure Hamiltonians as an input. Different flavors exist:
tril: these functions consume 1-dimensional arrays of flattened (generalized) triangular indicesfull: these functions consume high-dimensional arraysspin: these functions take separate arrays for the different spin speciessym: these functions take a single array for one spin species and infer the other spin species
qf_ferm_op_from_1body_tril_spin_sym
QfFermionOperator *qf_ferm_op_from_1body_tril_spin_sym(double *one_body_a, uint32_t norb)
Constructs an operator from spin-symmetric triangular 1-body integrals.
The resulting operator is defined by
where are the integral coefficients stored in one_body_a, and are the indices expanded from the triangular index which indexes the array, and is the number of orbitals, norb.
1int norb = 2;
2double one_body_a[3] = {1.0, 2.0, 3.0};
3QfFermionOperator *op = qf_ferm_op_from_1body_tril_spin_sym(one_body_a, norb);Parameters
- one_body_a – a 1-dimensional array of length
norb * (norb + 1) / 2storing the 1-body electronic integral coefficients of the alpha-spin species, as a flattened triangular matrix. - norb – the number of orbitals.
Returns
The 1-body component of the electronic structure Hamiltonian as defined above.
qf_ferm_op_from_1body_tril_spin
QfFermionOperator *qf_ferm_op_from_1body_tril_spin(double *one_body_a, double *one_body_b, uint32_t norb)
Constructs an operator from separate spin-species triangular 1-body integrals.
The resulting operator is defined by
where () are the integral coefficients stored in one_body_a (one_body_b, resp.), and are the indices expanded from the triangular index which indexes the arrays, and is the number of orbitals, norb.
1int norb = 2;
2double one_body_a[3] = {1.0, 2.0, 3.0};
3double one_body_b[3] = {-1.0, -2.0, -3.0};
4QfFermionOperator *op = qf_ferm_op_from_1body_tril_spin(one_body_a, one_body_b, norb);Parameters
- one_body_a – a 1-dimensional array of length
norb * (norb + 1) / 2storing the 1-body electronic integral coefficients of the alpha-spin species, as a flattened triangular matrix. - one_body_b – a 1-dimensional array of length
norb * (norb + 1) / 2storing the 1-body electronic integral coefficients of the beta-spin species, as a flattened triangular matrix. - norb – the number of orbitals.
Returns
The 1-body component of the electronic structure Hamiltonian as defined above.
qf_ferm_op_from_2body_tril_spin_sym
QfFermionOperator *qf_ferm_op_from_2body_tril_spin_sym(double *two_body_aa, uint32_t norb)
Constructs an operator from spin-symmetric triangular 2-body integrals.
The resulting operator is defined by
where are the integral coefficients stored in two_body_aa, is the running index of the array, generates the unique permutations of the 4-index (see below), and is the number of orbitals, norb.
1int norb = 2;
2double two_body_aa[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
3QfFermionOperator *op = qf_ferm_op_from_2body_tril_spin_sym(two_body_aa, norb);two_body_aa is an S8-fold symmetric array. That means, it is the flattened lower-triangular data of a matrix of shape (npair, npair), where npair = (norb * (norb + 1) // 2. This in turn is the lower-triangular data of the 4-dimensional array of shape (norb, norb, norb, norb). Therefore, above expands the flattened index into all index permutations that index this 4-dimensional array.
Parameters
- two_body_aa – a 1-dimensional array of the S8-fold symmetric 2-body electronic integral coefficients of the alpha/alpha-spin species, as a flattened array.
- norb – the number of orbitals.
Returns
The 2-body component of the electronic structure Hamiltonian as defined above.
qf_ferm_op_from_2body_tril_spin
QfFermionOperator *qf_ferm_op_from_2body_tril_spin(double *two_body_aa, double *two_body_ab, double *two_body_bb, uint32_t norb)
Constructs an operator from separate spin-species triangular 2-body integrals.
The resulting operator is defined by
where (, ) are the integral coefficients stored in two_body_aa (two_body_ab, two_body_bb, resp.), is the running index of the array, () generates the unique permutations of the 4-index (see below), and is the number of orbitals, norb.
1int norb = 2;
2double two_body_aa[6] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0};
3double two_body_ab[9] = {11.0, 12.0, 13.0, 14.0, 15.0,
4 16.0, 17.0, 18.0, 19.0};
5double two_body_bb[6] = {-1.0, -2.0, -3.0, -4.0, -5.0, -6.0};
6QfFermionOperator *op = qf_ferm_op_from_2body_tril_spin(
7 two_body_aa, two_body_ab, two_body_bb, norb);two_body_aa and two_body_bb are a S8-fold symmetric arrays. That means, they are the flattened lower-triangular data of matrices of shape (npair, npair), where npair = (norb * (norb + 1) // 2. These in turn are the lower-triangular data of the 4-dimensional arrays of shape (norb, norb, norb, norb). Therefore, above expands the flattened index into all index permutations that index these 4-dimensional arrays.
However, two_body_ab is only S4-fold symmetric. Thus, it contains the full data of the (npair, npair) matrix (but still in flattened form). performs the corresponding index expansion. (In the definition above, we reused the index as an abuse of notation.)
Parameters
- two_body_aa – a 1-dimensional array of the S8-fold symmetric 2-body electronic integral coefficients of the alpha/alpha-spin species, as a flattened array.
- two_body_ab – a 1-dimensional array of the S4-fold symmetric 2-body electronic integral coefficients of the alpha/beta-spin species, as a flattened array.
- two_body_bb – a 1-dimensional array of the S8-fold symmetric 2-body electronic integral coefficients of the beta/beta-spin species, as a flattened array.
- norb – the number of orbitals.
Returns
The 2-body component of the electronic structure Hamiltonian as defined above.