Problem in torontonian sampling algo

Hey! I am trying torontonian_sample_graph() and had set the cutoff to 9 but unfortunately, I only get 1 or 0 photons per output mode**


A= adjacency_matrix(G).todense()




I can confirm that I also get that ‘P’ only contains ones and zeros. I’m consulting with a colleague about this. I will post a message here as soon as we have an answer.

Thank you for your question!


I’m back with an answer! My colleague Sebastián helped me figure out the details.

The torontonian corresponds to the problem of Gaussian Boson Sampling with threshold detectors: these measure 0 if there’s no detection and 1 if there’s detection of something.

So the 0’s and 1’s don’t represent the number of photons per mode, they simply state whether or not something was detected.

Knowing this I would guess that you probably want to calculate the hafnian instead of the torontonian.

I hope this is helpful!