Line data Source code
1 : # SPDX-FileCopyrightText: 2025 PairInteraction Developers
2 : # SPDX-License-Identifier: LGPL-3.0-or-later
3 :
4 1 : from pathlib import Path
5 :
6 1 : from PySide6.QtCore import Qt
7 1 : from PySide6.QtGui import QFont, QPixmap
8 1 : from PySide6.QtWidgets import QFrame, QLabel, QScrollArea, QVBoxLayout, QWidget
9 :
10 1 : from pairinteraction_gui.page.base_page import BasePage
11 :
12 1 : images_dir = Path(__file__).parent.parent / "images"
13 :
14 :
15 1 : class AboutPage(BasePage):
16 : """Page for displaying information about PairInteraction and the PairInteraction gui."""
17 :
18 1 : title = "About"
19 1 : tooltip = "Learn more about PairInteraction"
20 : # icon_path = Path(__file__).parent.parent / "icons" / "about.svg"
21 :
22 1 : def setupWidget(self) -> None:
23 : """Set up the about page with application information."""
24 : # Create a scroll area to handle content that might overflow
25 0 : scroll = QScrollArea()
26 0 : scroll.setWidgetResizable(True)
27 0 : scroll.setFrameShape(QFrame.Shape.NoFrame)
28 :
29 : # Create a container widget for the scroll area
30 0 : container = QWidget()
31 0 : layout = QVBoxLayout(container)
32 0 : layout.setAlignment(Qt.AlignmentFlag.AlignTop)
33 0 : layout.setSpacing(30)
34 0 : layout.setContentsMargins(40, 40, 40, 40)
35 :
36 : # Title with modern styling
37 0 : title = QLabel("PairInteraction")
38 0 : title_font = QFont()
39 0 : title_font.setPointSize(32)
40 0 : title_font.setBold(True)
41 0 : title.setFont(title_font)
42 0 : title.setAlignment(Qt.AlignmentFlag.AlignCenter)
43 0 : layout.addWidget(title)
44 :
45 : # Description with better formatting
46 0 : desc = QLabel(
47 : "<p style='font-size: 14px; line-height: 1.5;'>"
48 : "The PairInteraction software calculates properties of Rydberg atoms. "
49 : "It consists of a Python library and this graphical user interface for obtaining "
50 : "single-atom properties and calculating pair potentials, making use of a "
51 : "high-performance C++ backend."
52 : "</p>"
53 : )
54 0 : desc.setWordWrap(True)
55 0 : desc.setTextFormat(Qt.TextFormat.RichText)
56 0 : layout.addWidget(desc)
57 :
58 : # Features with improved styling
59 0 : features = QLabel(
60 : "<div style='font-size: 14px; line-height: 1.6;'>"
61 : "<b>Key Features:</b><br>"
62 : "• Optimized construction and diagonalization of Hamiltonians<br>"
63 : "• Support for single-channel quantum defect theory (SQDT)<br>"
64 : "• Support for multi-channel quantum defect theory (MQDT)<br>"
65 : "• Electric and magnetic fields in arbitrary directions<br>"
66 : "• Support for diamagnetism"
67 : "</div>"
68 : )
69 0 : features.setWordWrap(True)
70 0 : features.setTextFormat(Qt.TextFormat.RichText)
71 0 : layout.addWidget(features)
72 :
73 : # Benchmark image
74 0 : image_label = QLabel()
75 0 : pixmap = QPixmap(images_dir / "0845d67063_1.4.2-cp313-win_amd-ryzen-7-5700g-with-radeon-graphics_reps4.png")
76 0 : scaled_pixmap = pixmap.scaled(
77 : 800, 400, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation
78 : )
79 0 : image_label.setPixmap(scaled_pixmap)
80 0 : image_label.setAlignment(Qt.AlignmentFlag.AlignCenter)
81 0 : layout.addWidget(image_label)
82 :
83 : # Image caption
84 0 : caption = QLabel(
85 : "<p style='font-size: 12px; color: #666; text-align: center;'>"
86 : "Figure: Benchmarking the construction and diagonalization of a Hamiltonian of a pair of Rb 60S atoms "
87 : "for 100 different internuclear distances on an AMD Ryzen 7 5700G CPU using Windows 11. "
88 : "The Hilbert space comprises pair states that differ at most by 4 in n, l and 25GHz in energy. "
89 : "When supported, symmetries were used to reduce the Hilbert space size. "
90 : "See the <a href='https://github.com/pairinteraction/pairinteraction/tree/master/tools/benchmarking' "
91 : "style='color: #007bff;'>benchmarking tool</a>."
92 : "</p>"
93 : )
94 0 : caption.setWordWrap(True)
95 0 : caption.setTextFormat(Qt.TextFormat.RichText)
96 0 : caption.setAlignment(Qt.AlignmentFlag.AlignCenter)
97 0 : caption.setOpenExternalLinks(True)
98 0 : layout.addWidget(caption)
99 :
100 : # Citation with better styling
101 0 : citation = QLabel(
102 : "<div style='font-size: 14px; line-height: 1.5; margin: 20px 0;'>"
103 : "<b>Please Cite:</b><br>"
104 : "Sebastian Weber, Christoph Tresp, Henri Menke, Alban Urvoy, Ofer Firstenberg, "
105 : "Hans Peter Büchler, Sebastian Hofferberth, "
106 : "<i>Tutorial: Calculation of Rydberg interaction potentials</i>, "
107 : "J. Phys. B: At. Mol. Opt. Phys. 50, 133001 (2017)"
108 : "</div>"
109 : )
110 0 : citation.setWordWrap(True)
111 0 : citation.setTextFormat(Qt.TextFormat.RichText)
112 0 : citation.setOpenExternalLinks(True)
113 0 : layout.addWidget(citation)
114 :
115 : # Links with improved styling
116 0 : links = QLabel(
117 : "<div style='font-size: 14px; line-height: 1.5;'>"
118 : "<b>Links:</b><br>"
119 : "• <a href='https://github.com/pairinteraction/pairinteraction' "
120 : "style='color: #007bff;'>GitHub Repository</a><br>"
121 : "• <a href='https://arxiv.org/abs/1612.08053' style='color: #007bff;'>arXiv:1612.08053</a><br>"
122 : "• <a href='https://www.gnu.org/licenses/lgpl-3.0.html' style='color: #007bff;'>License: LGPL v3</a>"
123 : "</div>"
124 : )
125 0 : links.setTextFormat(Qt.TextFormat.RichText)
126 0 : links.setOpenExternalLinks(True)
127 0 : layout.addWidget(links)
128 :
129 : # Set the container as the scroll area widget
130 0 : scroll.setWidget(container)
131 :
132 : # Add the scroll area to the main layout
133 0 : self.layout().addWidget(scroll)
|