make_only#

make_only(func)[source]#

Retain only pathways for which func is True.

Parameters:

func (Callable) – Callable taking KetBra instance and returning True or False.

Returns:

Function taking a root of KetBra excitation tree and leaving only branches for which func returns True when called on the leaf.

Return type:

Callable