-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcognitive_dimension.py
More file actions
30 lines (24 loc) · 982 Bytes
/
Copy pathcognitive_dimension.py
File metadata and controls
30 lines (24 loc) · 982 Bytes
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
# cognitive_dimension.py
import os
import numpy as np
import matplotlib.pyplot as plt
def cognitive_dimension(d_real, d_imag):
d = np.abs(complex(d_real, d_imag))
return 2 / (1 + d**2)
# Ensure the 'results' directory exists
os.makedirs("results", exist_ok=True)
# Visualization
d_values = np.linspace(0, 1, 100)
dim_values = [cognitive_dimension(d, 0) for d in d_values]
plt.figure(figsize=(10, 6))
plt.plot(d_values, dim_values, 'b-')
plt.axvline(x=1/4.6, color='r', linestyle='--', label='Critical |d| = 1/Λ_c')
plt.xlabel(r'$|\langle \mathrm{obs}_0 | \mathrm{obs}_1 \rangle|$')
plt.ylabel(r'dim $\mathcal{C}_{\mathrm{obs}}$')
plt.title('Cognitive dimension vs. distinguishability')
plt.legend()
plt.grid(True)
# Save in high resolution and vector format to 'results' directory
plt.savefig("results/cognitive_dimension.png", dpi=600, bbox_inches='tight')
plt.savefig("results/cognitive_dimension.pdf", bbox_inches='tight')
plt.show()