def _self_interactions(num_qubits):
    """Return the indices corresponding to the self-interactions."""
    interactions = []
    for qubit in range(num_qubits):
        for pindex in range(1, 4):
            term = [0] * num_qubits
            term[qubit] = pindex
            interactions.append(tuple(term))
    return interactions