The efficient characterization of quantum systems1, 2, 3, the verification of the operations of quantum devices4, 5, 6 and the validation of underpinning physical models7, 8, 9, are central challenges for quantum technologies10, 11, 12 and fundamental physics13, 14. The computational cost of such studies could be improved by machine learning enhanced by quantum simulators15, 16. Here we interface two different quantum systems through a classical channel—a silicon-photonics quantum simulator and an electron spin in a diamond nitrogen–vacancy centre—and use the former to learn the Hamiltonian of the latter via Bayesian inference. We learn the salient Hamiltonian parameter with an uncertainty of approximately 10−5. Furthermore, an observed saturation in the learning algorithm suggests deficiencies in the underlying Hamiltonian model, which we exploit to further improve the model. We implement an interactive version of the protocol and experimentally show its ability to characterize the operation of the quantum photonic device.