Two changes in hilbert_space_tools

* New method has_state() to check if a state belongs to hilbert_space/sub_hilbert_space
* hilbert_test ported from cthyb
state: function to project a state from one space to another