-
Notifications
You must be signed in to change notification settings - Fork 1
/
double_dot.py
82 lines (69 loc) · 2.61 KB
/
double_dot.py
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
"""
Double dot example
"""
import time
from functools import partial
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from qarray import (DotArray, GateVoltageComposer, dot_occupation_changes)
# setting up the constant capacitance model_threshold_1
model = DotArray(
Cdd=6.25 * np.array([
[0., 0.9],
[0.9, 0.]
]),
Cgd=6.25 * np.array([
[1., 0.],
[0.2, 1]
]),
algorithm='default',
implementation='rust', charge_carrier='h', T=0.,
)
# creating the dot voltage composer, which helps us to create the dot voltage array
# for sweeping in 1d and 2d
voltage_composer = GateVoltageComposer(n_gate=model.n_gate)
# defining the functions to compute the ground state for the different cases
ground_state_funcs = [
model.ground_state_open,
partial(model.ground_state_closed, n_charges=1),
partial(model.ground_state_closed, n_charges=2),
partial(model.ground_state_closed, n_charges=3),
]
# defining the min and max values for the dot voltage sweep
vx_min, vx_max = -0.5, 0.5
vy_min, vy_max = -0.5, 0.5
# using the dot voltage composer to create the dot voltage array for the 2d sweep
vg = voltage_composer.do2d(0, vy_min, vx_max, 500, 1, vy_min, vy_max, 500)
# creating the figure and axes
fig, axes = plt.subplots(2, 2, sharex=True, sharey=True)
fig.set_size_inches(3, 3)
# looping over the functions and axes, computing the ground state and plot the results
for (func, ax) in zip(ground_state_funcs, axes.flatten()):
t0 = time.time()
n = func(vg) # computing the ground state by calling the function
t1 = time.time()
print(f'Computing took {t1 - t0: .3f} seconds')
# passing the ground state to the dot occupation changes function to compute when
# the dot occupation changes
# z = (n * np.linspace(0.9, 1.1, n.shape[-1])[np.newaxis, np.newaxis, :]).sum(axis=-1)
z = dot_occupation_changes(n)
# plotting the result
cmap = matplotlib.colors.LinearSegmentedColormap.from_list("", ["white", "black"])
# z = np.gradient(z, axis=0)
ax.imshow(z, extent=[vx_min, vx_max, vy_min, vy_max], origin='lower', aspect='auto', cmap=cmap,
interpolation='antialiased')
ax.set_aspect('equal')
fig.tight_layout()
# setting the labels and titles
axes[0, 0].set_ylabel(r'$V_y$')
axes[1, 0].set_ylabel(r'$V_y$')
axes[1, 0].set_xlabel(r'$V_x$')
axes[1, 1].set_xlabel(r'$V_x$')
axes[0, 0].set_title(r'Open')
axes[0, 1].set_title(r'$n_{charge} = 1$')
axes[1, 0].set_title(r'$n_{charge} = 2$')
axes[1, 1].set_title(r'$n_{charge} = 3$')
# plt.savefig('double_dot.pdf', bbox_inches='tight')
if __name__ == '__main__':
plt.show()