Closed qpavsmi closed 5 months ago
Hi, I would like to work on this issue as part of unitaryhack 2024
Hi, I would like to work on this issue as part of unitaryhack 2024
Sounds great! I encourage to make a pull request early even if the solution is not completely finalized to get early feedback.
Completed by https://github.com/iqm-finland/KQCircuits/pull/95 thanks @PietroCampana
What happened? What you expected to happen?
I place a KQC element, for example the Double Pads from the Qubit Library. Then I open
klayout_package/python/kqcircuits/qubits/double_pads.py
and make_build_island2
return emptypya.Region()
. I go back to the same KLayout session and selectKQCircuits > Reload Libraries
. I get what I expected, which is that the bottom island on the qubit is not present anymore and there are no errors inFile > Log Viewer
.Now I open
Basic
from the library panel, and place a Circle. For better demonstration I double click the Circle cell, choosePCell Parameters
and changeRadius
to 100 microns andlayer
to1t1 base metal wo grid 130/1
. Now do some change in double pads code (e.g. revert change made above) and tryKQCircuits > Reload Libraries
. Now it gives errorAttributeError: type object 'PCellDeclaration_Native' has no attribute 'get_schema'
. Also the double pads qubit will disappear.Prerequisites
KQCircuits GUI installation required
Where to start?
The
Reload Libraries
command is a macro at klayout_package/python/scripts/macros/0system/0reload.lym. It is an XML file with python code embedded in the<text>
field. The macro code is simple:It seems that the
extract_pcell_data_from_views
function does not filter the cells based on whether they are introduced by the KQC library or if they are native KLayout objects or cells defined from some other library. Every cell that comes from the KQC library is a subclass of kqcircuits.elements.element.Element class, so it should be easy to filter using theisinstance
python function.The described bug happens because: the macro collects the pcells, deleting some of them in the process, then it encounters a cell that it cannot work with, throws an error, and then leaves it at that - without restoring the deleted cells. This bug should be fixed by performing the macro actions only on KQC cells, and writing a good
try except
block where therestore_pcells_to_views
is called in case of exception.Definition of done
Reload Libraries
Versions
Version independent issue
Issue Severity
Low: it is annoying