1
$\begingroup$

What does this command physically mean?

block_diag([[1]], BSunitaries[2], [[1]])

Can any one tell me in matrix form?

Source

$\endgroup$

1 Answer 1

1
$\begingroup$

A beamsplitter gates takes two parameters, and acts on two modes. The matrix that represents the gate is a 2x2 unitary. In this line you're calculating the unitary for the second 'column' in the circuit, which has a single beamsplitter. I've marked it in this image in blue: circuit

In order to be able to multiply the unitaries for all of the columns together, they all need to be 4x4 so we first need to find the 2x2 unitary for the beamsplitter and then turn it into a 4x4 unitary.

BSunitaries contains the unitaries for each of the beamsplitters so you first extract the information for this specific unitary by using BSunitaries[2].

block_diag creates a block diagonal matrix because you need UBS2 to be a 4x4 unitary so block_diag([[1]], BSunitaries[2], [[1]]) is basically adding a '1' in the top left and a '1' in the bottom right. If you print(block_diag([[1]], [[2,3],[4,5]], [[1]])) you'll get an idea of how this looks.

Catalina from Xanadu

$\endgroup$
1
  • $\begingroup$ But the problem is I don't get the exact entries when calculating UBS2 by hand. my input state is |1101> while the BS2 is getting an output from BS1 and BS3. UBS1 is formed somehow by BS1 tensored [(1,0),(0,0)] + BS2 tensored [(0,0),(0,1)] but this method failed when I calculate it for UBS2. for UBS2 the 4x4 square matrix will look as follows, p = |00><00| + |01><01| + |01><10| + |10><01| + |10><10| + |11><11| in general we have a11, a22, a23, a32, a33, a44 as non-zero entries. Now one thing I want to know is how to get these entries by matrix formulism? $\endgroup$ Oct 17, 2022 at 8:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.