Electron density contour map in a plane (molecular plane or three atoms)
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- c
- Domain
- data-visualization
Research direction
Start by reading ComputeMoCmd in src/viz and the MoDiagramCanvas pattern; the issue calls for a wx-free evaluator library, CLI, tests, a headless render tool and an MO-panel integration. Run the evaluator and rendering tests, then compare point values and plane plots against Multiwfn. Done means the specified density, plane, contour, canvas and export workflows pass the listed numerical and headless-render checks.
Written by the indexing model from the issue text.
Description
Summary
A 2D contour map of the electron density (and spin density) in a chosen plane, the classic textbook figure. ECCE already computes the density from each calculation's MO coefficients, occupations and basis (ComputeMoCmd, MO panel "Density" / "Spin Density"), but only on an axis-aligned 3D grid for isosurfaces. The MO panel's "Contour" style draws a single isovalue on the 3D surface, not a map in a plane.
The new application icon (benzene in-plane density, log-spaced contours, viridis) shows this kind of figure. It is currently drawn from a model density; once this feature exists, the icon should be regenerated from ECCE's own output.
Design
Per the project rule, analysis goes in a wx-free library with a CLI and tests; the panel only gathers options and draws.
- Point evaluator. Move the density evaluation out of
ComputeMoCmd(src/viz) into a wx-free library: ρ(r) = Σ_μν P_μν φ_μ(r) φ_ν(r) from the stored MOs and occupations, at arbitrary points. The 3D grid command then calls the same code, so there is one implementation. - Plane. Default: the least-squares plane through all atoms, used when it fits (RMS deviation below a threshold, e.g. benzene, water). Otherwise the plane through three atoms the user selects. In-plane axes from the principal axes; a margin around the projected atoms.
- Contours. Marching squares on a plane grid (resolution about 0.05 Å, adjustable). Log-spaced levels by default (the density spans orders of magnitude), with a linear option, a level count, and limits. Contours of the core density are capped, so the nuclei do not turn into solid blots.
- Canvas. A header-only canvas in the
MoDiagramCanvaspattern: contour lines in viridis, atom positions and labels, a scale bar in Å, and a colour key giving the level values (e/bohr³). It must be paintable to a bitmap headlessly, with a render tool and a test. - Panel. In the MO panel, beside the isosurface controls: field (density, spin density, a selected MO with signed contours, dashed for negative), plane choice, levels. Export to PNG/SVG.
Verification
- Evaluator: the density integrated over a large 3D grid gives N electrons (e.g. 10 for water, 42 for benzene) to within grid error. Cusps sit at the nuclei.
- Against an independent oracle: Multiwfn's plane contour plots of the same Gaussian and ORCA outputs, and point values of ρ at chosen points compared numerically, not by eye.
- Headless renders for water, benzene and an open-shell case (spin density), reviewed as PNGs.
- A plane through three atoms of a non-planar molecule (e.g. through H–C–H of CH₄).
Estimate
2–3 days, most of it the evaluator extraction and the oracle comparison.
- Dominant language
- C
- Stars
- 10
- Forks
- 8
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from FriendsofECCE/ECCE
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
FriendsofECCE/ECCE#336 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
FriendsofECCE/ECCE#339 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
FriendsofECCE/ECCE#338 · 2 comments ·
-
Basis Set Tool: periodic table cut off on the right; elements 110-118 still have placeholder namesOpen
Difficulty 4/5 3-5 days Newbie friendliness 40/100
FriendsofECCE/ECCE#337 ·
-
Difficulty 5/5 Over a week Newbie friendliness 8/100
FriendsofECCE/ECCE#335 ·
All issues in FriendsofECCE/ECCE
Similar issues
-
[Issue]: hipsparselt.h C API as shipped now requires C23 -- ONLY because of missing include or guardOpen
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ROCm/rocm-libraries#13736 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
`inverse()` of a controlled `CUGate` drops the phase parameter γPossibly taken @rupasri118 claimed this today. Openbug mod: circuit
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Qiskit/qiskit#17223 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
OpenPrinting/libcupsfilters#284 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
libsdl-org/SDL#16530 ·
Maintainers usually reply within 1 day