use cached type info
fixed bug in isherm caching
use Qobj.isket instead of direct comparison with string 'ket'