## Recap of the project about 2D quantum dot arrays
Since January 2021, I have been discussing with Florian Unseld (Vandersypen lab) and Marcel Meyer (Veldhorst lab). We have been exchanging a lot of emails on several threads in the past one year.
The project is a sub-project of the ~Spin_qubit_design and all the work is commited to the branch `find-gate-structures` in the same repository.
#### branch - find-gate-structures
As the name suggests, I was trying to find the gate patterns of the 2x2 arrays from the design file (.oas).
Following is the side view of the heterostructure (also available on [gitlab](https://gitlab.kwant-project.org/qt/spin-qubit/-/tree/find-gate-structures/data/twodot_arrays/overlapping))

And the side view....

The first major task was to find the gate coordinates corresponding to the real device with proper length scales and make a discrete system using the Poisson solver.
I spent some time writing a script that does translate the design to the input that the Poisson solver accepts. Here is the [link](https://gitlab.kwant-project.org/qt/spin-qubit/-/blob/find-gate-structures/codes/gate_objects.py) to the code.
Basically the idea is:
1. Take a screenshot of the each single layer (accumulation, screening and barrier) of the design separately from the design file and save it as png.
2. Then use the code I wrote to obtain the polygons from the image file.
* This uses image processing tools such as
* cv2 - to read and format the images
* watershed - to find the individual structures from the image
* shapely - to deal with convex polygons
* alphashape - to deal with concave polygons because the design is not trivial.
3. Then based on the overlapping gate design, segregate the gate structures in 3D with the gate oxide (self-oxidized) in between them.
* Here is the result

It is available in the mattermost [link](https://chat.quantumtinkerer.tudelft.nl/files/4q5enbpndpr13rtkjfcea1d9ie/public?h=EnjfKFXjVN6iRKzUyjtt8ClV3FNZm_4J-mnqmO1KknY)
5. In some cases, the gate design is non-overlapping which becomes quite easy to handle. But even then, our code would be handy to deal with complex 2D gate objects.

We can automatically (ofcourse with some manual work) find the discrete poisson system for any 2D spin qubit gate design. Still there may be room for improvement but it works fine at the moment as we do not deal with too many gate designs.
### Data exchange with experimentalists
In January 2022, we received the gate voltages from the measurements of the planar geometry :arrow_up:. The idea is to calculate the gate coupling strengths at the measured gate space and send it back to them for verification.
But due to disorder in the measurements we cannot direcly compare our results to the measurements. We need to fine tune the measured gate voltages in our simulations to first form quantum dots and compute an effective Hamiltonian for calculating gate coupling strengths.
Hence we decided to do simulations like we generally do, perhaps add disorder, do numerical optimization of the gate voltages (similar routine as before) and calculate the average gate coupling strengths. Then send the data to experimentalists for verification. We discussed this in the channel few weeks ago and I also informed the same to Florian and Marcel.
### Maximally localized Wannier functions (MLWF) and numerical optimization
MLWF code works in the 2D case which is quite nice :+1:.
Recently, I have been working on the numerical optimization for the clean system with the MLWF integrated already.
I have been facing some trouble with the random positions of quantum dots as a result of MLWF at each iteration. I could not directly compare with the center of the dot regions. Most likely, more than one dot comes underneath a plunger gate and consequently some other regions doesn't have a dot at all.
Is there a simple solution for this problem that naturally positions the dots to the expected positions ?
I am solving this problem in the following way:
* Find which dot subspace(s) of the total space has more than two dots. Consider all of them as parasitic dots even those which are not within any dot subspace.
* Find the distance between those parasitic dots and subspace(s) which has no dots or contains more than one dot.
* Use this distance as the cost
* Leave the cost of the dot present alone in a subspace to be zero.
Another approach:
1. Have a reference point in each dot region.
2. Find the distance between all the localized states and all the reference points.
3. Use [linear sum assignment](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linear_sum_assignment.html?highlight=linear_sum_assignment#scipy.optimize.linear_sum_assignment) from scipy to find the closest dots to the reference points.