# QuReed

Simon Sekavčnik, Kareem H. El-Safty, Janis Nötzel

(May 2024)

###### Abstract

We present QuReed, an open-source quantum simulation framework designed to
bridge gaps between quantum theory, experimental community and engineering.
With Quantum Mechanics maturing and holding significant potential beyond
quantum computing, the need for physically accurate simulations becomes
critical. QuReed offers peer-reviewed simulation models, providing researchers
and engineers with reliable tools for exploring quantum communication
protocols and applications. By facilitating cross-talk between theory and
experiments, QuReed aims to accelerate progress in the field and unlock the
transformative power of quantum mechanics in the communications industry. Its
user-friendly Python interface and comprehensive documentation ensure
widespread accessibility and usability, making QuReed a valuable resource for
advancing quantum communication technologies.

##  1 Introduction

Quantum technologies receive much attention lately, with applications in a
variety of domains from computing over sensing to data networks. In
particular, its increasing technological level of maturity brings with it a
wave of interest in applications utilizing the new possibilities. While
previous research was mostly focused on demonstrating novel concepts in
principle, the current interest is simultaneously on concrete applications. At
this point, system design requires end-to-end thinking, which typically
incorporates people of very heterogeneous backgrounds working together to
design new devices for the purpose of providing a specific service. In order
to efficiently understand the major bottlenecks in such application design,
rapid software prototyping based on components that model both theoretically
optimal behavior and at the same time the current hardware limitations is a
must. In addition, the complexity of the topic may require coordination over
different physical locations, where application design needs to be able to
formulate specific questions for highly specialized team members.

While several software tools for quantum system simulation have been developed
in the past, none of them has yet targeted the specific demands outlined
above. With QuReed, we present a software that is designed for application-
specific software prototyping with a scientific performance guarantee.

###  1.1 State of the art

####  1.1.1 Quantum Photonics

In particular the field of quantum photonics has witnessed significant
advancements in software packages that facilitate the design, simulation, and
implementation of photonic quantum systems. These software tools are crucial
for exploring the complexities of photonic quantum computing, quantum
communication, and quantum sensing.

One of the leading software packages is Strawberry Fields developed by Xanadu.
Strawberry Fields is an open-source library for continuous-variable quantum
computation using photonic circuits. It offers a suite of tools for simulating
photonic quantum circuits, including support for Gaussian states, non-Gaussian
states, and various measurement schemes such as homodyne and heterodyne
detection [1]. The library integrates seamlessly with machine learning
frameworks like TensorFlow, enabling hybrid quantum-classical workflows.

Another prominent package is Perceval, developed by Quandela. Perceval
provides a comprehensive platform for simulating and optimizing photonic
quantum circuits. It includes features for the manipulation of quantum states,
gate operations, and measurement processes. Additionally, Perceval supports
the simulation of imperfections in photonic components, which is essential for
realistic modeling of experimental conditions [2].

The QuTiP (Quantum Toolbox in Python) is also noteworthy, despite being more
general in scope. It has extensive functionalities for simulating open quantum
systems, which can be applied to photonics. QuTiP allows for the simulation of
master equations and quantum trajectories, providing valuable insights into
the decoherence and dissipation processes in photonic systems [3].

CQC’s t|ket> framework is another significant contribution. Originally
designed for superconducting qubits, it has been extended to support photonic
qubits and continuous-variable systems. t|ket> offers efficient circuit
optimization routines, which are crucial for minimizing gate operations and
enhancing the fidelity of photonic quantum circuits [4].

Furthermore, the Psi4Numpy package, although primarily aimed at quantum
chemistry, includes functionalities that are useful for simulating the
interactions of photons with molecular systems. This cross-disciplinary tool
can be leveraged to study photonic processes at the quantum mechanical level
[5].

In addition to these software tools, several specialized packages focus on
niche aspects of photonics. For example, MEEP (MIT Electromagnetic Equation
Propagation) is widely used for simulating electromagnetic wave propagation,
which is fundamental for designing photonic devices and components [6].
Photon-HDF5 is an example that caters to specific needs in photonic quantum
information processing and data management, respectively [7].

###  1.2 Quantum Network Simulators

In contrast to state of the art quantum network simulators, QuReed is intended
to be used in a bottom-up design approach where individual components and
their control hardware are the focus. Nonetheless, nontrivial quantum network
simulations can be carried out with QuReed as well. There are already a few
software packages with the goal of simulating quantum networks.

The researchers constructing classical networks have frequently relied on
various classical network simulators. Although the envisioned quantum network
is yet to materialize, efforts have been made to simulate quantum processes in
a networked manner. In this section, we introduce the key quantum network
simulators that address the challenges of quantum networking and computational
demands from diverse perspectives. We cover the projects, which are published
and the software is available to use either in open-source or closed-source
form.

####  1.2.1 QuNetSim

Quantum Network Simulator (QuNetSim) is an open-source framework built with
Python. The Python package is available on the PIP installs packages (pip)
repositories with very low configuration friction. The repository works out-of
the box with the built-in backend. When one needs to make use of any other
implemented framework, one needs to also install the backend framework, which
is also available on the pip repositories.

QuNetSim [8] is a flexible, open-source Python tool for quantum network
simulations, integrating with backends like Qiskit, ProjectQ, SimulaQron, and
EQSN. Its modular, layered approach mimics classical networks, dividing
operations into physical, network, transport, and application layers. This
enables simulation of quantum networking protocols at different abstraction
levels, with qubits managed by backend frameworks and represented as objects.

Available on pip, QuNetSim requires minimal setup and supports hardware-in-
the-loop simulation [9]. It allows researchers to effectively simulate and
analyze quantum networks, taking into account the resource demands of large-
scale qubit simulations.

####  1.2.2 QuISP

Quantum Internet Simulation Package (QuISP) [10] is an open-source package
leveraging the discrete event simulator OMNeT++ (OMNeT++) [11], primarily used
for network simulations. QuISP allows researchers to simulate large-scale
quantum networks, up to 100 independent networks with 100 nodes each, using a
novel approach to quantum state representation called Error Basis. This method
tracks deviations from the desired state as an error vector, complementing the
available stabilizer states representation, which efficiently describes a
subset of quantum states.

QuISP accurately captures quantum systems’ behavior with specific quantum
state representations and error models, enabling the study of quantum states’
impact and errors on network performance. By focusing on deviations from the
ideal state, it simulates large networks, excluding general distributed
quantum computing simulations due to the non-universality of stabilizer states
for all quantum operations. Integrating OMNeT++ provides extensive features
and robust simulation capabilities, leveraging its vast library of network
components and models.

QuISP divides quantum network operations into four layers. The Physical layer
includes quantum channels, memories, gates, measurements, and Bell state
analyzers. The Link Layer manages connections between adjacent nodes via …
(QNIC) and supports entanglement generation and swapping protocols. The
Network Layer encompasses quantum repeaters, routers, routing protocols, and
connection setup protocols. Finally, the Application layer provides protocols
for end-to-end quality analysis of quantum connections. Overall, QuISP offers
a powerful tool for simulating and analyzing quantum communication protocols
and their performance under various conditions.

####  1.2.3 SeQUeNCe

Simulator of QUantum Network Communication (SeQueNce) [12] is an open-source,
customizable discrete event framework for simulating quantum networks.
Framework is written in Python as well as c++, but end user is meant to use it
through Python interfaces. It aims to simulate the networks with the breadth
of current and future hardware technologies and protocols. It takes a
minimally opinionated approach to the design of the networks, recognizing a
lack of consensus for future quantum networks. This means that the current
layering of the classical networks is omitted. Nevertheless, the authors
introduce a modularized design consisting of five modules: hardware models,
entanglement management protocols, resource management, network management,
and application module.

The hardware models module provides the hardware models for the quantum
network devices. This module models different devices, with the aim of
accurately representing the operation characteristics of the selected
simulated hardware, such as: quantum channels, classical channels, quantum
gates, photon detectors, and quantum memories. The entanglement management
module provides models of entanglement management protocols for the quantum
network devices. This module exposes an interface for instantiating and
terminating entanglement protocols, which is further used by the resource
management module. It also provides interfaces for event notification,
notifying of events like photon detection or entanglement expiration.
Entanglement management module provides the protocols like Barret-Kok
entanglement generation protocol[13], BBPSSW purification protocol[14] and
entanglement swapping protocol[15]. The Resource management module manages
local resources of QuISP. It manages local quantum memories according to
predetermined rules. Lastly, the Network management module is tasked with the
reservation and routing.

####  1.2.4 NetSquid

The focus of The Network Simulator for Quantum Information using Discrete
events (NetSquid) lies in quantum circuit construction with a comprehensive
set of quantum gates and custom gate definitions, enhanced by C extensions via
Cython and the pyDynAA simulation engine. Its noise modeling capability
enables realistic emulation of quantum hardware, aiding in error propagation
studies and algorithm optimization.

The API supports efficient simulation orchestration, with precise control over
parameters, resource allocation, and parallelization, integrating well with
high-performance computing environments. As a proprietary tool, NetSquid
offers advanced simulation techniques valuable for researchers and developers
working on quantum algorithm implementation and performance under realistic
conditions.

####  1.2.5 SQUANCH

Simulator for QUAntum Networks and CHannels (SQUANCH) [16] is an open-source
quantum network simulator written in Python and NumPy. It allows simulation of
quantum networks with customizable error models and noisy quantum channels.
The framework introduces ”agents” as network nodes that can manipulate
distributed quantum states and uses computationally optimized methods for
handling large streams of quantum information. The entire simulation is fully
parallelized, with network nodes running in separate processes, ensuring ease
of use and rapid development.

The core class in SQUANCH is ”QSystem,” which manages multi-body maximally
entangled quantum systems represented by density matrices implemented as NumPy
arrays. Each qubit, represented by the ”Qubit” class, references the parent
QSystem and has an index number. Qubit measurements yield results in the
computational basis, with outcomes determined by the quantum state’s
probability distribution. This design ensures an intuitive and efficient
framework for simulating complex quantum networks.

####  1.2.6 SimulaQron

SimulaQron[17] is an open-source software framework for developing and testing
quantum communication protocols and algorithms. It provides a simulation
environment that mimics real quantum networks, focusing on the classical
aspects of networking to create a hardware-independent interface for quantum
processing systems. A key feature of SimulaQron is its support for
decentralized quantum simulation, enabled by integrating low-level instruction
set architecture for quantum internet applications (NetQASM), which manages
the localization of quantum simulations on a single machine.

SimulaQron uses various backends to simulate quantum effects, including a
built-in stabilizer backend, and supports integration with QuTip and ProjectQ.
The framework is designed for easy addition of new backends. However,
development activity has slowed, with the latest update in December 2021, and
it currently supports Python 3.8, while the latest Python version is 3.11.

####  1.2.7 ReQuSim

ReQuSim[18] is another simulator which falls in a domain of quantum network
simulators. ReQuSim is implemented in python and is available on pip
repository. ReQuSim framework focuses solely on simulation of quantum
repeaters, which are poised to represent the basic building block of the
future quantum networks. ReQuSim distinguishes itself from other simulators by
making use of Monte-Carlo methods as well as Discrete Event Simulation (DES)
operating principles. With these tools ReQuSim attempts to accurately model
arbitrary noise process, which can occur in the quantum repeater networks.

###  1.3 Comparison of the Simulators

Each of the presented simulators was optimized for different purpose. Some
simulators have chosen to implement the continuous simulation (QuNetSim,
SQUANCH, SimulaQron, SeQueNCe) while other have chosen the DES approach
(NetSquid, QuISP, ReQuSim). DES approach makes processes time aware, where
processes are scheduled according to how they would occur in reality, whereas
continuous simulation the events happen whenever they are requested, which
removes the accurate time description from the simulation.

Further more some simulators chose to heavily specialize for specific use
case. QuISP is built on top of existing network simulator, omitting the
possibility of simulating arbitrary quantum state. The design choice which
pays of as performance increase for the quantum states which can be simulated.
Another example of specialization is ReQuSim, which specializes for the
simulation of quantum repeater networks, allowing users to precisely analyze
different protocols ran on quantum routers.

##  2 Framework Architecture of  (QuReed): Devices, Ports and Signals

In this section we present the QuReed [19] simulation framework. QuReed
differentiates from other existing simulators, by focusing heavily on the
optical state simulation. Already available simulators focus on implementing
different functionalities in the confines of the qubit Hilbert spaces, whereas
QuReed gives the user the ability to represent optical states. Further more,
it introduces the notion of modular, inter-connectable devices which perform
quantum (or classical) operations with quantum or classical signals. This
design choice, gives the user the ability to simulate complex experimental
systems with fine-grained control, while abstracting away tedious management
of quantum states.

The QuReed framework is designed to facilitate robust interactions between
different software components. The section outlines the architectural choices
underlying the QuReed framework, which is structured around three fundamental
elements: Devices, Ports, and Signals. These elements ensure that the
framework supports a modular and extendable approach to system design.

Each component within the framework architecture relies on the concept of the
minipage

Figure 1: Illustration of interconnected Devices, Ports and Signals in the
QuReed Framework.

###  2.1 Devices

Devices in the QuReed framework represent individual units of functionality or
modules within a larger system. In principle a device in the QuReed framework
serves as a digital twin to a device one might find on an optical table in a
laboratory. All implemented devices must extend an existing class api through
ports. This separation not only isolates the internal implementation of the
device from its external interactions but also streamlines system integration
and scalability.

###  2.2 Ports

Ports are the conduits through which devices expose their functionalities and
communicate with external environment or other devices. Each port in the
QuReed framework is designed to serve as a gateway that strictly regulates the
type of data or more precisely Signals Signals in the QuReed framework are the
predefined units of information transmitted through ports between devices.
These signals are critical for maintaining the integrity and security of data
exchanges within the system. The framework ensures that all communications
adhere to a consistent format and semantic, facilitating error-free data
transmission and processing. To accommodate the specific needs of various
applications, the QuReed framework allows for the implementation of custom
signals. This flexibility is crucial for adapting the system to diverse
operational requirements and enhancing its applicability across different
technological and research domains.Implementing custom signals involves
defining new data types and ensuring that these types are compatible with the
existing ports and devices in the framework. Custom signals must adhere to the
framework’s strict guidelines on data formats and property definitions. The
adherence is essential to prevent conflicts and errors in data handling,
ensuring that even custom implementations integrate seamlessly with the core
functionality of the QuReed system. By allowing custom signals, the framework
not only enhances its flexibility but also its capability to handle
specialized tasks that are not covered by the standard signal types. The
definition and management of signals, whether standard or custom, are tightly
controlled to optimize performance and minimize overhead. This control makes
the framework efficient and effective in handling complex interaction between
diverse devices.

###  2.3 Signal Inheritance and Port Compatibility

In the QuReed framework, signals are designed with an inheritance structure
that facilitates flexibility and extensibility. This design allows for the
creation of specific signal types that extend from more generic ones, adhering
to object-oriented principles that promote reusability and scalability. For
instance, consider a hierarchy where GenericQuantumSignal extends
PhotonicQuantumSignal might extend GenericQuantumSignal can inherently accept
any of its subclasses, such as Discrete Event Simulation The QuReed framework
incorporates a DES engine that provides advanced simulation capabilities for
backend systems that utilize the DES methodology. While the framework supports
multiple backends, not all are required to use the DES approach. However, for
those that do, the DES engine offers a powerful tool for accurately simulating
complex interactions between devices within the system with time awareness.

####  2.3.1 Operation of the DES Engine

The DES approach is employed in the following manner within the QuReed
framework:

  1. 1.

Start of Simulation: When a simulation is ran, a user defines how long in
terms of simulated time, the simulation should last. Due to precision needed,
the time is denoted in a higher precision, than allowed by built in float
type. To track time we make use of _mpmath_ library[20]. The simulation
concludes, when wither timestamp of next event is larger then set simulation
time or the event queue is empty.

  2. 2.

Initial Event Triggering: At the start of the simulation devices, which
implement a method Event Handling by Devices

: In order for a device to provide functionality in the scope of DES, it must
implement a method Event Scheduling: The methods of des_init, must be
decorated using provided decorator Event Merging: If a device receives
multiple inputs at the same timestamp, these events are automatically merged
by the simulation engine. This merging is critical as it allows the device to
process multiple simultaneous inputs effectively.

###  2.4 Backends

The QuReed framework employs a structured approach to implementing and
integrating devices, relying on backends to simulate quantum mechanics
effectively. QuReed is equipped with a built-in backend — the Fock Backend —
and provides the flexibility to incorporate additional backends, such as
Hamiltonian or Gaussian, in future updates. Additionally, QuReed relies
heavily on an external backend, Photon Weave, to extend its simulation
capabilities.

####  2.4.1 Built-in Fock Backend

The Fock Backend is integral to QuReed, specializing in simulations involving
quantum states in Fock space. This backend is tailored to scenarios that
require precise manipulation of number states. Unlike other backends, built-in
Fock backend does not sequence operations over time. Instead, it prepares the
initial quantum states and executes all gates in the right order at once,
providing users with post-experiment statistics. This method ensures efficient
handling of static quantum simulations where temporal dynamics are not the
focus.

####  2.4.2 External Photon Weave Backend

to augment its native capabilities, QuReed integrates with Photon Weave as an
external backend. This system encodes temporal modes in both Fock and
Polarization spaces. Photon Weave is specifically designed to align with the
DES paradigm, enabling dynamic quantum simulations. This backend proves
particularly effective for simulating intricate quantum effects such as Hong-
Ou-Mandel effect [21].

##  3 Use Cases

The use cases covered in QuReed have been systematically aggregated (following
the principle of lean software development) based on a list of so-called user
stories which can in full detail be found in the appendix. In this section we
bring to light some of the experiments simulated using the QuReed.

###  3.1 Information Theoretical Joint Detection

For first interesting experiment to showcase the capabilities of QuReed we
choose information theoretical joint detection data transmission, following
the sequential decoding method described in [22] but with an encoding where
Binary Phase Shift Keying (BPSK) is used for the generation of signals. The
joint detection data transmission displays a logarithmic advantage over
conventional data transmission [23]. The transmission of a message is
accomplished by phase modulating a number $P$ of coherent pulses. After
receiving the pulses, the receiver tries to decode the message via the
sequential decoding method. It iteratively applies a set of phase shifts
$(\phi_{1},\ldots,\phi_{P})$ where each phase shift can take value in
$\phi\in\\{0,\pi\\}$. More precisely, the receiver goes through the list
$\\{((-1)^{b_{0}}\pi,\ldots,(-1)^{b_{P}}\pi)\\}_{b1,\ldots,b_{P}\in\\{0,1\\}}$
in lexicographic order. In each round, it first applies the corresponding
series $((-1)^{b_{0}}\pi,\ldots,(-1)^{b_{P}}\pi)$ of phase shifts, followed by
execution of a Positive Operator-Valued Measure (POVM) with two outcomes $Y$
and $N$. If the outcome is $Y$, the receiver declares the message to be the
$m$ with binary representation $b_{1}\ldots b_{P}$ and stops. If the outcome
is $N$, the receiver applies the inverse phase shift
$(-(-1)^{b_{0}}\pi,\ldots,-(-1)^{b_{P}}\pi)$ and proceeds to the next sequence
$((-1)^{b_{0}^{\prime}}\pi,\ldots,(-1)^{b_{P}^{\prime}}\pi)$ in the list. The
POVM measurement is defined with the following operators:

$\displaystyle M_{Y}$ $\displaystyle=\ket{0}\bra{0}^{\otimes P}$
$\displaystyle M_{N}$ $\displaystyle=\mathbb{I}-M_{1}.$ (1)

The full data transmission procedure is implemented using QuReed, and the
simulation setup is illustrated in Figure 2. We limit our simulation to $P=3$
pulses. The consecutive coherent pulses are created by displacing vacuum
state:

$\ket{\alpha}=\mathcal{D}(\alpha)\ket{0}=e^{\alpha\hat{a}^{\dagger}-\alpha^{*}\hat{a}}\ket{0},$
(2)

where a value $\alpha=0.4$ is chosen in order to have a low dimensional
representation of the system and thereby limit the computational complexity of
the simulation. After pulse creation we encode the message $m$ into the pulse
by first creating its binary representation $b_{1},\ldots,b_{P}$ and then
individually phase shifting the pulses by $\phi_{p}=(-1)^{b_{p}}\pi$. In the
Figure 3, we display the progressive change of the Wigner plots for the three
pulses as the decoder tries to guess the message. For this experiment we
arbitrarily chose the code word $m=3$. With this code word the measurement
device should yield measurement result $Y$ on the third try.

Figure 2: Illustrated configuration for the simulation of joint detection
receiver. Three pulses are denoted by three separate lines, flowing from the
coherent light source. Sender encodes code word by selecting specific phase
for each pulse. Receiver displaces each pulse by specific $\alpha_{p}$, which
defines the guess of the code word. Then the pulses enter the POVM measurement
device. In case vacuum was measured, the device has effectively guessed the
code word. If vacuum was not measured, then the pulses is fed back into to the
displace for another guess.
Figure 3: Wigner plots of individual three pulses after encoding, after first
measurement and after second measurement. On the third measurement, the
detector accurately measures vacuum, signaling the correct guess of code word.
Due to relatively small $\alpha=0.4$ the pulses are subject to noise as can be
seen in the second pulse evolution.

###  3.2 Graphical User Interface

The QuReed framework ships with a graphical user interface (GUI), which is a
preferred way of interacting with the simulations. The GUI simplifies
management complex simulation setups, by providing an interactive way of
configuring the individual components of the simulated experiment. The GUI is
a critical component that bridges the gap between advanced quantum simulations
and user accessibility, ensuring both novice and expert users can effectively
utilize the framework. Further more the GUI enhances collaboration. Instead of
collaborating on a lengthy code block, users could immediately understand how
devices are interconnected and what are the simulation conditions. The
interface is structured in a way to seamlessly guide users through the
workflow of configuring and running each simulation. It gives user intuitive
way of implementing custom devices and signals and makes them immediately
usable inside of the larger experiment. Implemented custom devices can be
dragged from the left panel into any simulation scenario.

Figure 4: Graphical User Interface of QuReed framework, allows for connecting
devices and implementing new custom devices.

##  4 Conclusions

In this work we presented QuReed, which is a modular, robust and user-friendly
simulation tool. QuReed bridges the gap between theoretical quantum mechanics
and practical engineering applications. Key contributions of this work are:

  1. 1.

Enhanced Simulation Capabilities: QuReed integration of DES engine allows for
precise timing and handling of events, making it possible to accurately model
complex interactions between quantum (and classical) devices. This capability
is crucial for developing and testing optical quantum communication protocols.

  2. 2.

Modular Design: The framework’s use of Devices, Ports and Signals ensures a
modular approach to system design. This modularity facilitates the creation of
complex experimental setups and the easy integration of new components,
promoting flexibility and scalability.

  3. 3.

Focus on Optical State Simulation: By concentrating on optical state
simulation, although not omitting general Hilbert spaces, QuReed addresses a
niche that other quantum network simulators often overlook. This design choice
is essential for advancing quantum communication technologies.

  4. 4.

Comprehensive User Interface: The inclusion of a GUI enhances accessibility
and usability. The GUI simplifies the process of setting simulation parameters
and connecting the devices in desired fashion.

In conclusion, QuReed stands out as a comprehensive and versatile quantum
simulation tool that meets the demands of both theoretical exploration and
practical application engineering. Its robust architecture, extensive
simulation capabilities, and user-friendly interface make it an asset for
advancing the field of quantum communication. By facilitating cross-
disciplinary collaboration and providing reliable simulation models, QuReed
aims to accelerate progress in the field.

## Acknowledgement

This work was financed by the Federal Ministry of Education and Research of
Germany via grants 16KIS1598K, 16KISQ039, 16KISQ077 and 16KISQ168 as well as
in the programme of “Souverän. Digital. Vernetzt.”. Joint project 6G-life,
project identification number: 16KISK002. We acknowledge further funding by
the DFG via grant NO 1129/2-1, and by the Bavarian Ministry for Economic
Affairs (StMWi) via the project 6GQT and by the Munich Quantum Valley. We
acknowledge insightful discussions with our colleagues Paul Kohl, Davide Li
Calsi and Shahram Dehdashti, and with Matheus Ribeiro-Sena.

##  Appendix A Continuous Variable Description

####  A.0.1 Fock Backend

In quantum mechanics (QM), particles can be categorized as fermionic or
bosonic. A big portion of the literature about QC and the industry focuses on
the formalism of the two-level system denoted by the $\ket{0}$ and $\ket{1}$
states and can be efficiently described by a complex Hilbert space denoted by
$\mathcal{H}$ spanning all the possible combinations of these states. It’s
also called the discrete model of QC. The physical realization for such a
system would be Superconducting qubits or Ion-Trapped qubits, however other
hardware implementations are also considered like $\cdots$. With an
appropriate set of operators or gates and enough number of qubits, this
formalism can simulate any classical function.
On the other hand, quantum computers that use bosonic particles such as
photons to simulate a quantum process or to perform a logical operation, do
have a higher degree of freedom in terms of the number of particles that can
be within a single state and the fact that we can have a system that is
composed of different states and each state has different $N$ particles. To
explain this visually, let’s consider a Harmonic Oscillator (HO) with mass $m$
moving inside a quadratic potential energy function of displacement

$V(x)=\frac{1}{2}kx^{2},$ (3)

its Schrödinger equation will be

$E\psi(x)=-\frac{\hbar^{2}}{2m}\frac{d^{2}}{dx^{2}}\psi(x)+\frac{1}{2}kx^{2}\psi(x).$
(4)

The eigenstates of equation (4) can be written in terms of the Hermite
polynomials as

$\psi_{n}(x)=\mathcal{N}_{n}H_{n}(x)e^{-x^{2}/2},$ (5)

where $\mathcal{N}_{n}=(\sqrt{\pi}2^{n}n!)^{-1/2}$ is a normalization factor,
$H_{n}$ is the Hermite polynomial of order $n$, and $n\in\mathbb{N}$ is the
quantum number. The eigenvalues can be computed as a function of $n$

$E_{n}=\hbar\omega\Big{(}n+\frac{1}{2}\Big{)},$ (6)

where $\omega$ is the angular frequency that is dependent on $k$ and $m$.
Figure 5, depicts the different energy levels and the associated quanta
particles in each level for a single quantum HO. In this manner we can
describe a single quantum HO as an equivalent to a single qubit. From such
analogy, it’s obvious that there are much more degrees of freedom in the
photonic system than the qubit one has. If there are multiple disjoint quantum
HOs for a system, then a special Hilbert space must be introduced to
efficiently describe the quantum system.

Figure 5: Different energy levels of a Quantum HO. By setting $\hbar$ and
$\omega$ to be $1$, equation (6) will be $(n+0.5)$. This is the reason for the
shifted energy level at $n=0$. It’s also obvious that each energy level is
equally spaced.

Named after Vladimir A. Fock, the Fock space was introduced in 1932. For a
Hilbert space $\mathcal{H}$ that contains a single particle or a quantum state
that could be either $\ket{0}$ or $\ket{1}$, the tensor product
$\mathcal{H}\otimes\mathcal{H}$ will be the space that fully characterizes the
quantum states of the same two particles within it. One can generalize this to
$\mathcal{H}^{\otimes N}=\otimes_{k=1}^{N}\mathcal{H}_{k}$ for $n$ particles.
Since we focus on photonic QC, we shall focus on the bosonic Fock space which
is also called the symmetrized tensor product of Hilbert spaces. A single mode
state can be decomposed into the Fock basis as follows:

$\ket{\psi}=\sum_{n}c_{n}\ket{n},$

if there exists a unique integer $m$ such that

$\begin{cases}c_{n}=1&n=m\\\ c_{n}=0&n\neq m\end{cases},$

then the single mode is simply a Fock state or $n$ photon state. When working
with an $N$-mode density matrix in the Fock basis,

$\rho=\sum_{n_{1}}\cdots\sum_{n_{N}}c_{n_{1},\cdots,n_{N}}\ket{n_{1},\cdots,n_{N}}\bra{n_{1},\cdots,n_{N}}.$

We use the convention that every pair of consecutive dimensions corresponds to
a subsystem; i.e.,

$\rho_{\underbrace{ij}_{\text{mode}\leavevmode\nobreak\ 0}\leavevmode\nobreak\
\underbrace{kl}_{\text{mode}\leavevmode\nobreak\ 1}\leavevmode\nobreak\
\underbrace{mn}_{\text{mode}\leavevmode\nobreak\ 2}}$

######  Definition 1 (Bosonic Fock Space)

A Bosonic Fock space is the sum of all symmetrized tensor products of a single
particle Hilbert space $\mathcal{H}$

$\mathcal{F}=\bigoplus_{n=0}^{\infty}\mathcal{H}^{\odot n},$ (7)

and the symmetrized tensor product $\odot$ is given by $\frac{1}{n!}\sum_{e\in
V_{n}}y_{e(1)}\odot y_{e(2)}\odot\cdots\odot y_{e(n)}$ where
$V_{n}=\\{1,2,\cdots,n\\}$ is the set of permutations and $y\in\mathcal{H}$.

According to definition (1), if we have a quantum system of $3$ particles and
$4$ modes then the state $\psi$ can be written as $|0,1,1,1\rangle$,
$|0,3,0,0\rangle$, $|1,0,2,0\rangle$, or any other combination as long as the
total number of particles is equal to $3$. It’s clear that the Fock space
enables us to express the possibility of evaluating the expectation values of
finding $N$ particles in a specific eigenstate, i.e., it becomes natural to
calculate the mean photon number of a specific quantum state.

###  A.1 Field Operators

While developing the second quantization formalism of quantum mechanics, Paul
Dirac has introduced the field operators to be used instead of wavefuncitons.
There are two important field operators; the annihilation operator and its
adjoint the creation operator denoted by $\hat{a}$ and $\hat{a}^{\dagger}$
respectively. The creation operator or the raising operator is used to increse
the number of particles in a quantum system. On the other hand, the lowering
operator or annihilation operator is used to remove a particle from a quantum
system. These operators satisfy the bosonic commutation relations

$[\hat{a}_{i},\hat{a}_{j}^{\dagger}]=\hat{a}_{i}\hat{a}_{j}^{\dagger}-\hat{a}_{j}^{\dagger}\hat{a}_{i}=\delta_{ij}.$
(8)

The matrix representation of the creation operator is

$\hat{a}^{\dagger}=\begin{bmatrix}0&0&0&0&\cdots\\\ \sqrt{1}&0&0&0&\cdots\\\
0&\sqrt{2}&0&0&\cdots\\\ 0&0&\sqrt{3}&0&\cdots\\\
\vdots&0&0&\ddots&0\end{bmatrix}.$ (9)

There are also two important operators that represent the position and the
momentum of a quantum system denoted by $\hat{x}$ and $\hat{p}$ respectively.
They are given as

$\hat{x}=\sqrt{\frac{\hbar}{2}}(\hat{a}+\hat{a}^{\dagger}),\leavevmode\nobreak\
\leavevmode\nobreak\ \leavevmode\nobreak\
\hat{p}=-i\sqrt{\frac{\hbar}{2}}(\hat{a}-\hat{a}^{\dagger}),$ (10)

and they fulfil the commutation relation

$[\hat{x}_{i},\hat{p}_{j}]=i\hbar\delta_{ij}.$ (11)

In a Fock space of $0$ particles or a Vacuum state denoted by $\ket{0}$, the
effect of the ladder operators $\hat{a}$ and $\hat{a}^{\dagger}$ is

$\hat{a}\left|0\right\rangle=0,\leavevmode\nobreak\ \leavevmode\nobreak\
\leavevmode\nobreak\
\hat{a}\left|n\right\rangle=\sqrt{n}\left|n-1\right\rangle\leavevmode\nobreak\
\leavevmode\nobreak\ \text{(for}\leavevmode\nobreak\ n\geq 1\text{),}$ (12)

and

$\hat{a}^{\dagger}\left|n\right\rangle=\sqrt{n+1}\left|n+1\right\rangle\leavevmode\nobreak\
\leavevmode\nobreak\ \text{(for}\leavevmode\nobreak\ n\geq 0\text{).}$ (13)

Using equation (13) one can create any number state or a Fock state from the
Vacuum state as follows

$|n\rangle=\frac{(\hat{a}^{\dagger})^{n}}{\sqrt{n!}}|0\rangle.$ (14)

The ladder operators can also form a hermitian operator called the Number
Operator denoted by

$\hat{n}=\hat{a}^{\dagger}\hat{a}.$ (15)

###  A.2 Linear Passive Operators in the Fock Space

There is a unitary operator called the Beamsplitter. The Beamsplitter operates
on two quantum modes instead of one. It’s defined as

$\mathcal{B}(\theta,\phi)=\exp\left(\theta(e^{i\phi}\hat{a_{1}}\hat{a_{2}}^{\dagger}-e^{-i\phi}\hat{a_{1}}^{\dagger}\hat{a_{2}})\right).$
(16)

The effect on the ladder operators is given by

$\begin{split}\mathcal{B}^{\dagger}(\theta,\phi)\hat{a_{1}}\mathcal{B}(\theta,\phi)&=t\hat{a_{1}}-r^{*}\hat{a_{2}},\\\
\mathcal{B}^{\dagger}(\theta,\phi)\hat{a_{2}}\mathcal{B}(\theta,\phi)&=t\hat{a_{2}}+r\hat{a_{1}},\end{split}$
(17)

where $t=\cos{\theta}$ is the transmittivity and here $r$ is the reflectivity
amplitude and equals $e^{i\phi}\sin{\theta}$. When $\theta=\pi/4$ and $\phi=0$
or $\phi=\pi$, the resulting operator is a 50-50 Beamsplitter. It’s clear that
the Beamsplitter is not an active operator since it doesn’t increase the
photon number in the quantum system.
The Rotation operator denoted by $\mathcal{R}(\phi)$ is a single mode operator
that has the following transformation on the lowering operator

$\mathcal{R}(\phi)=\exp\left(i\phi\hat{a}^{\dagger}\hat{a}\right).$ (18)

It’s a passive linear operator that rotates the quadrature operators depending
on $\phi$.

###  A.3 Coherent States

The Glauber States or as widely known as the Coherent States (CS) of light are
specific quantum states of the quantum harmonic oscillator. They can be used
to describe the dynamics of a state whose ground state has been displaced from
the origin. One of the main applications of CS is laser physics. CS can be
generated by applying the Displacement operator [24]

$\mathcal{D}(\alpha)=\exp(\alpha\hat{a}^{\dagger}-\alpha^{*}\hat{a})$ (19)

on a Vacuum state where $\alpha\in\mathbb{C}$ is the value of the complex
displacement and $\alpha=re^{i\theta}$ where $r\in\mathbb{R}$ is the amplitude
of the displacement and $\theta\in[0,2\pi)$ is the phase of the displacement.
Setting $\alpha$ to be $0$ will be the same as the Vacuum state $|0\rangle$.
In terms of the Fock space representation, the CS can be denoted as

$\begin{split}|\alpha\rangle&=\exp(-\frac{|\alpha|^{2}}{2})\exp(\alpha\hat{a}^{\dagger})\exp(-\alpha^{*}\hat{a})|0\rangle\\\
&=\exp(-\frac{|\alpha|^{2}}{2})\exp(\alpha\hat{a}^{\dagger})|0\rangle\\\
&=\exp(-\frac{|\alpha|^{2}}{2})\sum_{n=0}^{\infty}\frac{\alpha^{n}}{\sqrt{n!}}|0\rangle.\end{split}$
(20)

The CS $|\alpha\rangle$ is a right eigenstate of the lowering operator
$\hat{a}$ with an eigenvalue $\alpha$ which implies
$\hat{a}|\alpha\rangle=\alpha|\alpha\rangle$. On the other hand the CS
$|\alpha\rangle$ is a left eigenstate of the raising operator
$\hat{a}^{\dagger}$ which can be denoted by
$\langle\alpha|\hat{a}^{\dagger}=\alpha^{*}\langle\alpha|$. The former two
results can be summarized as

$\mathcal{D}^{\dagger}(\alpha)\hat{a}\mathcal{D}(\alpha)=\hat{a}+\alpha\boldsymbol{I},$
(21)
$\mathcal{D}^{\dagger}(\alpha)\hat{a}^{\dagger}\mathcal{D}(\alpha)=\hat{a}^{\dagger}+\alpha^{*}\boldsymbol{I}.$
(22)

The same can be shown for the quadrature operators $\hat{x}$ and $\hat{p}$

$\begin{split}\mathcal{D}^{\dagger}(\alpha)\hat{x}\mathcal{D}(\alpha)=\hat{x}+\sqrt{2\hbar}\operatorname{Re}(\alpha)\boldsymbol{I},\\\
\mathcal{D}^{\dagger}(\alpha)\hat{p}\mathcal{D}(\alpha)=\hat{p}+\sqrt{2\hbar}\operatorname{Im}(\alpha)\boldsymbol{I}.\end{split}$
(23)

Using equations (21) and (22), the expectation value of the number operator
$\hat{n}$ can be found as

$\begin{split}\bra{\alpha}\hat{n}\ket{\alpha}&=\bra{0}\mathcal{D}^{\dagger}(\alpha)\hat{n}\mathcal{D}(\alpha)\ket{0}\\\
&=\bra{0}(\hat{a}^{\dagger}+\alpha^{*})(\hat{a}+\alpha)\ket{0}\\\
&=|\alpha|^{2}\end{split}$ (24)

The inner product $\braket{.,.}$ between two CSs $\ket{\alpha}$ and
$\ket{\beta}$ is given as

$\braket{\alpha,\beta}=\exp(-\frac{|\alpha|^{2}}{2})\exp(-\frac{|\beta|^{2}}{2})\sum_{n=0}^{\infty}\sum_{m=0}^{\infty}\frac{\beta^{n}}{\sqrt{n!}}\frac{(\alpha^{*})^{m}}{\sqrt{m!}},$
(25)

which can be rewritten in a compact form as

$|\braket{\alpha,\beta}|^{2}=\exp(-|\alpha-\beta|^{2}).$ (26)

It’s clear that equation (26) will evaluate to $1$ if and only if
$\alpha=\beta$. In case of having a large difference between the displacement
values, equation (26) can be approximated to $0$.

###  A.4 Squeezed States

Discovered by Earle Hesse Kennard, Squeezed light states are a type of non-
classical states of light that allow to have low uncertainty or noise below
the standard quantum limit in one of the quadrature operators while the other
quadrature has an increased uncertainty. Thus, a squeezing operation obeys the
Heisenberg principle and introduces a new prospective to the typical CS
characteristics that can be considered as a classical Gaussian wave-packet.
It’s mostly used in Quantum Sensing, Radiometry, and Entanglement-based
quantum key distribution. The squeezing operator $S(z)$ is [24]

$\mathcal{S}(z)=\exp\left(\frac{1}{2}\left(z^{*}\hat{a}^{2}-z\hat{a}^{\dagger^{2}}\right)\right),$
(27)

where $z=re^{i\phi}$, with $r\in[0,\infty)$ and $\phi\in[0,2\pi)$. A Squeezed
state is generated by applying the squeezing operator to a Vacuum state

$\begin{split}\ket{z}&=\mathcal{S}(z)\ket{0}\\\ &=\sqrt{\sech
r}\sum_{n=0}^{\infty}\frac{\sqrt{(2n)!}}{2^{n}n!}(-e^{i\phi}\tanh
r)^{n}\ket{2n}.\end{split}$ (28)

The effect of the squeezing operator on the ladder operators is

$\begin{split}\mathcal{S}^{\dagger}(z)\hat{a}\mathcal{S}(z)&=\hat{a}\cosh(r)-\hat{a}^{\dagger}e^{i\phi}\sinh(r),\\\
\mathcal{S}^{\dagger}(z)\hat{a}^{\dagger}\mathcal{S}(z)&=\hat{a}^{\dagger}\cosh(r)-\hat{a}e^{-i\phi}\sinh(r),\end{split}$
(29)

and the transformation on the quadrature operators is given by

$\mathcal{S}^{\dagger}(z)\hat{x}_{\phi}\mathcal{S}(z)=e^{-r}\hat{x}_{\phi},\leavevmode\nobreak\
\leavevmode\nobreak\ \leavevmode\nobreak\
\mathcal{S}^{\dagger}(z)\hat{p}_{\phi}\mathcal{S}(z)=e^{r}\hat{p}_{\phi}$ (30)

Using the above transformation, one can compute the mean photon number of a
Squeezed state as

$\begin{split}\bra{z}\hat{n}\ket{z}&=\bra{0}\mathcal{S}^{\dagger}(z)\hat{a}^{\dagger}\hat{a}\mathcal{S}(z)\ket{0}\\\
&=\bra{0}\left(\hat{a}^{\dagger}\cosh(r)-\hat{a}e^{-i\phi}\sinh(r)\right)\left(\hat{a}\cosh(r)-\hat{a}^{\dagger}e^{i\phi}\sinh(r)\right)\ket{0}\\\
&=\sinh{r}^{2},\end{split}$ (31)

and the inner product between two Squeezed states can be calculated as

$\braket{z_{1},z_{2}}=\frac{1}{\sqrt{\cosh{r_{1}}\cosh{r_{2}}-e^{i(\phi_{1}-\phi_{2})}\sinh{r_{1}}\sinh{r_{2}}}}.$
(32)

###  A.5 Displaced Squeezed States

Combining the action of the Squeezing (27) and the Displacement operators
(19), a Displaced Squeezed State (DSS) which is denoted by $\ket{\alpha,z}$
can be obtained by squeezing a Vacuum state and then displacing it as

$\ket{\alpha,z}=\mathcal{D}(\alpha)\mathcal{S}(z)\ket{0},$ (33)

and by using equations (19), (20), (27), and (28), the DSS can be expressed in
terms of the Fock basis [24]

$\ket{\alpha,z}=e^{-\frac{1}{2}|\alpha|^{2}-\frac{1}{2}{\alpha^{*}}^{2}e^{i\phi}\tanh{(r)}}\sum_{n=0}^{\infty}\frac{\left[\frac{1}{2}e^{i\phi}\tanh(r)\right]^{n/2}}{\sqrt{n!\cosh(r)}}H_{n}\left[\frac{\alpha\cosh(r)+\alpha^{*}e^{i\phi}\sinh(r)}{\sqrt{e^{i\phi}\sinh(2r)}}\right]\ket{n},$
(34)

since the transformation on the ladder operators is given by

$\begin{split}\mathcal{D}(\alpha)\mathcal{S}(z)\hat{a}\mathcal{D}^{\dagger}(\alpha)\mathcal{S}^{\dagger}(z)&=(\hat{a}-\alpha)\cosh{r}+(\hat{a}^{\dagger}-\alpha^{*})e^{i\phi}\sinh{r},\\\
\mathcal{D}(\alpha)\mathcal{S}(z)\hat{a}^{\dagger}\mathcal{D}^{\dagger}(\alpha)\mathcal{S}^{\dagger}(z)&=(\hat{a}^{\dagger}-\alpha^{*})\cosh{r}+(\hat{a}-\alpha)e^{-i\phi}\sinh{r}.\end{split}$
(35)

Similarly, the mean photon number of the DSS can be obtained by a unitary
transformation as in equations (24) and (31)

$\bra{\alpha,z}\hat{n}\ket{\alpha,z}=\sinh^{2}{r}+|\alpha|^{2}.$ (36)

The inner product between two DSSs is [25]

$\bra{\alpha_{1},z_{1}}\alpha_{2},z_{2}\rangle=\beta_{21}^{-\frac{1}{2}}\exp\left\\{\frac{\gamma_{21}\gamma_{12}^{*}}{2\beta_{21}}+\frac{(\alpha_{2}\alpha_{1}^{*}-\alpha_{2}^{*}\alpha_{1})}{2}\right\\},$
(37)

where
$\beta_{21}=\cosh{r_{2}}\cosh{r_{1}}-e^{i(\phi_{2}-\phi_{1})}\sinh{r_{2}}\sinh{r_{1}}$
and
$\gamma_{21}=(\alpha_{2}-\alpha_{1})\cosh{r_{2}}+e^{i\phi_{2}}(\alpha_{2}^{*}-\alpha_{1}^{*})\sinh{r_{2}}$.
It’s obvious that when $\alpha=0$, the right-hand side will become identical
to equation (32) and when $z=0$ the inner product will be similar to equation
(26). The squeezing part does play an important role in discriminating two
quantum states since the CS are not orthogonal from their definition in
section A.3.

###  A.6 Non-Gaussian States

From a computational point of view, a generalized DSS can be fully
characterized by its Gaussian formalism with the Quadrature operators ordered
in a vectorial form and a Covariance matrix that describes the correlations
between different modes in a quantum system. This means that a DSS can be
efficiently simulated by a classical computer. In Fact, any quadratic
Hamiltonian can be decomposed into Squeezing, Displacement, Rotation, and
Beamsplitter operators.
On the other hand, the Fock state or the Number state is not a Gaussian state.
Moreover, higher-order Hamiltonians are required for a universal model of
computation. This means that there should be an operator that contains higher-
order terms. For instance, the Cubic Phase operator is denoted by
$\mathcal{V}(\Gamma)=\exp\left\\{i\frac{\Gamma}{3\hbar}\hat{x}^{3}\right\\}$
where $\Gamma\in\mathbb{R}$. It transforms the lowering operator by the
following formula
$\mathcal{V}^{\dagger}(\Gamma)\hat{a}\mathcal{V}(\Gamma)=\hat{a}+i\frac{\Gamma}{2\sqrt{2/\hbar}}(\hat{a}+\hat{a}^{\dagger})^{2}$.
Utilizing such an operator along with the other linear operators will allow us
to decompose higher-order Hamiltonians and simulate them efficiently on a
photonic quantum computer [26].

(a) Vacuum State

(b) Fock State of $\ket{1}$

(c) DSS

(d) A non-gaussian state denoted by $\mathcal{V}(\Gamma)\mathcal{S}(z)\ket{0}$

Figure 6: The Wigner function distributions for different Fock states.

To visually express the quantumness arising from non-gaussian operators and to
also study different Fock states, the Wigner Function or the QuReed-
probability distribution is a systematic method to describe them in terms of
the phase-space formalism. Furthermore, the Wigner function is real-valued and
encompasses the whole quadrature field operators. It can be calculated using a
pure or a mixed state. The Wigner function is defined as

$W(x,p)=\frac{1}{\pi\hbar}\int_{-\infty}^{\infty}\psi^{*}(x+y)\psi(x-y)e^{2ipy/\hbar}dy$
(38)

From figure 6 and equation (38), we can detect a non-gaussian state by looking
at the negative part of the QuReed-probability distribution. As expected,
Squeezed, Displaced, Displaced Squeezed, and Vacuum states have a positive
real-valued outcome. However, any Fock state that has a non-gaussian operation
like Cubic phase or Number states, dose have a negative real-valued outcome
from the Wigner function.

###  A.7 Typical Measurements

####  A.7.1 Homodyne and Heterodyne Measurements

Homodyne and heterodyne measurements are standard detection techniques in
optical setups, both of which preserve the Gaussian nature of the state after
measurement. Homodyne measurement involves measuring the operator

$\hat{x}_{\phi}=\cos(\phi)\hat{x}+\sin(\phi)\hat{p}$ (39)

with the resulting probability density given by

$p(x_{\phi})=\langle x_{\phi}|\rho|x_{\phi}\rangle,$ (40)

where $x_{\phi}$ represents the eigenvalues of $\hat{x}_{\phi}$. Conversely,
in heterodyne measurement, the probability density is given by

$p(x_{\phi})=\frac{1}{\pi}\operatorname{Tr}\left[\rho|\alpha\rangle\langle\alpha|\right].$
(41)

In optical setups, heterodyne measurement is performed by mixing the state
$\rho$ with a vacuum state $\ket{0}$ and then subtracting the detected
intensities of the two outputs. The mixing is performed using a 50:50
beamsplitter.

####  A.7.2 Particle Number Measurement

Particle number measurement, also known as photon detection, is a non-Gaussian
projective measurement carried out using number-resolving detectors. The
probability of detecting particle numbers
$\mathbf{n}=(n_{1},n_{2},\ldots,n_{d})$ is given by

$p(\mathbf{n})=\operatorname{Tr}\left[\rho|\mathbf{n}\rangle\langle\mathbf{n}|\right].$
(42)

The outcomes are non-negative integer values representing the detected photon
numbers.

##  Appendix B Devices

In order to provide initial functionalities, QuReed ships with some idealized
versions of quantum devices. In this appendix section we distill some of their
implementations.

###  B.1 Ideal Fiber

The most important component in optics simulation is a fiber. Fiber represents
a way of connecting different devices in an experiment. The effect of the
fiber on the quantum state is in the phase shift, which occurs due to the time
difference between input and output of the states. Ideal fiber component is
totally defined by its length $l$ and the refractive index of its core $n$. We
assume the refractive index of the fiber core $n=1.45$[27].In addition to
that, the ideal fiber is lossless. With the length and refractive index given,
one can compute time $\tau$ each envelope will spend in the fiber. First the
speed of light in the fiber can be computed via $c^{\prime}=\tfrac{c}{n}$ and
the time can then be computed with $\tau=\tfrac{l}{c^{\prime}}$. The time
$\tau$ then dictates the phase shift of the quantum state [28]:

$\hat{U}_{F}=\exp(i\omega\tau\hat{n}),$ (43)

where the $\omega$ is the central frequency of the photon transversing the
fiber [29] and $\hat{n}=\hat{a}^{\dagger}a$ is the number operator. According
to this theory we then implement the ideal fiber model.

⬇

class IdealFiber(GenericFiber):

# …

@log_action

@schedule_next_event

def des(self, time, *args, **kwargs):

signals = kwargs.get(’signals’, {})

if ”length” in signals:

self.length = float(signals[”length”].contents)

elif ”input” in signals:

n = 1.45 # refractive index

t = self.length / (C / n) # tau

env = kwargs[”signals”][”input”].contents # Reference to the Fock space

op = FockOperation(FockOperationType.PhaseShift, phi=env.frequency * t)

env.apply_operation(op) # Application of Phase shift

return [(”output”, GenericQuantumSignal().set_contents(env), time + t)]

List of Codes 1 Code for the `c`lass, implementing a phase shift and time
delay based on input signals.

moreauthor morelabelname

## References

  * [1] Nathan Killoran et al.  “Strawberry Fields: A Software Platform for Photonic Quantum Computing”  In _Quantum_ 3 Verein zur Forderung des Open Access Publizierens in den Quantenwissenschaften, 2019, pp. 129  DOI: 10.22331/q-2019-03-11-129
  * [2] Quandela  “Perceval: A Software Platform for Photonic Quantum Computing” https://www.quandela.com/perceval, 2023
  * [3] J.R. Johansson, P.D. Nation and F. Nori  “QuTiP: An open-source Python framework for the dynamics of open quantum systems”  In _Computer Physics Communications_ 183.8 Elsevier, 2012, pp. 1760–1772
  * [4] Shilin Sivarajah et al.  “t—ket¿: a retargetable compiler for NISQ devices”  In _Quantum Science and Technology_ 6.1 IOP Publishing, 2020, pp. 014003
  * [5] Daniel G.. Smith et al.  “Psi4NumPy: An interactive quantum chemistry programming environment for reference implementations and rapid development”  In _Journal of Chemical Theory and Computation_ 16.8 ACS Publications, 2020, pp. 4921–4935
  * [6] Ardavan F. Oskooi et al.  “MEEP: A flexible free-software package for electromagnetic simulations by the FDTD method”  In _Computer Physics Communications_ 181.3 Elsevier, 2010, pp. 687–702
  * [7] Photon-HDF5  “Photon-HDF5: Data Management for Photonic Quantum Information Processing” https://photon-hdf5.readthedocs.io, 2022
  * [8] Stephen DiAdamo, Janis Nötzel, Benjamin Zanger and Mehmet Mert Beşe  “Qunetsim: A software framework for quantum networks”  In _IEEE Transactions on Quantum Engineering_ 2 IEEE, 2021, pp. 1–12
  * [9] Shiwei Han, Stephen DiAdamo, Lukas Knpis and Janis Nötzel  “Controlling QuTools’ Hong-Ou-Mandel Experiment via QuNetSim and MQTT” [Online; posted 15-October-2021], 2021  URL: https://medium.com/@TQSD/controlling-qutools-hong-ou-mandel-experiment-via-qunetsim-and-mqtt-234d15735fd5
  * [10] Ryosuke Satoh et al.  “Quisp: a quantum internet simulation package”  In _2022 IEEE International Conference on Quantum Computing and Engineering (QCE)_ , 2022, pp. 353–364  IEEE
  * [11] Andras Varga  “OMNeT++”  In _Modeling and tools for network simulation_ Springer, 2010, pp. 35–59
  * [12] Xiaoliang Wu et al.  “SeQUeNCe: a customizable discrete-event simulator of quantum networks”  In _Quantum Science and Technology_ 6.4 IOP Publishing, 2021, pp. 045027
  * [13] Sean D Barrett and Pieter Kok  “Efficient high-fidelity quantum computation using matter qubits and linear optics”  In _Physical Review A_ 71.6 APS, 2005, pp. 060310
  * [14] Wolfgang Dür and Hans J Briegel  “Entanglement purification and quantum error correction”  In _Reports on Progress in Physics_ 70.8 IOP Publishing, 2007, pp. 1381
  * [15] Marek Zukowski, Anton Zeilinger, M Horne and Artur Ekert  “” Event-ready-detectors” Bell experiment via entanglement swapping.”  In _Physical Review Letters_ 71.26, 1993
  * [16] Ben Bartlett  “A distributed simulation framework for quantum networks and channels”  In _arXiv preprint arXiv:1808.07047_ , 2018
  * [17] Axel Dahlberg and Stephanie Wehner  “SimulaQron—a simulator for developing quantum internet software”  In _Quantum Science and Technology_ 4.1 IOP Publishing, 2018, pp. 015001
  * [18] Julius Wallnöfer et al.  “ReQuSim: Faithfully simulating near-term quantum repeaters”  In _arXiv preprint arXiv:2212.03896_ , 2022
  * [19] Simon Sekavčnik, Kareem El Safty and Janis Nötzel  “QuReed”  In _GitHub repository_ GitHub, https://github.com/tqsd/QuaSi, 2024
  * [20] The team  “mpmath: a Python library for arbitrary-precision floating-point arithmetic (version 1.3.0)” http://mpmath.org/, 2023
  * [21] Frédéric Bouchard et al.  “Two-photon interference: the Hong–Ou–Mandel effect”  In _Reports on Progress in Physics_ 84.1 IOP Publishing, 2020, pp. 012402
  * [22] Vittorio Giovannetti, Seth Lloyd and Lorenzo Maccone  “Achieving the Holevo bound via sequential measurements”  In _Physical Review A_ 85.1 American Physical Society (APS), 2012  DOI: 10.1103/physreva.85.012302
  * [23] Saikat Guha, Zachary Dutton and Jeffrey H Shapiro  “On quantum limit of optical communications: concatenated codes and joint-detection receivers”  In _2011 IEEE International Symposium on Information Theory Proceedings_ , 2011, pp. 274–278  IEEE
  * [24] Stephen Barnett and Paul Radmore  “Methods in Theoretical Quantum Optics”  Oxford University Press, 2002  DOI: 10.1093/acprof:oso/9780198563617.001.0001
  * [25] K.. Mo/ller, T.. Jo/rgensen and J.. Dahl  “Displaced squeezed number states: Position space representation, inner product, and some applications”  In _Phys. Rev. A_ 54 American Physical Society, 1996, pp. 5378–5385  DOI: 10.1103/PhysRevA.54.5378
  * [26] Seth Lloyd and Samuel L. Braunstein  “Quantum Computation over Continuous Variables”  In _Physical Review Letters_ 82.8 American Physical Society (APS), 1999, pp. 1784–1787  DOI: 10.1103/physrevlett.82.1784
  * [27] Qian Wang, Gerald Farrell and Wei Yan  “Investigation on single-mode–multimode–single-mode fiber structure”  In _Journal of Lightwave Technology_ 26.5 IEEE, 2008, pp. 512–519
  * [28] David T Pegg and Stephen M Barnett  “Quantum optical phase”  In _Journal of Modern Optics_ 44.2 Taylor & Francis, 1997, pp. 225–264
  * [29] Dmitry Makarov  “Theory for the beam splitter in quantum optics: Quantum entanglement of photons and their statistics, HOM effect”  In _Mathematics_ 10.24 MDPI, 2022, pp. 4794