Machine Learning Quantum Systems with Magnetic p-bits