A quantum linear optical simulator