-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PySide6 Compatibility #1002
base: main
Are you sure you want to change the base?
PySide6 Compatibility #1002
Conversation
For ubuntu unit tests
Hoping this will resolve an issue with running tests and doc building
|
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. |
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. |
Awesome, that would be superb! Thank you everyone. Please don't be shy to post any comments here. |
Nice |
Linking pip install issue #1000 |
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
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)
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. |
I tried on Windows with Python ---------------------------------------------------------------------------
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 |
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! |
Bumping Qiskit Metal version. Overdue.
Update README_ARCH.md: Fixed meramid theme
@zlatko-minev on a fresh python 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 |
@shanto268, even after installation of Pyside6, I am getting |
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:
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
Built on top of changes made by @obrienpja in PR #908.
Changes to
QWidget_PlaceholderText
andQTableView_AllComponents
:QWidget_PlaceholderText
class to ensure proper initialization and compatibility withPySide6
.PySide6
standards.QTableView_AllComponents
to correctly inherit and integrate withQWidget_PlaceholderText
, ensuring both functionality and visual styling work seamlessly.Requirements and environment updates:
environment.yml
file to use stable, OS-agnostic dependencies for Python 3.10.pyaedt
, to ensure a consistent build across different operating systems.Testing and validation:
main
branch workflows to confirm identical behavior.