Commit e73b78b0 authored by Orkun Şensebat's avatar Orkun Şensebat
Browse files

Touch up plots

parent f00ad8d2
Pipeline #467241 passed with stage
in 1 minute
......@@ -2,7 +2,7 @@ import numpy as np
import matplotlib.pyplot as plt
import time
showPlots = True
showPlots = False
# initialization
wxyz = 4754
......@@ -109,17 +109,21 @@ E = count_coincidences(counts)
# 1. as expected
# 2. from simulation results
plot_i = 1
# correlation
phi = np.linspace(0, 360/n_configs*(n_configs-1), n_configs)
phi_theory = np.linspace(0, 360/n_configs*(n_configs-1), n_configs*100)
theory = -np.cos(2 * phi_theory * (2 * np.pi / 360))
plt.figure()
plt.xlabel(r'$\Delta \varphi$')
plt.ylabel(r'$<x_1 x_2>$')
plt.plot(phi_theory, theory, '.', markersize=1, color='orange')
plt.plot(phi, E[12][plot_i, :], 'o', color='blue')
plt.xlabel(r'$\Delta \varphi$ in degrees')
plt.ylabel(r'Correlation function $\langle x_1 x_2 \rangle$')
plt.xlim([0, 360])
plt.xticks([0, 90, 180, 270, 360])
plt.yticks([-1.0, -0.5, 0.0, 0.5, 1.0])
plt.plot(phi_theory, theory, color='black', label='Theory')
plt.plot(phi, E[12][1, :], 'P', color='blue', label='$W = 1\,\mathrm{ns}$')
plt.plot(phi, E[12][0, :], 'X', color='orange', label='$W\\ \\to\\ \infty$')
plt.legend()
plt.grid()
plt.savefig('correlation.pdf')
if showPlots:
plt.show()
......@@ -128,12 +132,18 @@ plt.close()
# product of expectation values
line = np.zeros(phi_theory.shape)
plt.figure()
plt.xlabel(r'$\Delta \varphi$')
plt.ylabel(r'$<x_1><x_2>$')
plt.ylim([-1, 1])
plt.xticks([0, 45, 90, 135, 180, 225, 270, 305, 360])
plt.plot(phi_theory, line, '.', markersize=1, color='orange')
plt.plot(phi, E[1][plot_i, :]*E[2][plot_i, :], 'o', color='blue')
plt.xlabel(r'$\Delta \varphi$ in degrees')
plt.ylabel(r'$\langle x_1 \rangle \langle x_2 \rangle$')
plt.xlim([0, 360])
plt.ylim([-0.01, 0.01])
# plt.xticks([0, 45, 90, 135, 180, 225, 270, 305, 360])
plt.xticks([0, 90, 180, 270, 360])
plt.yticks([-0.01, 0.0, 0.01])
plt.plot(phi_theory, line, linewidth=1, color='black', label='Theory')
plt.plot(phi, E[1][1, :]*E[2][1, :], 'P', color='blue', label='$W = 1\,\mathrm{ns}$')
plt.plot(phi, E[1][0, :]*E[2][0, :], 'X', color='orange', label='$W\\ \\to\\ \infty$')
plt.legend()
plt.grid()
plt.savefig('expectation_value.pdf')
if showPlots:
plt.show()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment