Perceval
Quandela's Python framework for photonic quantum computing with linear optics
Quick install
pip install perceval-quandela Background and History
Perceval was developed by Quandela, a French photonic quantum computing company founded in 2017 as a spin-off from the Centre for Nanoscience and Nanotechnology (C2N) in Paris. Quandela’s founders, Pascale Senellart, Valérian Giesz, and Niccolo Somaschi, brought expertise in semiconductor quantum dot single-photon sources, which are the hardware foundation for Quandela’s approach to photonic quantum computing. Perceval was first released as open-source software around 2022, providing a Python framework for programming discrete-variable photonic quantum circuits.
Perceval targets a different photonic paradigm than Xanadu’s Strawberry Fields. While Strawberry Fields works with continuous-variable squeezed light, Perceval uses single photons and linear optical components (beam splitters, phase shifters, and mirrors) in a discrete-variable model. Quantum information is typically encoded using dual-rail encoding, where a logical qubit is represented by one photon distributed across two optical modes. This approach is rooted in the Knill-Laflamme-Milburn (KLM) scheme for linear optical quantum computing.
The framework provides tools for constructing linear optical circuits, simulating photon evolution through interferometers, and analyzing output probability distributions. Its simulation backends include SLOS (Scalable Linear Optical Simulator) for exact computation of photon distributions, an MPS (matrix product state) backend for scaling to larger mode counts, and a basic permanent-based backend. Perceval also provides cloud access to Quandela’s photonic processors, including the Ascella system, through a remote processor interface.
Quandela’s hardware uses deterministic single-photon sources based on semiconductor quantum dots, which produce indistinguishable photons on demand. This is a key differentiator from probabilistic photon sources and is essential for the interference effects that drive photonic quantum computation. The Hong-Ou-Mandel effect, where two indistinguishable photons bunch at a beam splitter, is both a fundamental test of source quality and a core primitive in Perceval’s programming model.
As of 2025, Perceval is actively maintained by Quandela with regular releases. The project has a growing but still relatively small community compared to gate-model frameworks. It serves as the primary programming interface for Quandela’s hardware and is used by researchers working on linear optical quantum computing, boson sampling, and photonic quantum information processing.
Overview
Perceval is developed by Quandela, a French photonic quantum computing company. It targets the discrete-variable (DV) photonic model, where quantum information is encoded in the presence or absence of single photons across optical modes. This is distinct from Xanadu’s Strawberry Fields, which uses continuous-variable squeezed light. Perceval works with single photons and dual-rail encoding: a logical qubit is represented by one photon spread across two modes (|1,0⟩ = |0⟩, |0,1⟩ = |1⟩).
The underlying physics is linear optics: circuits are built from beam splitters, phase shifters, and mirrors. All operations are unitary transformations on the mode occupation (Fock) states.
Installation
pip install perceval-quandela
Key Imports
import perceval as pcvl
from perceval.components import BS, PS, PERM
from perceval.algorithm import Sampler
Core Concepts
Fock States
States are described by photon number per mode. |1,0,1,0⟩ means one photon in mode 0, zero in mode 1, one in mode 2, zero in mode 3.
# BasicState: specify photon count in each mode
state = pcvl.BasicState([1, 0, 1, 0])
print(state) # |1,0,1,0>
Components
| Component | Class | Description |
|---|---|---|
| Beam splitter | BS() | 50/50 by default; parameterize with BS(theta) |
| Phase shifter | PS(phi) | Adds a phase φ to a single mode |
| Permutation | PERM([2,0,1]) | Reorders modes |
| Loss channel | LC(loss) | Models photon loss (0 = lossless) |
import perceval as pcvl
from perceval.components import BS, PS
# 2-mode circuit
circuit = pcvl.Circuit(2)
circuit.add(0, BS()) # 50/50 beam splitter on modes 0 and 1
circuit.add(0, PS(1.5708)) # phase shift of π/2 on mode 0
Hong-Ou-Mandel Effect
The HOM effect is the signature of single-photon indistinguishability. Two photons entering a 50/50 beam splitter always exit together (bunching) due to bosonic interference.
import perceval as pcvl
from perceval.components import BS
from perceval.algorithm import Sampler
# Input: one photon per mode |1,1>
circuit = pcvl.Circuit(2)
circuit.add(0, BS()) # 50/50 beam splitter
# Processor with SLOS simulation backend
processor = pcvl.Processor("SLOS", circuit)
processor.with_input(pcvl.BasicState([1, 1]))
sampler = Sampler(processor)
result = sampler.sample_count(1000)
print(result)
# Expected: {|2,0>: ~500, |0,2>: ~500, |1,1>: 0}
# The |1,1> output is completely suppressed by destructive interference
Mach-Zehnder Interferometer
import perceval as pcvl
from perceval.components import BS, PS
from perceval.algorithm import Sampler
# Mach-Zehnder: BS - phase shift - BS
circuit = pcvl.Circuit(2)
circuit.add(0, BS()) # first beam splitter
circuit.add(0, PS(phi=1.5708)) # phase shift on mode 0 (π/2)
circuit.add(0, BS()) # second beam splitter
processor = pcvl.Processor("SLOS", circuit)
processor.with_input(pcvl.BasicState([1, 0]))
sampler = Sampler(processor)
result = sampler.sample_count(500)
print(result)
# Phase-dependent output distribution
Backends
| Backend | Description |
|---|---|
"SLOS" | Scalable Linear Optical Simulator; exact, recommended for small circuits |
"Naive" | Brute-force matrix permanent; slow but simple |
"MPS" | Matrix product state simulator; scales better for large mode counts |
| Quandela cloud | Real photonic QPU accessed via RemoteProcessor |
# Switch backend
processor_naive = pcvl.Processor("Naive", circuit)
processor_mps = pcvl.Processor("MPS", circuit)
Dual-Rail Qubit Encoding
# Logical |0> = one photon in mode 0: |1,0>
# Logical |1> = one photon in mode 1: |0,1>
# A beam splitter acts as a Hadamard on dual-rail qubits
# |1,0> -> (|1,0> + |0,1>) / sqrt(2) (superposition)
circuit = pcvl.Circuit(2)
circuit.add(0, BS()) # Hadamard in dual-rail encoding
processor = pcvl.Processor("SLOS", circuit)
processor.with_input(pcvl.BasicState([1, 0])) # logical |0>
sampler = Sampler(processor)
result = sampler.sample_count(1000)
print(result)
# {|1,0>: ~500, |0,1>: ~500} - equal superposition
Quandela Cloud Hardware
import perceval as pcvl
# Connect to Quandela's photonic QPU
# Requires API token from cloud.quandela.com
provider = pcvl.RemoteProvider(token="YOUR_TOKEN")
processor = provider.get_processor("sim:ascella") # cloud simulator
# Or real hardware (when available)
# processor = provider.get_processor("ascella")
processor.with_input(pcvl.BasicState([1, 0]))
sampler = pcvl.algorithm.Sampler(processor)
result = sampler.sample_count(200)
print(result)
Perceval vs. Strawberry Fields
| Aspect | Perceval | Strawberry Fields |
|---|---|---|
| Company | Quandela (France) | Xanadu (Canada) |
| Photonic model | Discrete variable (single photons) | Continuous variable (squeezed light) |
| Qubit encoding | Dual-rail (photon presence/absence) | Quadrature amplitudes |
| Gates | Beam splitters, phase shifters | Squeezing, displacement, Kerr |
| Measurement | Photon counting | Homodyne / heterodyne |
| Natural application | Boson sampling, linear optics QC | GBS, quantum ML |
Limitations
Linear optics gates are inherently probabilistic. A CNOT between dual-rail qubits using KLM protocol succeeds with probability 1/9 without ancilla photons; boosted schemes reach 1/4. Feed-forward (active correction based on measurement results) can improve success probability but requires fast switching. Photon loss is the dominant error source and scales exponentially with circuit depth. The Perceval community is smaller than gate-based frameworks such as Qiskit or Cirq, so third-party resources are more limited.