qiskit-metal icon indicating copy to clipboard operation
qiskit-metal copied to clipboard

Qiskit Metal v0.5: PySide6, Removing GDSPY to GDSTK, PYAEDT v1.0, and many more changes

Open shanto268 opened this issue 1 year ago • 17 comments

What are the issues this pull addresses (issue numbers / links)?

Porting Qiskit Metal from PySide2 to PySide6 so that it can work natively on M* Macs (Apple Silicon).

Issues addressed:

  • [#798](https://github.com/qiskit-community/qiskit-metal/issues/798#issue-1253108197)
  • https://github.com/qiskit-community/qiskit-metal/issues/1001#issue-2660620368
  • https://github.com/qiskit-community/qiskit-metal/issues/991#issue-2360274496
  • https://github.com/qiskit-community/qiskit-metal/issues/690#issue-980627111
  • https://github.com/qiskit-community/qiskit-metal/pull/908#issuecomment-2481683172

Did you add tests to cover your changes (yes/no)?

No. N/A

Did you update the documentation accordingly (yes/no)?

Yes

Did you read the CONTRIBUTING document (yes/no)?

Yes

Summary

Fixed changes from PR #908 to pass automated CI workflows and tests, ensuring compatibility with updated dependencies, environment configurations, and the latest (11/17/2024) main branch.

Details and comments

  1. Built on top of changes made by @obrienpja in PR #908.

  2. Changes to QWidget_PlaceholderText and QTableView_AllComponents:

    • Refactored the QWidget_PlaceholderText class to ensure proper initialization and compatibility with PySide6.
    • Resolved issues with placeholder text styling by updating palette usage to align with PySide6 standards.
    • Updated QTableView_AllComponents to correctly inherit and integrate with QWidget_PlaceholderText, ensuring both functionality and visual styling work seamlessly.
    • Fixed initialization errors and ensured that the placeholder label behaves as intended when no components are available.
  3. Requirements and environment updates:

    • Updated the environment.yml file to use stable, OS-agnostic dependencies for Python 3.10.
    • Added missing dependencies, such as pyaedt, to ensure a consistent build across different operating systems.
    • Ensured that all dependencies align with the workflows and requirements in the lab's testing environment.
  4. Testing and validation:

    • Verified that the changes integrate seamlessly with the existing workflows and CI processes used in our lab.
    • Tested the updated branch against the current main branch workflows to confirm identical behavior.
    • All CI tests now pass successfully across all supported platforms (Windows, macOS, Ubuntu) and Python versions (3.9 and 3.10).

shanto268 avatar Nov 18 '24 01:11 shanto268

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Nov 18 '24 01:11 CLAassistant

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

:white_check_mark: obrienpja
:white_check_mark: priti-ashvin-shah-ibm
:x: shanto268
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Nov 18 '24 01:11 CLAassistant

Thank you, @shanto268! The tests are running. This is a giant PR, so it would be good to have more eyes on it than just you and me. Has anyone else from your lab tried this? I think after merging this, we could bump the Qiskit Metal version from 0.1.5 to 0.2. I just want to make sure it runs.

zlatko-minev avatar Nov 18 '24 01:11 zlatko-minev

Thanks! All tests have passed now, thankfully.

I totally agree—it indeed is a big PR, so having more eyes on it is a great idea. I’ll be using this version myself and asking my lab mates to do the same over the next couple of weeks. If everything runs smoothly, I’ll report back.

I’d also like to invite the great people—@PP501 and @DavidSomm—of the SQDMetal team to see if they can help beta test this version as well.

shanto268 avatar Nov 18 '24 02:11 shanto268

Awesome, that would be superb! Thank you everyone. Please don't be shy to post any comments here.

zlatko-minev avatar Nov 18 '24 02:11 zlatko-minev

Nice

zlatko-minev avatar Nov 19 '24 14:11 zlatko-minev

Linking pip install issue #1000

zlatko-minev avatar Dec 20 '24 20:12 zlatko-minev

I tried to use these changes with python 3.12 on Windows, for it to be installed, I modified the version of the packages (I give my requirements.txt file below), this is my feedback:

  1. the first time, I can open the gui without any problem, except the following error messages in the console of the gui metal: line: 0, func: None(), file: None WARNING: endResetModel called on QSortFilterProxyModel(0x1dd7a634b60) without calling beginResetModel first [_handle_qt_messages._qt_message_handler]

  2. all subsequent times that I try to run this code (even after restarting my computer), it crashes without any error message. I managed to find out that it crashes when running self.main_window.show() in main_window.py

  3. I tried to do the same in WSL, likewise the gui opened the first time with the same error messages in the console (when clicking on the arrow to close the gui, the big window closed but the small one kept reopening itself, I had to use Ctrl+C in the terminal to close it), then again, impossible to launch the gui again, but this time I get the message Segmentation fault in the terminal

Deleting and recreating the venv is not solving the issue.

I used this code to test the gui:

from qiskit_metal import designs, draw, MetalGUI, Dict, open_docs
design = designs.DesignPlanar()
gui = MetalGUI(design)

requirements.txt

addict==2.4.0
descartes==1.1.0
gdspy==1.6.13
geopandas==0.12.2
ipython==8.30.0
matplotlib==3.9.3
numpy==1.26.4
pandas==1.5.3
pint==0.20.1
pyEPR-quantum==0.9.0
pygments==2.18.0
pyside6
qdarkstyle==3.1
qutip==4.7.6
scipy==1.12.0
shapely==2.0.6
scqubits==3.1.0
gmsh==4.11.1
pyaedt==0.13.0
pyyaml==6.0.2
cython<3.0.0

I have not tried with a lower version of python.

I do not know if someone else can manage to reproduce this bug. Feel free to tell me how to provide more details if necessary, in particular how to get the error messages of Qt.

PositroniumJS avatar Dec 27 '24 03:12 PositroniumJS

I tried on Windows with Python 3.10.11, the exact requirements.txt of this branch except that I replace pyEPR-quantum by the version 0.9.0 and on a fresh kernel, on the first run I get:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[1], [line 1](vscode-notebook-cell:?execution_count=1&line=1)
----> [1](vscode-notebook-cell:?execution_count=1&line=1) from qiskit_metal import designs, draw, MetalGUI, Dict, open_docs
      [2](vscode-notebook-cell:?execution_count=1&line=2) design = designs.DesignPlanar()
      [3](vscode-notebook-cell:?execution_count=1&line=3) design.overwrite_enabled = True

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\qiskit_metal\__init__.py:116
    [112](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:112)         import matplotlib.pyplot as plt
    [113](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:113)         plt.ion()  # interactive
--> [116](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:116) __setup_Qt_backend()
    [117](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:117) del __setup_Qt_backend
    [119](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:119) ## Setup logging

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\qiskit_metal\__init__.py:113, in __setup_Qt_backend()
    [111](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:111) # pylint: disable=redefined-outer-name
    [112](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:112) import matplotlib.pyplot as plt
--> [113](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/qiskit_metal/__init__.py:113) plt.ion()

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\matplotlib\pyplot.py:554, in ion()
    [552](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/matplotlib/pyplot.py:552) stack.callback(ion if isinteractive() else ioff)
    [553](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/matplotlib/pyplot.py:553) matplotlib.interactive(True)
--> [554](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/matplotlib/pyplot.py:554) install_repl_displayhook()
    [555](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/matplotlib/pyplot.py:555) return stack

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\matplotlib\pyplot.py:157, in install_repl_displayhook()
    [155](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/matplotlib/pyplot.py:155) ipython_gui_name = backend2gui.get(get_backend())
    [156](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/matplotlib/pyplot.py:156) if ipython_gui_name:
--> [157](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/matplotlib/pyplot.py:157)     ip.enable_gui(ipython_gui_name)

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\ipykernel\zmqshell.py:491, in ZMQInteractiveShell.enable_gui(self, gui)
    [488](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/zmqshell.py:488) from .eventloops import enable_gui as real_enable_gui
    [490](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/zmqshell.py:490) try:
--> [491](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/zmqshell.py:491)     real_enable_gui(gui)
    [492](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/zmqshell.py:492)     self.active_eventloop = gui
    [493](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/zmqshell.py:493) except ValueError as e:

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\ipykernel\eventloops.py:597, in enable_gui(gui, kernel)
    [594](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:594) else:
    [595](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:595)     if gui.startswith("qt"):
    [596](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:596)         # Prepare the kernel here so any exceptions are displayed in the client.
--> [597](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:597)         make_qt_app_for_kernel(gui, kernel)
    [599](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:599) loop = loop_map[gui]
    [600](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:600) if (
    [601](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:601)     loop and kernel.eventloop is not None and kernel.eventloop is not loop  # type:ignore[unreachable]
    [602](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:602) ):

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\ipykernel\eventloops.py:568, in make_qt_app_for_kernel(gui, kernel)
    [565](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:565) from IPython.external.qt_for_kernel import QtCore
    [566](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:566) from IPython.lib.guisupport import get_app_qt4
--> [568](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:568) kernel.app = get_app_qt4([" "])
    [569](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/ipykernel/eventloops.py:569) kernel.app.qt_event_loop = QtCore.QEventLoop(kernel.app)

File c:\Users\account\Python_venv\qiskit-metal-10\lib\site-packages\IPython\lib\guisupport.py:115, in get_app_qt4(*args, **kwargs)
    [113](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/IPython/lib/guisupport.py:113) """Create a new qt4 app or return an existing one."""
    [114](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/IPython/lib/guisupport.py:114) from IPython.external.qt_for_kernel import QtGui
--> [115](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/IPython/lib/guisupport.py:115) app = QtGui.QApplication.instance()
    [116](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/IPython/lib/guisupport.py:116) if app is None:
    [117](file:///C:/Users/account/Python_venv/qiskit-metal-10/lib/site-packages/IPython/lib/guisupport.py:117)     if not args:

AttributeError: module 'PySide6.QtPrintSupport' has no attribute 'QApplication'

and when relaunching the code without restarting the kernel I get the usual death of the jupyter cell without any error message

PositroniumJS avatar Dec 27 '24 18:12 PositroniumJS

I have updated this branch with the latest merged PRs, resolved GUI setup issues related to resources, and corrected several text typos, thanks to @PositroniumJS. I plan to merge this in the next two weeks.

@shanto268 and @PositroniumJS, are you both comfortable with proceeding with the merge at this point?

After the merge, I will bump the major version of Qiskit Metal. Great job, everyone!

zlatko-minev avatar Dec 31 '24 13:12 zlatko-minev

@zlatko-minev on a fresh python 3.10.11 venv I still face problems: On the first import of qiskit-metal inside a jupyter notebook, I get an interference with matplotlib, but on the second import the error is solved:

AttributeError                            Traceback (most recent call last)
Cell In[2], line 1
----> 1 import qiskit_metal as metal
      2 from qiskit_metal import designs, draw
      3 from qiskit_metal import MetalGUI, Dict, open_docs

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\qiskit_metal\__init__.py:116
    112         import matplotlib.pyplot as plt
    113         plt.ion()  # interactive
--> 116 __setup_Qt_backend()
    117 del __setup_Qt_backend
    119 ## Setup logging

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\qiskit_metal\__init__.py:113, in __setup_Qt_backend()
    111 # pylint: disable=redefined-outer-name
    112 import matplotlib.pyplot as plt
--> 113 plt.ion()

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\matplotlib\pyplot.py:554, in ion()
    552 stack.callback(ion if isinteractive() else ioff)
    553 matplotlib.interactive(True)
--> 554 install_repl_displayhook()
    555 return stack

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\matplotlib\pyplot.py:157, in install_repl_displayhook()
    155 ipython_gui_name = backend2gui.get(get_backend())
    156 if ipython_gui_name:
--> 157     ip.enable_gui(ipython_gui_name)

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\ipykernel\zmqshell.py:491, in ZMQInteractiveShell.enable_gui(self, gui)
    488 from .eventloops import enable_gui as real_enable_gui
    490 try:
--> 491     real_enable_gui(gui)
    492     self.active_eventloop = gui
    493 except ValueError as e:

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\ipykernel\eventloops.py:597, in enable_gui(gui, kernel)
    594 else:
    595     if gui.startswith("qt"):
    596         # Prepare the kernel here so any exceptions are displayed in the client.
--> 597         make_qt_app_for_kernel(gui, kernel)
    599 loop = loop_map[gui]
    600 if (
    601     loop and kernel.eventloop is not None and kernel.eventloop is not loop  # type:ignore[unreachable]
    602 ):

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\ipykernel\eventloops.py:568, in make_qt_app_for_kernel(gui, kernel)
    565 from IPython.external.qt_for_kernel import QtCore
    566 from IPython.lib.guisupport import get_app_qt4
--> 568 kernel.app = get_app_qt4([" "])
    569 kernel.app.qt_event_loop = QtCore.QEventLoop(kernel.app)

File c:\Users\account\Python_venv\qiskit-metal-10-test\lib\site-packages\IPython\lib\guisupport.py:115, in get_app_qt4(*args, **kwargs)
    113 """Create a new qt4 app or return an existing one."""
    114 from IPython.external.qt_for_kernel import QtGui
--> 115 app = QtGui.QApplication.instance()
    116 if app is None:
    117     if not args:

AttributeError: module 'PySide6.QtPrintSupport' has no attribute 'QApplication'

Then when I try to launch the GUI, in the console I get this:

03:07PM 31s CRITICAL [_qt_message_handler]: line: 0, func: None(), file: None  WARNING: endResetModel called on QSortFilterProxyModel(0x2dc08222640) without calling beginResetModel first

I have two windows that open but they are "not responding" and totally blank

PositroniumJS avatar Dec 31 '24 14:12 PositroniumJS

@shanto268, even after installation of Pyside6, I am getting self.logger.warning( 541 "WARNING: No capacitance bodies added to the model other " 542 "than those connected to ground. ElmerFEM cannot run a " 543 "capacitance extraction analysis without any bodies. ") and ultimately final error points to self.logger.warning( 541 "WARNING: No capacitance bodies added to the model other " 542 "than those connected to ground. ElmerFEM cannot run a " 543 "capacitance extraction analysis without any bodies. ").

vegaonline avatar Jan 01 '25 03:01 vegaonline

QISKIT METAL v0.5 (2025) Partial Updates in Progress

Major Updates

This release addresses significant package changes and ports:

  • PyQt5 to PySide6: A complete overhaul of the GUI.
  • GDSPY to GDSTK: Replaced GDSPY with the more robust GDSTK library.
  • PYAEDT to Ansys (v1.0): Major update with a new syntax. Extensive testing required.
  • Installation Improvements: Transitioned to venv for faster environment setup, moving away from conda as the default. Also, most package versions have been floated and upgraded.

GUI Enhancements

  1. Traceback Reporting: Added detailed traceback reporting in the logging system to aid debugging.
  2. Model Reset Issue: Fixed the issue causing the warning: "metal: WARNING: endResetModel called on LibraryFileProxyModel(0x17fda8200) without calling beginResetModel first (No context available from Qt)".
  3. MPL Renderer Issue: Working toresovle the error: "Ignoring fixed y limits to fulfill fixed data aspect with adjustable data limits. Ignoring fixed x limits to fulfill fixed data aspect with adjustable data limits.".
  4. UI Button Update: Added a red border style to the "Create Component" button in the UI for better visibility.

PYAEDT Update

  • FutureWarning: The pyaedt module has been restructured and is now an alias for the new package structure based on ansys.aedt.core. To avoid issues in future versions, please update your imports to use the new architecture. Additionally, several files have been renamed to follow the PEP 8 naming conventions. For more information, refer to the Ansys AEDT documentation.

The current files have many of these changes, inclduign the GDSTK Update, please do check. I have not yet pushed the HFSS part as this is still work in progress and hard

zlatko-minev avatar Jan 26 '25 22:01 zlatko-minev

Thank you for these updates, I tried with python 3.12.7 and I faced several issues:

requirements

To install, I needed to change a couple of requirements:

numpy>=1.24.2,<2
scipy>=1.10.0

numpy because geopandas is incompatible with numpy 2, scipy because this version is not compatible with my python version.

The error message I got for numpy ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

GUI

It looks to work fine except that it is composed of a small window and a big one, the small used to close itself after launch but now it remains opened; I have a custom QComponent which is flipped (bottom-top) when I create it directly from the GUI but not from the jupyter nb and its options are printed in the jupyter cell; a message is showing frequently in the jupyter cell output:

Ignoring fixed y limits to fulfill fixed data aspect with adjustable data limits.
Ignoring fixed x limits to fulfill fixed data aspect with adjustable data limits.

GDS renderer

To render a GDS, I faced several issues in gds_renderer.py:

  • TypeError: 'max_points' is an invalid keyword argument for FlexPath() I removed this argument everywhere in the file.
    An example of detailed error message
-> 2469         new_flexpath = gdstk.FlexPath(
   2470             path_points,
   2471             use_width,
   2472             layer=layer_num,
   2473             datatype=11,
   2474             max_points=max_points,
   2475         )
   2476         return new_flexpath
   2478 self.logger.warning(f"Unsupported geometry type={type(geom)} in"
   2479                     " _qgeometry_to_gds. Expected Polygon/LineString.")

TypeError: 'max_points' is an invalid keyword argument for FlexPath()
  • Library.new_cell() takes no keyword arguments I removed the argument overwrite_duplicate=True for this function everywhere in the file
-> 1556     all_chips_top = lib.new_cell(all_chips_top_name,
   1557                                  overwrite_duplicate=True)
   1558     for chip_name, _ in self.chip_info.items():
   1559         chip_only_top_name = f"TOP_{chip_name}"

TypeError: Library.new_cell() takes no keyword arguments
  • Cell.add takes a different input type Add a '*' in the call everywhere in the file when the input is a list (https://heitzmann.github.io/gdstk/library/gdstk.Cell.html#gdstk.Cell.add)
   1740 subtract_cell.add(
   1741     self.chip_info[chip_name][chip_layer]["q_subtract_true"])
   1743 # gdspy.boolean() is not documented clearly.  If there are multiple
   1744 # elements to subtract (both poly & path), the way I could
   1745 # make it work is to put them into a cell, within lib. I used
   1746 # the method cell_name.get_polygons(), which appears to convert
   1747 # all elements within the cell to poly. After the boolean(),
   1748 # I deleted the cell from lib. The memory is freed up then.
   1749 diff_geometry = gdstk.boolean(
   1750     [self.chip_info[chip_name]["subtract_poly"]],
   1751     subtract_cell.polygons,
   (...)
   1756     max_points=max_points,
   1757 )

TypeError: Arguments must be Polygon, FlexPath, RobustPath, Label or Reference.
  • max_points again
1749 diff_geometry = gdstk.boolean(
   1750     [self.chip_info[chip_name]["subtract_poly"]],
   1751     subtract_cell.polygons,
   1752     "not",
   1753     layer=chip_layer,
   1754     datatype=10,
   1755     precision=precision,
   1756     max_points=max_points,
   1757 )
   1759 lib.remove(subtract_cell)
   1761 if diff_geometry is None:

TypeError: boolean() takes at most 6 arguments (7 given)
  • get_bounding_box --> bounding_box
 1582 if chip_only_top.get_bounding_box() is not None:
   1583     all_chips_top.add(gdstk.Reference(chip_only_top))
   1584 else:

AttributeError: 'gdstk.Cell' object has no attribute 'get_bounding_box'
  • the export is not looking good I noticed several errors in the export when opening the gds file, at very least there are errors on fillet and cpw

image

PositroniumJS avatar Jan 27 '25 11:01 PositroniumJS

If I had to guess, I suspect the unexpected output in the gds file would be due to some fundamental differences between gdspy and gdstk under the hood.

The primary motivation for gdstk was to modify the underlying structure and processes of the module, indicating that even if the functions execute with the changes as suggested by @PositroniumJS, there are some "new ways of doing things" with gdstk that the GDS exporter does not yet account for.

SamWolski avatar Jan 30 '25 18:01 SamWolski

@shanto268 I made a pull request on your branch from your fork to fix the GDS renderer. shanto268/qiskit-metal#1 @zlatko-minev the remaining changes that I see missing are:

  • the second GUI window that stays open all the time
  • update of dependencies (pyaedt, pandas, geopandas, numpy, ...)

But perhaps it would be better to address these points in a new PR, this one is starting to look a bit heavy?

PositroniumJS avatar May 01 '25 01:05 PositroniumJS

@shanto268 the PRs shanto268#2 and shanto268#3 performs the remaining changes related to gdspy!

PositroniumJS avatar Jun 17 '25 23:06 PositroniumJS

Amazing work! Are there any blockers left?

Epsilon-Iridani avatar Sep 08 '25 19:09 Epsilon-Iridani

Amazing work! Are there any blockers left?

The GDS creation is working now. The remaining issues are:

  • the second GUI window that stays open all the time
  • update of dependencies (pyaedt, pandas, geopandas, numpy, ...) But perhaps it would be better to address these points in a new PR, this one is already quite heavy.

However, Zlatko has left IBM so it looks like the project has been shelved

PositroniumJS avatar Sep 08 '25 20:09 PositroniumJS

Nope, not shelved, just now it’s community driven. We have been a little slow to get all the maintenance I’ve been running, but I think that’s the intention of community. So it would be nice to get this merged when you feel it’s ready.On Sep 8, 2025, at 11:07 PM, PositroniumJS @.***> wrote:PositroniumJS left a comment (qiskit-community/qiskit-metal#1002)

Amazing work! Are there any blockers left?

The GDS creation is working now. The remaining issues are:

the second GUI window that stays open all the time update of dependencies (pyaedt, pandas, geopandas, numpy, ...) But perhaps it would be better to address these points in a new PR, this one is already quite heavy.

However, Zlatko has left IBM so it looks like the project has been shelved

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

zlatko-minev avatar Sep 08 '25 20:09 zlatko-minev

Nope, not shelved, just now it’s community driven. We have been a little slow to get all the maintenance I’ve been running, but I think that’s the intention of community. So it would be nice to get this merged when you feel it’s ready.

From my humble point of view, this PR can be merged (94 files modified it is already quite a lot). In a new PR, it would then be easier to finish to set the correct requirements.

Regarding the second window that is staying open, I have tried to fix it but I could not manage it as I have never used PySide before. I would be very grateful if you @zlatko-minev could check this out.

PositroniumJS avatar Sep 08 '25 20:09 PositroniumJS

The only issue right now is that the docs and linting are failing along with a few tests

zlatko-minev avatar Sep 20 '25 13:09 zlatko-minev

Maybe we can try to resolve this in a couple days and then merge it to Maine, we wouldn’t yet publish to any of the pip etc. Until it’s a little more cleaned up and tested bugs, which I feel are present in some key functionality

zlatko-minev avatar Sep 20 '25 13:09 zlatko-minev

  • Lint is fixed by my new PR https://github.com/shanto268/qiskit-metal/pull/5 (@shanto268 may you merge it please)
  • doc needs an update of the config of GitHub actions, since this update is dropping support of python<3.10, could you please @zlatko-minev at the same time update the versions used to run the tests?

PositroniumJS avatar Sep 20 '25 19:09 PositroniumJS

Hi folks, my PR https://github.com/shanto268/qiskit-metal/pull/6 to @shanto268's fork moves to pyproject.toml and uv for significantly faster virtual environment creation. Dependencies are now locked (some more testing is needed to isolate specific version constraints for M* Macs, etc. but we have the same versions as in the previous setup.py for now). This only affects development and does not change anything for users. This setup is currently incompatible with the GitHub actions workflows, but I will update those in a follow-up commit which will speedup workflows by a lot as we can use caching extensively. uv simplifies a lot of things, including package building and upload to PyPI.

Tox tasks have been moved into pyproject.toml, helping us move towards a more centralized package configuration. tox-uv is used to ensure that uv is used for the tox environment management. Some general updates to various tox tasks:

  • pytest can work as a drop-in replacement for unittest in this case.
  • (Dev) Dependency groups can reproduce previous tox workflows where different requirements-*.txt files were used. I haven't removed those files yet, but will do so during the docs cleanup for the next release.
  • Instead of checking for a particular file to determine whether we are building docs, we check for an environment variable instead. This bypassed the need for touch to be an allowlist_external.

For me, pylint stalls on one of the source files in qiskit_metal/_gui/, but the lint task starts running just fine. Given how slow yapf and pylint are, we should really move to the drop-in replacement ruff for yet another significant speedup. It supports all the various rules in .style.yapf and .pylintrc (some of which are now deprecated), but ruff also has pretty sensible defaults. @zlatko-minev, do we need to preserve the current rules? Once lint is faster, we could even move it to pre-commit (it would be pretty much instantaneous, even on a modest laptop).

Regarding PyPI release, I think it would help to push to PyPI as a pre-release (with granular alpha/beta/dev version tags) so that uses can try a pip install --pre qiskit-metal.

abhishekchak52 avatar Sep 23 '25 15:09 abhishekchak52

Hi folks, my PR shanto268#6 to @shanto268's fork moves to pyproject.toml and uv for significantly faster virtual environment creation. Dependencies are now locked (some more testing is needed to isolate specific version constraints for M* Macs, etc. but we have the same versions as in the previous setup.py for now). This only affects development and does not change anything for users. This setup is currently incompatible with the GitHub actions workflows, but I will update those in a follow-up commit which will speedup workflows by a lot as we can use caching extensively. uv simplifies a lot of things, including package building and upload to PyPI.

Tox tasks have been moved into pyproject.toml, helping us move towards a more centralized package configuration. tox-uv is used to ensure that uv is used for the tox environment management. Some general updates to various tox tasks:

  • pytest can work as a drop-in replacement for unittest in this case.
  • (Dev) Dependency groups can reproduce previous tox workflows where different requirements-*.txt files were used. I haven't removed those files yet, but will do so during the docs cleanup for the next release.
  • Instead of checking for a particular file to determine whether we are building docs, we check for an environment variable instead. This bypassed the need for touch to be an allowlist_external.

For me, pylint stalls on one of the source files in qiskit_metal/_gui/, but the lint task starts running just fine. Given how slow yapf and pylint are, we should really move to the drop-in replacement ruff for yet another significant speedup. It supports all the various rules in .style.yapf and .pylintrc (some of which are now deprecated), but ruff also has pretty sensible defaults. @zlatko-minev, do we need to preserve the current rules? Once lint is faster, we could even move it to pre-commit (it would be pretty much instantaneous, even on a modest laptop).

Regarding PyPI release, I think it would help to push to PyPI as a pre-release (with granular alpha/beta/dev version tags) so that uses can try a pip install --pre qiskit-metal.

While these are great changes, it feels like it should be a separate PR. Please correct me if I'm mistaken, but this doesn't seem directly relevant to migrating away from PySide2.

SamWolski avatar Sep 25 '25 20:09 SamWolski

@SamWolski I agree. This would build upon the changes corresponding to this part of the update (quoting from Zlatko's comment above):

Installation Improvements: Transitioned to venv for faster environment setup, moving away from conda as the default. Also, most package versions have been floated and upgraded.

I'm more than happy to open a new PR once the existing set of changes are merged. This is rather separate from the PySide and pyaedt things and I don't want to hold this PR back.

abhishekchak52 avatar Sep 25 '25 21:09 abhishekchak52

I don't know if I'm doing something wrong, but bumping pyaedt to any version beyond 0.17.5 seems to knock out Macs from being able to import aedt at all, and thereby being unable to run metal in any substantial capacity: https://github.com/ansys/pyaedt/commit/f059f32ef9925180520ae7438a3f3b542fa6177e#diff-c863a56d1bb236623c1cbc17f49785d2a87277da612daf3ecbfd7c663ab62867L221

Obviously I don't expect to actually run any Ansys simulations on macOS, but currently I can't even instantiate a Design object due to metal trying to import the renderer and failing. We could restrict importing to only happen when you want to actually render to Ansys, maybe even going as far as making it an optional dependency.

SamWolski avatar Sep 25 '25 21:09 SamWolski

Obviously I don't expect to actually run any Ansys simulations on macOS, but currently I can't even instantiate a Design object due to metal trying to import the renderer and failing. We could restrict importing to only happen when you want to actually render to Ansys, maybe even going as far as making it an optional dependency.

Currently, a lot of things (analysis backends, rendering backends, etc.) are imported with the module. Decoupling this would take some refactoring, but a more modular package structure would benefit us in the long term.

abhishekchak52 avatar Sep 26 '25 12:09 abhishekchak52

Obviously I don't expect to actually run any Ansys simulations on macOS, but currently I can't even instantiate a Design object due to metal trying to import the renderer and failing. We could restrict importing to only happen when you want to actually render to Ansys, maybe even going as far as making it an optional dependency.

Currently, a lot of things (analysis backends, rendering backends, etc.) are imported with the module. Decoupling this would take some refactoring, but a more modular package structure would benefit us in the long term.

My point is that this fork/PR doesn't run at all on any Mac. The module imports, but if I can't instantiate a DesignPlanar then I can't actually do anything.

On the main branch, the pyaedt version is much older, and although metal can't be installed "natively" due to some pyside2 futzing (one of the central motivations for this PR in the first place), there are workarounds using for example the CONDA_SUBDIR=osx-64 var when creating the environment in anaconda.

SamWolski avatar Sep 26 '25 13:09 SamWolski