Emulating quantum computing with optical matrix multiplication