Controlled charge trapping by molybdenum disulphide and graphene in ultrathin heterostructured memory devices