Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
b-vanstraaten committed Jul 25, 2024
2 parents a653153 + 6121756 commit 72d11c7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions examples/charge_sensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@
coulomb_peak_width=0.05, T=100
)

model.gate_voltage_composer.virtual_gate_matrix = np.array([
[1, -0.0, 0],
[-0.0, 1, 0],
[-0.06, -0.05, 0],
])

# defining the min and max values for the dot voltage sweep
vx_min, vx_max = -2, 2
vy_min, vy_max = -2, 2
# using the dot voltage composer to create the dot voltage array for the 2d sweep
vg = model.gate_voltage_composer.do2d(1, vy_min, vx_max, 100, 2, vy_min, vy_max, 100)

z, n = model.do2d_open(1, vy_min, vx_max, 100, 2, vy_min, vy_max, 100)
vg = model.gate_voltage_composer.do2d('vP1', vy_min, vx_max, 100, 'vP2', vy_min, vy_max, 100)

# centering the voltage sweep on the [0, 1] - [1, 0] interdot charge transition on the side of a charge sensor coulomb peak
vg += model.optimal_Vg([0.5, 0.5, 0.6])
Expand Down
2 changes: 1 addition & 1 deletion examples/triple_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
vx_min, vx_max = -10, 10
vy_min, vy_max = -10, 10
# using the dot voltage composer to create the dot voltage array for the 2d sweep
vg = voltage_composer.do2d(1, vy_min, vx_max, 400, 3, vy_min, vy_max, 400)
vg = model.gate_voltage_composer.do2d('vP1', vy_min, vx_max, 400, 'vP3', vy_min, vy_max, 400)

# creating the figure and axes
fig, axes = plt.subplots(2, 2, sharex=True, sharey=True)
Expand Down
2 changes: 1 addition & 1 deletion qarray/DotArrays/ChargeSensedDotArray.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def __post_init__(self):
if self.algorithm in ['thresholded', 'default']:
check_and_warn_user(self)

self.gate_voltage_composer = GateVoltageComposer(n_gate=self.n_gate, n_dot=self.n_dot)
self.gate_voltage_composer = GateVoltageComposer(n_gate=self.n_gate, n_dot=self.n_dot, n_sensor=self.n_sensor)
self.gate_voltage_composer.virtual_gate_matrix = -np.linalg.pinv(self.cdd_inv @ self.cgd)
self.gate_voltage_composer.virtual_gate_origin = np.zeros(self.n_gate)

Expand Down
4 changes: 2 additions & 2 deletions qarray/DotArrays/GateVoltageComposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class GateVoltageComposer:
"""
n_gate: int # the number of gates
n_dot: int | None = None
n_sensor: int | None = 0
virtual_gate_origin: np.ndarray | None = None # the origin to consider virtual gates from
virtual_gate_matrix: np.ndarray | None = None # a matrix of virtual gates to be used for the dot array


def _check_gate(self, gate: int):
assert isinstance(gate, int), 'gate must be an int'
assert gate in range(1, self.n_gate + 1), f'gate must be in the range 1 to {self.n_gate}'
Expand Down Expand Up @@ -149,7 +149,7 @@ def meshgrid_virtual(self, dots: List[int | str], arrays: List[np.ndarray]) -> n
sizes = [array.size for array in arrays]

# initialising the voltage array
Vd = np.zeros(shape=sizes + [self.n_dot])
Vd = np.zeros(shape=sizes + [self.n_dot + self.n_sensor])

# creating the meshgrid
V = np.meshgrid(*arrays)
Expand Down

0 comments on commit 72d11c7

Please sign in to comment.