pydmqmc.utils.get_iocc

pydmqmc.utils.get_iocc(occ, orb)

Return the index of an orbital within the set of occupied orbitals.

Parameters:
occarray

The indices of the occupied orbitals in the bitarray.

orbint

The occupied orbital whose index we want to find.

Returns:
int

The index of the given orbital in the set of occupied orbitals.

Examples

>>> import numpy as np
>>> barr = np.array([1, 1, 0, 1])
>>> occ = get_occ(barr)
>>> print(occ)
[0 1 3]
>>> get_iocc(occ, 3)
2