How to use PBS on Ascella

Hello!

I have a doubt about using a PBS. I notice it is a gate that requires 2 input states, but its unitary matrix is a 4x4 matrix.

When I try to simulate it on ascella as

c = pcvl.Circuit(2)
c.add((0, 1), comp.PBS())
remote_simulator.set_circuit(c)
remote_simulator.with_input(pcvl.BasicState("|{P:H},{P:V}>"))
async_job = sampler.samples.execute_async(1000)

I have the following error:

{
“results”: “Template circuit and target size should be the same (12 != 24)”
}

Is it possible to run it on ascella or altair?

I would appreciate any help.

Thanks.

Hello,

None of our Cloud platform is able to support polarized components / states. The error message isn’t clear, but is the consequence of that.
Indeed, Perceval is able to simulate part of polarization (locally) by doubling the circuit size and expanding the input state as a superposition of P:H (encoded into |1,0>) and P:H (encoded into |0,1>).
You can find an example of local polarization simulation in the following notebook: 2-mode Grover’s search algorithm — perceval v0.12 documentation

If you really need to run your computation on our Cloud, please express your circuit without polarization (using only non-polarized unitary components).

Best wishes,
Eric