MODERATOR NOTE: The code in this post uses QMRITools that are discussed here : https://community.wolfram.com/groups/-/m/t/1661539