Gaussian boson sampling (GBS) replaces the single photons of boson sampling with squeezed light, and the permanent with the hafnian. It is the model behind the quantum-advantage experiments Jiuzhang and Borealis. With squeezers as network elements, the quantum interferometer object computes exact GBS amplitudes, probabilities and samples. We build GBS networks from squeezers and beam splitters, check them against the hafnian formula, and show that any pure Gaussian state is a column of squeezers followed by one interferometer. Heralded two-mode squeezed vacua recover standard boson sampling. We then test a simulated device the way the experiments do. In a twelve-mode Jiuzhang in miniature, the torontonian predicts the clicks of threshold detectors, and loss breaks the photon pairs. Finally, encoding a graph in the squeezers makes GBS sample dense subgraphs. We also emphasize with how the cost of a hafnian grows with the photon number to indicate a classical computer is not suitable for this problem in a larger scale.

Introduction

A linear interferometer on
m
modes is a unitary transfer matrix
W
, with
U
†
a
k
†
U
=
∑
j
W
jk
†
a
j
. In boson sampling, single photons enter the interferometer and the probability of a detection pattern is the squared permanent of a submatrix of W, which is believed to be hard to sample classically . The weak point is the source, single photons on demand are hard to make, and spontaneous parametric down-conversion emits them at random times. Gaussian boson sampling (GBS) feeds the interferometer with squeezed vacuum instead, which a nonlinear crystal produces deterministically, and the permanents become hafnians . Many photonic quantum advantage experiments are related to GBS machines

Paclet installation

Version 2.1.3 needed to use the QuantumInteferometer object:
In[]:=
PacletInstall["https://www.wolfr.am/DevWQCF",ForceVersionInstall->True]
Out[]=
PacletObject
Name: Wolfram/QuantumFramework
Version: 2.1.3

Paclet loading:
In[]:=
<<Wolfram`QuantumFramework`​​<<Wolfram`QuantumFramework`SecondQuantization`

Squeezed vacuum: photon come in pairs

Single mode squeezing

The single-mode squeezer is
S(ξ)=expξ
2
a
-ξ
2
†
a
2
with
ξ=r
θ

. Its generator
2
†
a
creates photons two at a time, so squeezed vacuum only has even photon numbers. Such that the following properties hold
(
1
)
Define a parametric single squeezer, in QuantumInterferometer is defined as “S”:
In[]:=
squeezer=QuantumInterferometer[{"S"[ξ]->1},1,"Parameters"->{ξ}]
Out[]=
QuantumInterferometer
Modes: 1
Method: None
Beam splitters: 0
Depth: 0

Photon-number distribution of the squeezed vacuum,
r=0.8,
up to 10 photons:
In[]:=
squeezer[0.8]["Probabilities",{0},"Cutoff"->10]
Out[]=
|0〉0.7477,|2〉0.164847,|4〉0.0545164,|6〉0.0200323,|8〉0.00772898,|10〉0.00306725
The squeezing can also be symbolic, if we assume a real
r
to calculate probabilities that given an initial |0〉 state we have
k
photons
For odd numbers the probabilities are zero:
In[]:=
Table[{n,FullSimplify[squeezer[r]["Probability",{0}->{2n+1}],r>0]},{n,0,7}]
Out[]=
{{0,0},{1,0},{2,0},{3,0},{4,0},{5,0},{6,0},{7,0}}
Calculate it for even numbers:
In[]:=
Table[{n,Simplify[squeezer[r]["Probability",{0}->{2n}],r>0]},{n,0,7}];
Recover the symbolic
P
2n
(r)
with FindSequenceFunction:
In[]:=
sq0Prob=FunctionExpand@Simplify@FindSequenceFunction[%,n]
Out[]=
Γn+
1
2
sech(r)
n
2
tanh
(r)
π
Γ(n+1)
Of course that distribution is normalized:
In[]:=
Simplify
∞
∑
n=0
sq0Prob,r>0
Out[]=
1
And verify the mean photon number result:
In[]:=
Simplify
∞
∑
n=0
2nsq0Prob,r>0
Out[]=
2
Sinh[r]
If the input is the single photon state |1〉 , then only odd even Fock occupations are non zero after the squeezer
Find the
P
2n+1
(r)
distribution:
In[]:=
sq1Prob=Simplify[FunctionExpand[FindSequenceFunction[Table[{n,FullSimplify[squeezer[r]["Probability",{1}{2n+1}],r>0]},{n,0,7}]][n]]]
Out[]=
2Γn+
3
2

3
sech
(r)
n
2
tanh
(r)
π
Γ(n+1)
Check again normalization:
In[]:=
Simplify
∞
∑
n=0
sq1Prob,r>0
Out[]=
1
The mean photon number also has
2
sinh
behavior but with added coefficients:
In[]:=
Simplify[Sum[(2n+1)sq1Prob,{n,0,∞}],r>0]
Out[]=
3
2
sinh
(r)+1
Visualize the photon distributions:
Out[]=
squeezed vacuum
squeezed photon

Two mode squeezing

Two parametric squeezers with opposite signs
ξ
1
=r,
ξ
2
=r
π

, combined on a 50:50 beam splitter generate a two mode squeezed vacuum
Define the parametric interferometer:
In[]:=
twoModeSqueezer=QuantumInterferometer[{"S"[r]->1,"S"[-r]->2,"BS"[π/4,0]->{1,2}},2,"Parameters"->{r}];
Visualize the network:
In[]:=
twoModeSqueezer["Diagram",ImageSize->150,ImagePadding->-20]
Out[]=
Calculate the non-zero patterns of the probability distribution for a given cutoff, only the |
n
,
n
〉 patterns remain:
In[]:=
pp=DeleteCases[Simplify[#,r>0]&/@twoModeSqueezer[r]["Probabilities",{0,0},"Cutoff"->10],0]
Out[]=
00
2
Sech[r]
,11
2
Sech[r]
2
Tanh[r]
,22
2
Sech[r]
4
Tanh[r]
,33
2
Sech[r]
6
Tanh[r]
,44
2
Sech[r]
8
Tanh[r]
,55
2
Sech[r]
10
Tanh[r]

The two outputs carry perfectly correlated photon numbers. Counting
n
photons in one arm tells us, without touching it, that the other arm holds exactly
n
photons. This is the state of spontaneous parametric down-conversion, and it is how heralded single-photon sources work
Compute the distribution
P
n,n
(r)
:
In[]:=
FindSequenceFunction[Values[pp],n+1]//Simplify
Out[]=
2
sech
(r)
n
2
tanh
(r)
If the squeezers are of the same sign we do not get the squeezed vacuum state:
In[]:=
sameSign=QuantumInterferometer[{"S"[1/2]->1,"S"[1/2]->2,"BS"[π/4,0]->{1,2}},2]
Out[]=
QuantumInterferometer
Modes: 2
Method: None
Beam splitters: 1
Depth: 1

We get other output states that are not the |
n,n〉
, so it’s clear is a different state:
In[]:=
Keys[Select[sameSign[{0,0}],#!=0&]]
Out[]=
{|00〉,|20〉,|02〉,|40〉,|22〉,|04〉,|60〉,|42〉,|24〉,|06〉,|80〉,|62〉,|44〉,|26〉,|08〉,|100〉,|82〉,|64〉,|46〉,|28〉,|010〉}
In fact the joint distribution is the product of two single-mode squeezed vacua since there are no correlations
We can clearly see that in the decomposition that the beam splitter was not doing anything:
In[]:=
sameSign["GBSForm"]["Diagram"]
Out[]=
This holds for the case of using the beam-splitter with
ϕ=0
, in general it will depend on the relative phase of the squeezers and the ϕ of the beam-splitter

The hafnian

Define the Hafnian:
A 4×4 symmetric matrix has three perfect matchings:
For a bipartite block matrix it reduces to the permanent:
The permanent counts perfect matchings of bipartite graphs and the hafnian counts them for any graph. GBS generalizes the permanents of standard boson sampling, and the counting interpretation connects it to graph problems, as we will see at the end.

Every pure Gaussian state is a GBS network

The Bloch–Messiah decomposition says more any such network is an interferometer, a column of single-mode squeezers and a second interferometer. On vacuum the first interferometer does nothing, which leaves squeezers followed by one interferometer, exactly the layout of a GBS experiment
A network with squeezers in between the beam splitters:
Both forms find the same squeezing value:
The Bloch–Messiah form is the same network for any input, while the GBS form is only valid for vacuum. With one photon in each of the first two modes:
With vacuum input, the GBS form gives the same probabilities for every pattern up to 6 photons:

Gaussian boson sampling network properties

A GBS network is the squeezers followed by a mesh. Applying one interferometer to another places the mesh after the squeezers:
Four squeezers with different strengths and phases, followed by a Haar-random four-mode mesh:
Transfer matrix of the mesh:
The amplitude of Hamilton et al. :
Extract the unitary:
Every pattern up to 6 photons, 130 patterns in total:
Compare with QuantumInterferometer on every pattern:
Show the result:
The amplitudes, phases included, agree to machine precision:

GBS contains boson sampling

Network squeezing parameter value:
Three pairs, heralds on modes 4–6, and a random three-mode mesh on the signal modes 1–3:
Check against the permanent for several herald patterns, including one with two photons from the same source:
The hafnian of the full six-mode network reduces to the permanent because B is bipartite between herald and signal modes.
In the experiment the herald pattern is not chosen, it changes from shot to shot. Sampled shots, signal modes 1–3 first and heralds 4–6 after
Every shot has as many photons in the signal modes as in the heralds:
The most frequent herald patterns:

More about photon statistics

Returning to the previously defined network:
Probability contained with patterns up to 12 photons:
Photons still come in pairs, so the total photon number is always even:
Define the squeezers:
Compute the symbolic formula:
The total count can be classically easy to predict. Everything that makes GBS hard is in how the photons are distributed among the modes, which is what the hafnians resolve
Probabilities of the four-photon patterns:
Average over three random meshes for different number of modes:
At four modes, GBS produces about three times more collision-free events than uniform bosons. Beyond eight modes the two curves are close, and the fraction approaches one half only at 16 modes, four times the photon number. Collisions become rare once the number of modes grows faster than the square of the photon number, the bosonic birthday paradox.

Two point correlators

We compare off-diagonal parts only:
Largest error of the mean photon numbers and of the off-diagonal covariances of a distribution of photon counts, against Wick’s theorem:
A probability table with each pattern weighted by its probability:
Compute the cutoff dependent errors:
Both errors fall exponentially with the cutoff:
Sample each pattern mode by mode, heterodyne outcomes on the modes not yet counted leave the counted ones in a pure Gaussian state, and trading one heterodyne outcome at a time for a photon count gives the exact distribution

Simple model of photon loss

Loss in a mode can be described as a coupling to beam splitter with transmission η to a mode we do not look at:
Distribution of the photons that reach the detector in mode 1:
Losing one photon of a pair leaves the other one alone, so odd photon numbers appear, see the effect of loss on the photon distribution for different η:
Odd fraction from the table, for transmissions from 10% to 100%:
Verify the result from the curve:

Threshold detectors: Torontonians

Jiuzhang, with 50 squeezed inputs in 100 modes, used threshold detectors which only click or stay silent and recorded up to 76 clicks. The probability of a click pattern is a sum over all photon patterns with nonzero counts in the same modes. For a Gaussian state it has a closed form, the Torontonian:
A Jiuzhang in miniature six equal squeezers into a random twelve-mode mesh, the other six inputs left in vacuum
Define the squeezers values:
Build the GBS network:
Visualize the network:
A photon-number table of this network is out of reach shots carry up to 22 photons, and the table would need every pattern up to that number in twelve modes. The sampler only needs one pattern at a time:
Check the maximum number of photons of the shots:
A threshold detector sees a mode with photons as one click. The same shots, counted with photon-number resolution and with threshold detectors, against the Torontonian:
The clicks follow the Torontonian. The photon numbers are always even and run up to 22, while the clicks stop at 9. In twelve modes, many shots put two or more photons into the same mode, and those reach the threshold detectors as one click. When the photons spread over many more modes than there are photons, a click almost always means a single photon
Four squeezers into m modes, and the fraction of four-click events that carry exactly four photons, from the Hafnians of the collision-free patterns and the Torontonians of the same click patterns:
In four modes half of the four-click events carry more than four photons. In 24 modes nine in ten are clean,threshold detection approaches photon-number resolution as the modes outnumber the photons

Graph problems: dense subgraphs and perfect matchings

so the device samples subgraphs with many perfect matchings, which tend to be dense ones
A sparse random graph on 16 vertices with a complete subgraph “hidden” on six of them:
Show the subgraph:
Extract the adjacency matrix:
Compute the eigenvalues and eigenvectors:
Perform the extra step for negative eigenvalues:
Check the decomposition is correct:
The 0.7 was not derived from anything. It was picked it by trial as a compromise between how many six-photon events you get and how heavily one mode is squeezed.
Build the network:
There are 8008 six-vertex subgraphs, and a search for the densest one has to compare them:
We perform samples, the sampler takes about a minute and a half:
The hidden subgraph is the most frequent one, show the top 5:
The runners-up trade one vertex of the hidden subgraph for a well-connected neighbor:
Edge densities of the sampled subgraphs, against all 8008 six-vertex subgraphs drawn uniformly. The densities you’d get by picking 6 vertices at random. In this sparse graph most have 3–5 edges:
The blue bars sit far to the right of the yellow ones. The device doesn’t search through the candidates it just samples, and its samples come out much denser than random. GBS samples are good starting points for a classical search for the densest subgraph.

How hard it gets: Complexity

Photon pattern with the given occupations in the first modes:
And the best of two timings of its amplitude:
Time for one collision-free amplitude, as a function of the photon number:
Show the complexity behavior:
With 32 photons in two modes:
Against the collision-free pattern with the same photon number:
For the 100×100 hafnians of a Jiuzhang-sized pattern, researchers estimated about a month and a half on a supercomputer. Better classical algorithms, exploiting loss, collisions and the structure of the experiments, can help move the boundary for quantum advantage.

References

◼
  • S. Aaronson and A. Arkhipov, The computational complexity of linear optics, Theory of Computing 9, 143–252 (2013). https://doi.org/10.4086/toc.2013.v009a004
  • ◼
  • C. S. Hamilton, R. Kruse, L. Sansoni, S. Barkhofen, C. Silberhorn and I. Jex, Gaussian Boson Sampling, Phys. Rev. Lett. 119, 170501 (2017). https://doi.org/10.1103/PhysRevLett.119.170501
  • ◼
  • R. Kruse, C. S. Hamilton, L. Sansoni, S. Barkhofen, C. Silberhorn and I. Jex, Detailed study of Gaussian boson sampling, Phys. Rev. A 100, 032326 (2019). https://doi.org/10.1103/PhysRevA.100.032326
  • ◼
  • C. C. Gerry and P. L. Knight, Introductory Quantum Optics, Cambridge University Press (2005), chapter 7.
  • ◼
  • M. S. Kim, F. A. M. de Oliveira and P. L. Knight, Properties of squeezed number states and squeezed thermal states, Phys. Rev. A 40, 2494 (1989). https://doi.org/10.1103/PhysRevA.40.2494
  • ◼
  • S. L. Braunstein, Squeezing as an irreducible resource, Phys. Rev. A 71, 055801 (2005). https://doi.org/10.1103/PhysRevA.71.055801
  • ◼
  • A. P. Lund, A. Laing, S. Rahimi-Keshari, T. Rudolph, J. L. O'Brien and T. C. Ralph, Boson sampling from a Gaussian state, Phys. Rev. Lett. 113, 100502 (2014). https://doi.org/10.1103/PhysRevLett.113.100502
  • ◼
  • S. Arkhipov and G. Kuperberg, The bosonic birthday paradox, Geometry & Topology Monographs 18, 1–7 (2012). https://arxiv.org/abs/1106.0849
  • ◼
  • D. S. Phillips, M. Walschaers, J. J. Renema, I. A. Walmsley, N. Treps and J. Sperling, Benchmarking of Gaussian boson sampling using two-point correlators, Phys. Rev. A 99, 023836 (2019). https://doi.org/10.1103/PhysRevA.99.023836
  • ◼
  • N. Quesada, J. M. Arrazola and N. Killoran, Gaussian boson sampling using threshold detectors, Phys. Rev. A 98, 062322 (2018). https://doi.org/10.1103/PhysRevA.98.062322
  • ◼
  • H. Qi, D. J. Brod, N. Quesada and R. García-Patrón, Regimes of classical simulability for noisy Gaussian boson sampling, Phys. Rev. Lett. 124, 100502 (2020). https://doi.org/10.1103/PhysRevLett.124.100502
  • ◼
  • J. M. Arrazola and T. R. Bromley, Using Gaussian boson sampling to find dense subgraphs, Phys. Rev. Lett. 121, 030503 (2018). https://doi.org/10.1103/PhysRevLett.121.030503
  • ◼
  • K. Brádler, P.-L. Dallaire-Demers, P. Rebentrost, D. Su and C. Weedbrook, Gaussian boson sampling for perfect matchings of arbitrary graphs, Phys. Rev. A 98, 032310 (2018). https://doi.org/10.1103/PhysRevA.98.032310
  • ◼
  • A. Björklund, B. Gupt and N. Quesada, A faster hafnian formula for complex matrices and its benchmarking on a supercomputer, ACM J. Exp. Algorithmics 24, 1.11 (2019). https://doi.org/10.1145/3325111
  • ◼
  • Y. Kan, From moments of sum to moments of product, J. Multivariate Anal. 99, 542–554 (2008). https://doi.org/10.1016/j.jmva.2007.01.013
  • ◼
  • H.-S. Zhong et al., Quantum computational advantage using photons, Science 370, 1460–1463 (2020). https://doi.org/10.1126/science.abe8770
  • ◼
  • L. S. Madsen et al., Quantum computational advantage with a programmable photonic processor, Nature 606, 75–81 (2022). https://doi.org/10.1038/s41586-022-04725-x
  • ◼
  • J. F. F. Bulmer et al., The boundary for quantum advantage in Gaussian boson sampling, Sci. Adv. 8, eabl9236 (2022). https://doi.org/10.1126/sciadv.abl9236
  • ◼
  • N. Quesada et al., Quadratic speed-up for simulating Gaussian boson sampling, PRX Quantum 3, 010306 (2022). https://doi.org/10.1103/PRXQuantum.3.010306
  • CITE THIS NOTEBOOK

    Gaussian boson sampling with QuantumInterferometer: from hafnians to a miniature Jiuzhang​
    by Bruno Tenorio​
    Wolfram Community, STAFF PICKS, November 02, 2026
    https://community.wolfram.com/t/28485