Skip to content

Commit

Permalink
updating ipython notebook example
Browse files Browse the repository at this point in the history
  • Loading branch information
b-vanstraaten committed Jul 25, 2024
1 parent 251a732 commit dd02db2
Show file tree
Hide file tree
Showing 5 changed files with 192 additions and 108 deletions.
236 changes: 160 additions & 76 deletions examples/double_dot.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pypi_README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ model.run_gui()
The examples folder contains a number of examples that demonstrate how to use the package to simulate different quantum
dot systems.

1. [Double Quantum Dot](https://github.com/b-vanstraaten/qarray/blob/main/examples/double_dot.py)
1. [Double Quantum Dot](https://github.com/b-vanstraaten/qarray/blob/main/examples/double_dot.ipynb)
2. [Linear Triple Quantum Dot](https://github.com/b-vanstraaten/qarray/blob/main/examples/linear_triple_dot.py)
3. [Linear Quadruple Quantum Dot](https://github.com/b-vanstraaten/qarray/blob/main/examples/linear_quadruple_dot.py)
4. [Charge sensed double quantum dot](https://github.com/b-vanstraaten/qarray/blob/main/examples/charge_sensing.py)
Expand Down
20 changes: 10 additions & 10 deletions qarray/DotArrays/ChargeSensedDotArray.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ def do1d_open(self, gate: int | str, min: float, max: float, points: int) -> np.
:param gate: the gate to sweep
:param min: the minimum value of the gate to sweep
:param max: the maximum value of the gate to sweep
:param points: the number of points to sweep the gate over
:param points: the number of res to sweep the gate over
returns the ground state of the dot array which is a np.ndarray of shape (points, n_dot) in the open configuration
returns the ground state of the dot array which is a np.ndarray of shape (res, n_dot) in the open configuration
"""

vg = self.gate_voltage_composer.do1d(gate, min, max, points)
Expand All @@ -143,9 +143,9 @@ def do1d_closed(self, gate: int | str, min: float, max: float, points: int, n_ch
:param gate: the gate to sweep
:param min: the minimum value of the gate to sweep
:param max: the maximum value of the gate to sweep
:param points: the number of points to sweep the gate over
:param points: the number of res to sweep the gate over
returns the ground state of the dot array which is a np.ndarray of shape (points, n_dot) in the closed configuration
returns the ground state of the dot array which is a np.ndarray of shape (res, n_dot) in the closed configuration
"""
vg = self.gate_voltage_composer.do1d(gate, min, max, points)
return self.charge_sensor_closed(vg, n_charge)
Expand All @@ -158,13 +158,13 @@ def do2d_open(self, x_gate: int | str, x_min: float, x_max: float, x_points: int
:param x_gate: the gate to sweep in the x direction
:param x_min: the minimum value of the gate to sweep
:param x_max: the maximum value of the gate to sweep
:param x_points: the number of points to sweep the gate over
:param x_points: the number of res to sweep the gate over
:param y_gate: the gate to sweep in the y direction
:param y_min: the minimum value of the gate to sweep
:param y_max: the maximum value of the gate to sweep
:param y_points: the number of points to sweep
:param y_points: the number of res to sweep
returns the ground state of the dot array which is a np.ndarray of shape (x_points, y_points, n_dot) in the open
returns the ground state of the dot array which is a np.ndarray of shape (x_res, y_res, n_dot) in the open
configuration
"""

Expand All @@ -179,13 +179,13 @@ def do2d_closed(self, x_gate: int | str, x_min: float, x_max: float, x_points: i
:param x_gate: the gate to sweep in the x direction
:param x_min: the minimum value of the gate to sweep
:param x_max: the maximum value of the gate to sweep
:param x_points: the number of points to sweep the gate over
:param x_points: the number of res to sweep the gate over
:param y_gate: the gate to sweep in the y direction
:param y_min: the minimum value of the gate to sweep
:param y_max: the maximum value of the gate to sweep
:param y_points: the number of points to sweep
:param y_points: the number of res to sweep
returns the ground state of the dot array which is a np.ndarray of shape (x_points, y_points, n_dot)
returns the ground state of the dot array which is a np.ndarray of shape (x_res, y_res, n_dot)
in the closed configuration
"""

Expand Down
40 changes: 20 additions & 20 deletions qarray/DotArrays/DotArray.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,75 +205,75 @@ def compute_threshold_estimate(self):
"""
return compute_threshold(self.cdd)

def do1d_open(self, gate: int | str, min: float, max: float, points: int) -> np.ndarray:
def do1d_open(self, gate: int | str, min: float, max: float, res: int) -> np.ndarray:
"""
Performs a 1D sweep of the dot array with the gate
:param gate: the gate to sweep
:param min: the minimum value of the gate to sweep
:param max: the maximum value of the gate to sweep
:param points: the number of points to sweep the gate over
:param res: the number of res to sweep the gate over
returns the ground state of the dot array which is a np.ndarray of shape (points, n_dot)
returns the ground state of the dot array which is a np.ndarray of shape (res, n_dot)
"""

vg = self.gate_voltage_composer.do1d(gate, min, max, points)
vg = self.gate_voltage_composer.do1d(gate, min, max, res)
return self.ground_state_open(vg)

def do1d_closed(self, gate: int | str, min: float, max: float, points: int, n_charges: int) -> np.ndarray:
def do1d_closed(self, gate: int | str, min: float, max: float, res: int, n_charges: int) -> np.ndarray:
"""
Performs a 1D sweep of the dot array with the gate
:param gate: the gate to sweep
:param min: the minimum value of the gate to sweep
:param max: the maximum value of the gate to sweep
:param points: the number of points to sweep the gate over
:param res: the number of res to sweep the gate over
:param n_charges: the number of charges to be confined in the dot array
returns the ground state of the dot array which is a np.ndarray of shape (points, n_dot)
returns the ground state of the dot array which is a np.ndarray of shape (res, n_dot)
"""

vg = self.gate_voltage_composer.do1d(gate, min, max, points)
vg = self.gate_voltage_composer.do1d(gate, min, max, res)
return self.ground_state_closed(vg, n_charges)

def do2d_open(self, x_gate: int | str, x_min: float, x_max: float, x_points: int,
y_gate: int | str, y_min: float, y_max: float, y_points: int) -> np.ndarray:
def do2d_open(self, x_gate: int | str, x_min: float, x_max: float, x_res: int,
y_gate: int | str, y_min: float, y_max: float, y_res: int) -> np.ndarray:
"""
Performs a 2D sweep of the dot array with the gates x_gate and y_gate
:param x_gate: the gate to sweep in the x direction
:param x_min: the minimum value of the gate to sweep
:param x_max: the maximum value of the gate to sweep
:param x_points: the number of points to sweep the gate over
:param x_res: the number of res to sweep the gate over
:param y_gate: the gate to sweep in the y direction
:param y_min: the minimum value of the gate to sweep
:param y_max: the maximum value of the gate to sweep
:param y_points: the number of points to sweep the
:param y_res: the number of res to sweep the
returns the ground state of the dot array which is a np.ndarray of shape (x_points, y_points, n_dot)
returns the ground state of the dot array which is a np.ndarray of shape (x_res, y_res, n_dot)
"""

vg = self.gate_voltage_composer.do2d(x_gate, x_min, x_max, x_points, y_gate, y_min, y_max, y_points)
vg = self.gate_voltage_composer.do2d(x_gate, x_min, x_max, x_res, y_gate, y_min, y_max, y_res)
return self.ground_state_open(vg)

def do2d_closed(self, x_gate: int | str, x_min: float, x_max: float, x_points: int,
y_gate: int | str, y_min: float, y_max: float, y_points: int, n_charges: int) -> np.ndarray:
def do2d_closed(self, x_gate: int | str, x_min: float, x_max: float, x_res: int,
y_gate: int | str, y_min: float, y_max: float, y_res: int, n_charges: int) -> np.ndarray:
"""
Performs a 2D sweep of the dot array with the gates x_gate and y_gate
:param x_gate: the gate to sweep in the x direction
:param x_min: the minimum value of the gate to sweep
:param x_max: the maximum value of the gate to sweep
:param x_points: the number of points to sweep the gate over
:param x_res: the number of res to sweep the gate over
:param y_gate: the gate to sweep in the y direction
:param y_min: the minimum value of the gate to sweep
:param y_max: the maximum value of the gate to sweep
:param y_points: the number of points to sweep the gate over
:param y_res: the number of res to sweep the gate over
:param n_charges: the number of charges to be confined in the dot array
returns the ground state of the dot array which is a np.ndarray of shape (x_points, y_points, n_dot)
returns the ground state of the dot array which is a np.ndarray of shape (x_res, y_res, n_dot)
"""
vg = self.gate_voltage_composer.do2d(x_gate, x_min, x_max, x_points, y_gate, y_min, y_max, y_points)
vg = self.gate_voltage_composer.do2d(x_gate, x_min, x_max, x_res, y_gate, y_min, y_max, y_res)
return self.ground_state_closed(vg, n_charges)

def compute_optimal_virtual_gate_matrix(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/GLOBAL_OPTIONS.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Global options for tests
disable_tqdm = True # Set to True to disable tqdm progress bars
N_VOLTAGES = 100 # Number of voltages to test
N_VOLTAGES = 10 # Number of voltages to test
N_ITERATIONS = 10 # Number of iterations to test

N_DOT_MAX = 10 # Maximum number of dots to test
Expand Down

0 comments on commit dd02db2

Please sign in to comment.