XanaduAI / thewalrus

A library for the calculation of hafnians, Hermite polynomials and Gaussian boson sampling.
https://the-walrus.readthedocs.io
Apache License 2.0
100 stars 56 forks source link

Implementation of A matrix correct? #160

Closed Marsll closed 4 years ago

Marsll commented 4 years ago

Hi, I am a grad student working through the GBS literature and I have started using thewalrus, I mainly want to make sure the library is working as expected.

Issue description

Here, you seem to calculate the "A matrix" as \boldsymbol{A} = \boldsymbol{X}( I - \sigma_Q^{-1} )^* where the * denotes the complex conjugate. However, in the literature, there is no complex conjugate there? Why is it in your code?

Something along the same lines: When I was going through the calculation for the probabilities in GBS, I actually always get that \bf{A} = \bf{B}^*  \oplus \bf{B} instead of \bf{A} = \bf{B}  \oplus \bf{B}^* as is written in the original papers? Can you confirm this, or am I messing up?

nquesada commented 4 years ago

Hi @Marsll --- A possibility is that people use different orderings, so instead of (q,p) one can use (p,q). But more importantly, note that either if A = B \sum B^ or A=B^ \sum B in both cases haf(A) = |haf(B)|^2 = |haf(B^*)|^2.