Skip to content
Snippets Groups Projects
Commit 3dfcd532 authored by Bernabeu Lou's avatar Bernabeu Lou
Browse files

added common BS matrices (i hope)

parent 78838396
No related branches found
No related tags found
No related merge requests found
import numpy as np import numpy as np
### ------ ONE-PHOTON MATRICES ------
### Pauli matrices ### Pauli matrices
X = np.array([[0, 1], [1, 0]], dtype="complex") X = np.array([[0, 1], [1, 0]], dtype="complex")
...@@ -8,7 +8,8 @@ Z = np.array([[1, 0], [0, -1]], dtype = "complex") ...@@ -8,7 +8,8 @@ Z = np.array([[1, 0], [0, -1]], dtype = "complex")
### Other One-qubit matrices ### Other One-qubit matrices
H = np.array([[1, 1],[1, -1]], dtype='complex') H = (1/np.sqrt(2))*np.array([[1, 1],[1, -1]], dtype='complex')
H_REV = (1/np.sqrt(2))*np.array([[-1, 1], [1, 1]], dtype='complex')
S = np.array([[1, 0], [0, 0+1j]], dtype='complex') S = np.array([[1, 0], [0, 0+1j]], dtype='complex')
T = np.array([[1, 0], [0, np.exp(complex(0, np.pi/8))]], dtype="complex") T = np.array([[1, 0], [0, np.exp(complex(0, np.pi/8))]], dtype="complex")
...@@ -42,3 +43,31 @@ def LINEAR_RETARDER(delta, theta): ### symmetric phase convention ...@@ -42,3 +43,31 @@ def LINEAR_RETARDER(delta, theta): ### symmetric phase convention
L22 = np.exp(1j*delta/2)*(np.cos(theta)**2) + np.exp(-1j*delta/2)*(np.sin(theta)**2) L22 = np.exp(1j*delta/2)*(np.cos(theta)**2) + np.exp(-1j*delta/2)*(np.sin(theta)**2)
return np.array([[L11, L12], return np.array([[L11, L12],
[L12, L22]]) [L12, L22]])
### ------ TWO-PHOTON MATRICES ------
SYM_BS_AMPLITUDE_MATRIX = (1/np.sqrt(2))*np.array([[1j, 1],
[1, 1j]])
HALF_MIRROR_LEFT_PLATE_AMPLITUDE_MATRIX = H_REV
HALF_MIRROR_RIGHT_PLATE_AMPLITUDE_MATRIX = H
SYM_BS_INACTIVE = np.kron(SYM_BS_AMPLITUDE_MATRIX, np.eye(2))
HALF_MIRROR_LEFT_INACTIVE = np.kron(HALF_MIRROR_LEFT_PLATE_AMPLITUDE_MATRIX, np.eye(2))
HALF_MIRROR_RIGHT_INACTIVE = np.kron(HALF_MIRROR_RIGHT_PLATE_AMPLITUDE_MATRIX, np.eye(2))
SYM_BS_INACTIVE = (1/np.sqrt(2))*np.array([[1j, 0, 1, 0],
[0, -1j, 0, 1],
[1, 0, 1j, 0],
[0, 1, 0, -1j]], dtype='complex')
HALF_MIRROR_LEFT_ACTIVE = (1/np.sqrt(2))*np.array([[-1, 0, 1, 0],
[0, 1, 0, 1],
[1, 0, 1, 0],
[0, 1, 0, -1]], dtype='complex')
HALF_MIRROR_LEFT_ACTIVE = (1/np.sqrt(2))*np.array([[1, 0, 1, 0],
[0, -1, 0, 1],
[1, 0, -1, 0],
[0, 1, 0, 1]], dtype='complex')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment