-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathscript_SDPexperiment.py
More file actions
48 lines (39 loc) · 1.78 KB
/
script_SDPexperiment.py
File metadata and controls
48 lines (39 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from sc_qmt import *
theta = 2 * np.pi / 3
phi = 4 * np.pi / 3
v_0 = np.array([1, 0])
v_1 = np.array([1, np.sqrt(2)]) / np.sqrt(3)
v_2 = np.array([1, np.exp(theta * 1j) * np.sqrt(2)]) / np.sqrt(3)
v_3 = np.array([1, np.exp(phi * 1j) * np.sqrt(2)]) / np.sqrt(3)
M = [] # list of effects of the SIC-POVM
M.append(np.outer(v_0.conj().T, v_0) / 2)
M.append(np.outer(v_1.conj().T, v_1) / 2)
M.append(np.outer(v_2.conj().T, v_2) / 2)
M.append(np.outer(v_3.conj().T, v_3) / 2)
rhoPaulis = [
np.array([[1, 0], [0, 0]]),
np.array([[0, 0], [0, 1]]),
np.array([[0.5 + 0.0j, 0.5 + 0.0j], [0.5 + 0.0j, 0.5 + 0.0j]]),
np.array([[0.5 + 0.0j, -0.5 + 0.0j], [-0.5 - 0.0j, 0.5 + 0.0j]]),
np.array([[0.5 + 0.0j, 0.0 + 0.5j], [0.0 - 0.5j, 0.5 + 0.0j]]),
np.array([[0.5 + 0.0j, 0.0 - 0.5j], [0.0 + 0.5j, 0.5 + 0.0j]]),
] # list of Pauli eigenstates
""" Here is an example of the code to simulate num_exps different single-delta SDP experiments for QMT of the SIC-POVM, with the Pauli eigenstates as input states, and with and without noise thereon
"""
num_exps = 1 # number of different experiments
num_shots = 100000 # number of shots per input state
vec_delta_ideal = np.zeros(
num_exps
) # we store here the SDP delta for each experiment (ideal case)
vec_delta_noisy001 = np.zeros(
num_exps
) # we store here the SDP delta for each experiment (incoherent noise)
for jj in range(num_exps):
id_freq = generate_frequencies(num_shots, M, rhoPaulis) # only shot noise
noisy_freq = generate_frequencies_noisy(
num_shots, M, rhoPaulis, 0.001, 0.0
) # incoherent noise with p = 0.001
vec_delta_ideal[jj] = run_SDP_QMT(rhoPaulis, id_freq, SDPtype="singleDelta")[0]
vec_delta_noisy001[jj] = run_SDP_QMT(rhoPaulis, noisy_freq, SDPtype="singleDelta")[
0
]