An artificial intelligence algorithm can learn the laws of quantum mechanics