{ "cells": [ { "cell_type": "markdown", "id": "7f6effb781342585", "metadata": {}, "source": [ "# Quantum States" ] }, { "cell_type": "markdown", "id": "b0357168bef55424", "metadata": {}, "source": [ "This tutorial shows how to handle quantum states in Perceval.\n", "\n", "First, the necessary import:" ] }, { "cell_type": "code", "execution_count": 1, "id": "1846601e344992c4", "metadata": {}, "outputs": [], "source": [ "import perceval as pcvl\n", "# or you can import each symbol, depending on your prefered coding style\n", "from perceval import BasicState, StateVector, SVDistribution, BSDistribution, BSCount, BSSamples" ] }, { "cell_type": "markdown", "id": "2fae428413e5493c", "metadata": {}, "source": [ "## I. BasicState\n", "\n", "In linear optics (LO) Circuits, photons can have many discrete degrees of freedom, called modes.\n", "It can be the frequency, the polarisation, the position, or all of them.\n", "\n", "We represent these degrees of freedom with Fock states. If we have $n$ photons over $m$ modes, the Fock state $|s_1,s_2,...,s_m\\rangle$ means we have $s_i$ photons in the $i^{th}$ mode. Note that $\\sum_{i=1}^m s_i =n$.\n", "\n", "
\n", "Modes are using [0-based numbering](https://en.wikipedia.org/wiki/Zero-based_numbering) - so mode 0 is\n", "corresponding to the first one, and mode $(m-1)$ is corresponding to the $m$-th.