Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ QuantUI/
│ ├── app_structure_edit.py ← Edit Structure tools (set bond/angle/dihedral, delete atoms…)
│ ├── app_measurement.py ← click-to-measure distances/angles in the viewer
│ ├── app_pes_pick.py ← pick PES-scan atoms in the viewer
│ ├── app_pick_mode.py ← workspace viewer pick mode (measure / edit structure / pick scan atoms)
│ ├── app_xyz_input.py ← XYZ Input tab handlers
│ ├── app_visualization.py ← Trajectory / vib / IR / orbital / PES rendering
│ ├── app_history.py ← History tab loaders, replay context
Expand Down
25 changes: 24 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,28 @@ and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.ht

## [Unreleased]

## [0.13.2] - 2026-12-05

### Changed

- **One molecule viewer with the two-pane workspace.** The Calculate tab no
longer shows a second copy of the molecule: Edit Structure and atom
picking for PES scans now use the workspace pane's viewer. Opening Edit
Structure or choosing PES Scan switches the pane into a pick mode with a
banner ("Clicking picks atoms for … [Done]"); the atom list, highlights
and the status footer follow it, and Done returns to measuring. With the
workspace turned off, the Calculate tab keeps its own viewer as before.

### Fixed

- **PyFock geometry optimizations:** every step energy except the final one
was too high by 2.3 × 10⁻⁶ of the total energy (0.11 kcal/mol for water,
about 1.4 kcal/mol for a molecule near −1000 Eh). PyFock reports energies
in eV with its own Hartree→eV constant; QuantUI now converts them back
with the same constant. The final energy was already right (it comes from
the required single point). The backend cross-check now also compares the
first optimization step's energy.

## [0.13.1] - 2026-12-05

### Fixed
Expand Down Expand Up @@ -1723,7 +1745,8 @@ Initial public scaffolding of the QuantUI package: `quantui` package with
`calculator.py`, basic notebook launcher, Apptainer container definition,
MIT license, and project metadata.

[Unreleased]: https://github.com/The-Schultz-Lab/QuantUI/compare/v0.13.1...HEAD
[Unreleased]: https://github.com/The-Schultz-Lab/QuantUI/compare/v0.13.2...HEAD
[0.13.2]: https://github.com/The-Schultz-Lab/QuantUI/compare/v0.13.1...v0.13.2
[0.13.1]: https://github.com/The-Schultz-Lab/QuantUI/compare/v0.13.0...v0.13.1
[0.13.0]: https://github.com/The-Schultz-Lab/QuantUI/compare/v0.12.0...v0.13.0
[0.12.0]: https://github.com/The-Schultz-Lab/QuantUI/compare/v0.11.1...v0.12.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "quantui"
version = "0.13.1"
version = "0.13.2"
description = "An open-source frontend for DFT and post-HF quantum chemistry with PySCF"
readme = "README.md"
requires-python = ">=3.9"
Expand Down
2 changes: 1 addition & 1 deletion quantui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
PySCF requires Linux/macOS/WSL. Windows users should use the Apptainer container.
"""

__version__ = "0.13.1"
__version__ = "0.13.2"

import logging
from typing import Any
Expand Down
30 changes: 28 additions & 2 deletions quantui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@
from quantui.app_menubar import build_menubar as _mb_build_menubar
from quantui.app_menubar import menubar_js as _mb_menubar_js
from quantui.app_pes2d import scan2d_enabled as _scan2d_enabled
from quantui.app_pick_mode import pick_mode_active as _pm_active
from quantui.app_pick_mode import sync_pick_mode as _pm_sync
from quantui.app_runflow import (
apply_scan_range_around_current as _run_apply_scan_range_around_current,
)
Expand Down Expand Up @@ -639,8 +641,10 @@
from quantui.app_workspace import build_workspace as _ws_build_workspace
from quantui.app_workspace import finalize_viewer_html as _ws_finalize_viewer_html
from quantui.app_workspace import labels_enabled as _ws_labels_enabled
from quantui.app_workspace import render_viewer as _ws_render_viewer
from quantui.app_workspace import show_input_preview as _ws_show_input_preview
from quantui.app_workspace import viewer_render_kwargs as _ws_viewer_render_kwargs
from quantui.app_workspace import workspace_enabled as _ws_workspace_on
from quantui.app_xyz_input import (
on_load_xyz as _xyz_on_load_xyz,
)
Expand Down Expand Up @@ -2006,6 +2010,13 @@ class QuantUIApp:
_analysis_empty_html: Any
_analysis_mol_output: Any
_ws_shell: Any
_ws_pick_mode: str
_ws_pick_paused: bool
_ws_pick_snapshot: Any
_ws_pick_backend: str
_ws_pick_banner: Any
_ws_pick_banner_html: Any
_ws_pick_btn: Any
_mb_host: Any
_mb_row: Any
_mb_js_bridge: Any
Expand Down Expand Up @@ -2539,6 +2550,9 @@ def _on_root_tab_changed(self, change) -> None:
new = change.get("new")
if self._is_tab(new, "analysis"):
_ana_scroll_analysis_tab_to_top(self)
# The Calculate tab's click tools own the workspace viewer only while
# that tab is selected (app_pick_mode).
_pm_sync(self)
if _slurm_jobs_tab_visible(self) and self._is_tab(new, "slurm_jobs"):
_slurm_refresh_jobs_tab(self)
# Runs save new result folders while Files is out of view; re-list on
Expand Down Expand Up @@ -4349,6 +4363,11 @@ def _refresh_calc_mol_viewer(self, *, backend: Optional[str] = None) -> None:
"""
if self._molecule is None or _render_molecule_html is None:
return
if _ws_workspace_on(self):
# Two-pane workspace: no Calculate viewer; Edit Structure and PES
# scan picking use the pane's viewer through a pick mode.
_pm_sync(self)
return
# Reserve the viewer's height only once there is a viewer, so the
# empty Calculate tab has no blank block.
self.viz_output.layout.min_height = _CALC_VIEWER_MIN_HEIGHT
Expand Down Expand Up @@ -4564,7 +4583,10 @@ def _rerender_3d_views(self, *, keep_picks: bool = False) -> None:
self._refresh_calc_mol_viewer(backend=str(chosen))

# Analysis-tab molecule viewer (ANALYSIS_STRUCTURE_VIEW task).
if self._analysis_displayed_molecule is not None:
if self._analysis_displayed_molecule is not None and _pm_active(self):
# A Calculate tool owns the workspace viewer: its click wiring.
_ws_render_viewer(self, keep_picks=True)
elif self._analysis_displayed_molecule is not None:
chosen = self._resolve_backend(VizTask.ANALYSIS_STRUCTURE_VIEW)
if chosen is not None:
# Same render path as the first draw (app_visualization.
Expand Down Expand Up @@ -4903,7 +4925,11 @@ def _on_viz_style_changed(self, change) -> None:

def _on_viz_lighting_changed(self, change) -> None:
self._viz_lighting = change["new"]
self._refresh_calc_mol_viewer()
if _ws_workspace_on(self):
# The workspace viewer is the only one on screen.
self._rerender_3d_views(keep_picks=True)
else:
self._refresh_calc_mol_viewer()

# ── Molecule input ────────────────────────────────────────────────────

Expand Down
2 changes: 1 addition & 1 deletion quantui/app_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,7 @@ def build_shared_widgets(
app._scan_pick_readout = widgets.HTML(
value=(
f'<span style="font-size:12px;color:{_theme.css.TEXT_SECONDARY}">'
"Click atoms in the viewer above (py3Dmol) to fill the fields.</span>"
"Click atoms in the 3D viewer (py3Dmol) to fill the fields.</span>"
)
)
app._scan_pick_clear_btn = widgets.Button(
Expand Down
8 changes: 7 additions & 1 deletion quantui/app_measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,14 @@ def _clear_inbox() -> None:
def on_measure_clear(app: Any, btn: Any = None) -> None:
"""Clear button: empty the pick chain and its highlights."""
_ = btn
from .app_pick_mode import measuring_off_text, pick_mode_active

app._measure_picks = []
_set_readout(app, _PLACEHOLDER_TEXT)
# While a Calculate tool owns the workspace viewer's clicks, the readout
# keeps saying so (the Clear button is still on screen).
_set_readout(
app, measuring_off_text(app) if pick_mode_active(app) else _PLACEHOLDER_TEXT
)
push_highlight(app, [])
_notify_selection(app)

Expand Down
13 changes: 9 additions & 4 deletions quantui/app_pes_pick.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""Click-to-pick atom selection for PES Scan setup (Calculate-tab viewer).
"""Click-to-pick atom selection for PES Scan setup.

Reuses the py3Dmol click transport and highlight overlay from
:mod:`quantui.app_measurement`, but fills the PES scan atom dropdowns instead
of the measure readout.
of the measure readout. The viewer clicked is the Calculate tab's own one, or
— with the two-pane workspace on — the pane's viewer in its "pick scan atoms"
mode (``app_pick_mode``).
"""

from __future__ import annotations
Expand Down Expand Up @@ -34,7 +36,10 @@ def _scan_pick_indices(app: Any) -> List[int]:


def push_scan_highlight(app: Any, indices: Sequence[int]) -> None:
"""Highlight scan atoms on the live Calculate-tab viewer."""
"""Highlight scan atoms on the live viewer that takes the scan clicks."""
from .app_pick_mode import notify_pick_views

notify_pick_views(app) # workspace atom list / footer, in the scan mode
bridge = getattr(app, "_scan_pick_bridge", None)
if bridge is None:
return
Expand Down Expand Up @@ -124,6 +129,6 @@ def clear_pes_pick(app: Any) -> None:
if readout is not None:
readout.value = (
'<span style="font-size:12px;color:#64748b">'
"Click atoms in the viewer above (py3Dmol) to fill the fields.</span>"
"Click atoms in the 3D viewer (py3Dmol) to fill the fields.</span>"
)
push_scan_highlight(app, _scan_pick_indices(app))
Loading