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 polarised 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?

(I aim to simulate a set up with two bell states and entangle a photon from each state in a polarised beam splitter and then possibly add more to the set up there after)

Kind Regards,

Calum.

P.S. I posted this first as an issue but I realise now that it maybe should have been posted as something else. This is why I have reposted this. Sorry.