Skip to main content
. 2023 Jan 21;25(2):210. doi: 10.3390/e25020210
Algorithm 1: Transition function
  • h:={i:li>0}               ▹h is a set that contains indices of non-empty outputs

  • K:=|h|                         ▹K is the amount of non-empty outputs

  • r:=random({1,…,K})              ▹ We generate a random number 1≤r≤K

  • lhr:=lhr−1                  ▹ Decrease the number of photons in hr-th output

  • s:=random({1,…,N}∖hr)    ▹ We generate a random number 1≤s≤N such that s≠r

  • ls:=ls+1                    ▹ Increase the number of photons in s-th output

  • return |l1,l2,…,lN〉