Gaussian Simulator#
- class GaussianSimulator(d: int, config: Config | None = None, calculator: BaseCalculator | None = None)#
Performs photonic simulations using Gaussian representation.
The simulation (when executed) results in an instance of
GaussianState
.Example usage:
import numpy as np import piquasso as pq from scipy.stats import unitary_group d = 5 U = unitary_group.rvs(d) with pq.Program() as program: pq.Q() | pq.Vacuum() for i in range(5): pq.Q(i) | pq.Squeezing(r=i*0.1) pq.Q(all) | pq.Interferometer(U) pq.Q(all) | pq.ParticleNumberMeasurement() simulator = pq.GaussianSimulator(d=5) result = simulator.execute(program, shots=100)
- Supported preparations:
Vacuum
,Mean
,Covariance
,Thermal
.- Supported gates:
Interferometer
,Beamsplitter
,Phaseshifter
,MachZehnder
,Fourier
,GaussianTransform
,Squeezing
,QuadraticPhase
,Squeezing2
,ControlledX
,ControlledZ
,Displacement
,PositionDisplacement
,MomentumDisplacement
,Graph
.- Supported measurements:
HomodyneMeasurement
,HeterodyneMeasurement
,GeneraldyneMeasurement
,ParticleNumberMeasurement
,ThresholdMeasurement
.- Supported channels: