Hi all,

This may be a very basic question but I have tried to develop a simulation using the documentation and have had some luck at setting up various parts but keep running into a couple barriers. The barriers being that I am unable to simulate a polarised element and run a vector state at the same time using the configuration I have chosen.

I have many versions of the same code that I wrote from the Percival library in an attempt to get the result I would like. Unfortunately each one only goes so far. Some get part of the result that others do not.

The code variations all originated from a basic code I wrote from your library so ideally I would like to find a way to get the following simulation to work:

βββββββββββββββββββββββ

import perceval as pcvl

import numpy as np

import matplotlib.pyplot as plt

A=0.5 #Perceval automatically normalises so if I put in the probability, it will renormalise

B=A

input_state = A * pcvl.BasicState("|0,{P:H},{P:H},0>") + B * pcvl.BasicState("|0,{P:V},{P:V},0>")

print(input_state)

test_circuit = pcvl.Circuit(4)

test_circuit.add(0,pcvl.PBS())

test_circuit.add(2,pcvl.PBS())

pcvl.pdisplay(test_circuit)

p = pcvl.Processor(βSLOSβ, test_circuit) # create a processor running on SLOS backend

ca = pcvl.algorithm.Analyzer(p,

[input_state],

β*β)

pcvl.pdisplay(ca)

βββββββββββββββββββββββ

One of the current errors I am coming across involves not being able to use a state vector with the analyser. I am also not able to put the PBS into certain analysis techniques. The set up in the broken code above is as close to what I would be looking to get.

I understand there are multiple different backends and different ways to initialise this but this is in the format that I would like to keep. Ideally, I would also like to initialise the bell state in this way so at a later date I can adjust probabilities and add in extra states.

So in total I would need to be able to use a PBS with a state vector and gain the probability or probability density of each possible outcome. Is there a way to do this in Perceval as I am unable to find a way that works so far?

Also, is there a way so I could add 2 bell states to 1 circuit? I know I can work out the probabilities and make the state myself with ease, I was just wondering if I could possibly just input one bell state over modes 0 and 1 and another over 2 and 3?

Kind Regards,

Calum.