Modes, Occupation Lists, and Assumptions
Modes, Occupation Lists, and Assumptions
An occupation list records the photon count in each of the modes, with one entry per mode. Here, each input or output mode corresponds to a port of the optical network. An input occupation list specifies how many photons enter each input port; an output occupation list specifies how many photons are detected at each output port. The occupation list labels the Fock state .
{,,…,}
n
1
n
2
n
m
m
{,,…,}
n
1
n
2
n
m
|,,…,〉
n
1
n
2
n
m
A collision-free input or output occupation list has at most one photon per mode. For example, describes two photons, one in mode 1 and one in mode 3.
{1,0,1}
We will follow two photons through a beam splitter, derive the normalized permanent amplitude, compare ways of computing it, and examine what this says about classical sampling. Computing one amplitude, collecting every probability, and drawing one sample are different tasks; keeping them separate is essential to the hardness argument.
The examples assume a passive lossless network and number-resolving detectors. The photons may enter different ports, but their internal wave packets must match in arrival time, spectrum, polarization, and unresolved spatial structure to interfere fully. Partial distinguishability reduces that interference. Loss changes the detected photon-number sectors, while threshold detectors merge different occupation lists into the same click pattern; neither alone makes the photons distinguishable.
Load QuantumFramework and its second-quantization tools, then evaluate the cells in order:
In[]:=
Needs["Wolfram`QuantumFramework`"];Needs["Wolfram`QuantumFramework`SecondQuantization`"];
Let's start!
Two-Photon Interference at a Beam Splitter
Two-Photon Interference at a Beam Splitter
Start with the smallest interesting case: two identical photons, one into each port of a single balanced beam splitter. A balanced beam splitter sends each incoming photon out either side with equal probability, so a classical intuition says the two photons land on the same side half the time and on opposite sides half the time. The quantum answer is stranger: the two photons never come out on opposite sides. They always leave together. In other words, the output occupation list , one photon in each output mode, has probability zero. This is the Hong-Ou-Mandel effect, and it is the whole subject in miniature.
{1,1}
Build a two-mode interferometer that is a single balanced beam splitter (the angle makes the reflection and transmission amplitudes equal in size):
θ=π/4
In[]:=
qbs=QuantumInterferometer[{"BS"[π/4,0]->{1,2}},2]
Out[]=
QuantumInterferometer
Draw it, so we can see the one element the photons meet:
In[]:=
qbs["Diagram"]
Out[]=
Everything a passive network of modes does to a single photon is held in one matrix , its transfer matrix: the entry is the amplitude for a photon entering port to leave port . For the beam splitter , and we store its matrix as .
m
m×m
W
W
jk
k
j
m=2
Wbs
Read the transfer matrix:
In[]:=
Wbs=qbs["TransferMatrix"];Wbs//MatrixForm
Out[]//MatrixForm=
1 2 | - 1 2 |
1 2 | 1 2 |
As one can see, the four entries are equal in magnitude but not in sign: one of them carries a minus. That sign is not decoration. It is the seed of the interference, and we are about to watch it cancel an entire outcome.
Ask for the full distribution over output occupation lists when one photon enters each port, giving the input occupation list :
QuantumInterferometer
{1,1}
In[]:=
qbs["Probabilities",{1,1}]
Out[]=
20,110,02
1
2
1
2
As one can see, the output occupation list has probability zero, while the two bunched output occupation lists and split the probability between them. The photons leave together, every time. The next question is where that zero comes from, and the cleanest way to see it is to compute the same three numbers for three different kinds of particle and read them side by side.
{1,1}
{2,0}
{0,2}
Occupation Lists and the Permanent Formula
Occupation Lists and the Permanent Formula
To compare the three particle types, we need the permanent of a square matrix. It is defined like the determinant, as a sum over all ways of pairing rows with columns, except that every term is added with a plus sign where the determinant alternates the signs.
The probability helpers below assume valid input and output occupation lists with the same positive total photon count.
Define a helper, , that converts an input or output occupation list into a mode assignment list: a list containing the mode label once for each photon in that mode. Replace each count with copies of the mode label , then join the groups into one list. For example,
modeList
n
j
n
j
j
The occupation list has one entry per mode; the mode assignment list has one entry per photon. These entries are bookkeeping for the occupied modes and do not make the photons distinguishable.
In[]:=
ClearAll[modeList];modeList[occ_List]:=Catenate@MapIndexed[ConstantArray[First[#2],#1]&,occ]
Name the three output occupation lists we are comparing:
In[]:=
outs={{2,0},{1,1},{0,2}};
For indistinguishable bosons, let and be the input and output occupation lists, with ==n, since a passive lossless network neither creates nor destroys photons. Define to compute the probability of observing given and the transfer matrix:
S={,…,}
s
1
s
m
T={,…,}
t
1
t
m
∑
k
s
k
∑
j
t
j
bosonProb
T
S
In[]:=
ClearAll[bosonProb];bosonProb[w_,s_,t_]:=Abs[Permanent[w[[modeList[t],modeList[s]]]]]^2/Times@@Factorial[Join[s,t]]
To unpack this calculation, start with the device's transfer matrix , whose entries are single-photon amplitudes. The input mode assignment list selects columns, and the output mode assignment list selects rows: repeat column times and row times. Call the resulting matrix .
W
k
s
k
j
t
j
n×n
M=
W
T,S
Each column of represents an incoming photon, and each row an outgoing detection. A complete connection between them uses every row and column once. Because the photons do not interact, its contribution is the product of the corresponding single-photon amplitudes. For example, one contribution is ⋯.
M
M
11
M
22
M
nn
Identical bosons require us to add these contributions with no extra exchange signs. Summing over all permutations of the columns gives precisely the permanent:
n!
σ
Normalizing the input and output Fock states then gives the amplitude:
The factorials account for the normalization of states with multiple photons in the same mode. To obtain the probability, take the squared magnitude of the amplitude:
This is what evaluates: takes the squared magnitude of the permanent, and multiplies the factorials of all input and output occupation counts.
bosonProb
Abs[...]^2
Times@@Factorial[Join[s,t]]
Comparing Particle Statistics
Comparing Particle Statistics
For classical distinguishable particles the amplitudes never interfere. Each photon crosses the network on its own, leaving input mode for output mode with probability
, so the probability of an output occupation list is the permanent of the block of entrywise squared magnitudes
, selected by the same repeated rows and columns, divided only by the output factorials:
k
j
2
W jk |
2
W |
T,S
The permanent counts each assignment of photons to output modes ! times, once for every way of matching the photons in mode to the copies of row , and the output factorials remove that overcount. There is no !, because photons that start in the same mode are still different particles. Define that:
∏
j
t
j
j
t
j
j
s
k
In[]:=
ClearAll[distProb];distProb[w_,s_,t_]:=Permanent[(Abs[w]^2)[[modeList[t],modeList[s]]]]/Times@@Factorial[t]
For indistinguishable noninteracting fermions, odd permutations contribute a minus sign, giving a determinant. A valid input occupation list has only zero-or-one counts; output collisions have probability zero, and the definition returns that zero directly instead of relying on a numerically computed determinant of a matrix with a repeated row. Define the probability for such inputs:
In[]:=
ClearAll[fermionProb];fermionProb[w_,s_,t_]:=If[Max[t]>1,0,Abs[Det[w[[modeList[t],modeList[s]]]]]^2]
Put the three particle types in one table, with one row per output occupation list:
In[]:=
Grid[Join[{Style[#,Bold]&/@{"output","indistinguishable bosons","distinguishable bosons","indistinguishable fermions"}},Table[Prepend[Through[{bosonProb,distProb,fermionProb}[Wbs,{1,1},t]],Row[{"|",Row[t,","],"〉"}]],{t,outs}]],Frame->All,Spacings->{2,1}]
Out[]=
output | indistinguishable bosons | distinguishable bosons | indistinguishable fermions |
|2,0〉 | 1 2 | 1 4 | 0 |
|1,1〉 | 0 | 1 2 | 1 |
|0,2〉 | 1 2 | 1 4 | 0 |
The distinguishable probabilities are a quarter, a half, a quarter. Bosonic coincidence vanishes because its two contributions are and : positive exchange coefficients do not prevent destructive interference between signed optical amplitudes. Fermions instead leave one particle in each output mode with certainty. A bunched output repeats a matrix row, making its determinant zero, as required by Pauli exclusion.
+
1
2
-
1
2
Check the coincidence amplitude at a variable beam-splitter angle:
In[]:=
ClearAll[θ];With[{splitter=QuantumInterferometer[{"BS"[θ,0]->{1,2}},2]},FullSimplify[splitter["Amplitude",{1,1}->{1,1}]==Cos[2θ],θ∈Reals]]
Out[]=
True
At this amplitude is one, restoring the input; at it vanishes. We can now derive the amplitude for an arbitrary passive network.
θ=0
θ=π/4
Many-Photon Amplitudes as Normalized Permanents
Many-Photon Amplitudes as Normalized Permanents
The same amplitude formula follows directly from how a passive network acts on the creation operators. Each network sends the operator that creates a photon in input port to a superposition over the outputs,
k
Take an input occupation list , with photons entering port and photons in total. Its Fock state is . Substituting the transformed operator for every and expanding the product gives
S={,…,}
s
1
s
m
s
k
k
n=
∑
k
s
k
|S〉=!|0〉
∏
k
s
k
†
a
k
s
k
†
a
k
Build a random five-mode interferometer with a fixed seed, so the run is reproducible:
Draw the mesh the photons will cross:
Read its transfer matrix:
Confirm it equals the permanent of the matrix selected by the same input and output occupation lists:
Check the amplitude against the normalized permanent:
Computing and Checking the Full Output Distribution
Computing and Checking the Full Output Distribution
Show the five most likely output occupation lists:
Confirm the distribution has exactly that many entries:
Verify the probabilities independently as well:
The Cost of One Amplitude
The Cost of One Amplitude
For six photons in 12 modes, the three input occupation lists are:
Display the input occupation lists for six photons:
Use the same network for all three occupation patterns and keep their names as association keys:
Use photon counts up to 24 for the plot; shorten the list for a quicker run:
Run the benchmark, indexing the results first by photon count and then by occupation pattern:
Plot the cost of one QI amplitude:
From Amplitude Cost to Sampling Hardness
From Amplitude Cost to Sampling Hardness
A hard probability calculation does not by itself establish hard sampling. A sampler can avoid constructing the full distribution, and even a distribution written using permanents may admit easy samples.
This verifies the normalized single-photon distributions used by that sampler, without evaluating any permanent.
The hiding step is where the original argument needs a dilute regime, with many more modes than photons: only then does a small block of a random network look like a matrix of independent Gaussian entries. That is not a universal restriction: later work extends hardness evidence to a linear number of modes, where collisions are common (Bouland et al., 2026).
Summary and Next Questions
Summary and Next Questions
We have connected two-photon interference to normalized permanent amplitudes, checked those amplitudes and probabilities against an independent coefficient calculation, measured how photon count and occupation structure affect QI amplitude calculations, and drawn samples in which bosonic bunching is visible directly. The computations explain the optical probabilities; the cited complexity results supply the separate, conditional argument about classical sampling.
The next questions concern partial distinguishability, loss, and detector resolution, each of which changes the experiment differently. Replacing single-photon inputs by squeezed vacuum leads to Gaussian boson sampling, where hafnians take the role played here by permanents.
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
Why boson sampling is hard: Matrix permanents, multi-photon interference, and classical complexity
by Mads Bahrami
Wolfram Community, STAFF PICKS, November 2, 2026
https://community.wolfram.com/t/28486
by Mads Bahrami
Wolfram Community, STAFF PICKS, November 2, 2026
https://community.wolfram.com/t/28486