Repository navigation
Linear Cartesian Salcs and maybe other things - #79
Merged
Merged
Conversation
Removed the RotationalPolynomials class and its methods.
Removed unnecessary reversal of the basis list.
Update project_Eckart condition to handle 'both' option.
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
nlk36701
reviewed
Sep 18, 2026
| if isinstance(fxn_set, CartesianCoordinates) and project_Eckart is not None: | ||
| if project_Eckart == "both": | ||
| if (isinstance(fxn_set, CartesianCoordinates) or isinstance(fxn_set, LinearCartesian)) and project_Eckart is not None: | ||
| if project_Eckart is "both": |
Collaborator
There was a problem hiding this comment.
I would change this back to if project_Eckart == "both":
nlk36701
reviewed
Sep 18, 2026
| return proj_dipole | ||
|
|
||
|
|
||
| def dipole_components_to_irrep(self): |
Collaborator
There was a problem hiding this comment.
Suggested change
| def dipole_components_to_irrep(self): | |
| if self.pg.is_linear: | |
| if self.pg.family == "D": | |
| reason = "irrep_mats is None for D-family linear point groups" | |
| else: | |
| reason = ( | |
| "irrep_mats for C-family linear point groups is built from a " | |
| "2-element representative symel set, not a proper per-operation " | |
| "matrix set, and is incompatible with this projection formula" | |
| ) | |
| raise NotImplementedError( | |
| f"dipole_components_to_irrep is not implemented for linear point groups " | |
| f"(got {self.pg.str}): {reason}." | |
| ) | |
…le atom handling, linear pg dipole irreps
…_to_negative - dipole_components_to_irrep: use self.pg (Symtext has no .symtext) and return every irrep mapped to a list of (xyz, component) tuples; the dict literals repeated keys, so only the last component survived. - ProjectionOp: drop rotational Eckart conditions for a single atom via project_Eckart (the unused local `rotational` had no effect). - salc_tools: add finite_operations()/linear_axis(); maps_to_negative and generate_symmetric_partner use concrete C2v/D2h operations about the molecular axis for linear groups, whose symels have no matrices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kh has no discrete symmetry elements or irrep matrices, so the general projection operator cannot run (symtext.order is 0). An atom's x, y, z displacements are the three components of P and are pure translations: projecting out translations leaves no SALCs, otherwise the SALCs are x, y, z. - projection_op: atom_cartesian_salcs(), used by ProjectionOp for Kh. - nonstandard_frame: Kh passes through, only moving the molecule back to its original frame. - salc: sort_partner_functions() handles an empty SALC list. - test/test_atom_salcs.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_symmetry_equiv_functions_nonstandard stacks one orbit vector per symmetry element, and Kh (a single atom) has none, so building CartesianCoordinates on a nonstandard Kh symtext raised "need at least one array to concatenate". With no symmetry elements there is no dense rrep to guard against, so the standard sets apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
subgroup_symtext stored the rotation from the subgroup's standard frame to the parent's frame. When the parent is itself in its standard frame, that is not the molecule's original frame, so nonstandard_symtext(subgroup) came back rotated. Fold the parent's rotation into reverse_rotate/rotate_to_std unless the parent is already nonstandard (already in the original frame). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Linear symmetry elements are abstract (no matrices, no multiplication table), so subgroup_by_name cannot find a subgroup inside them. Orient the subgroup from the molecule instead: the principal axis is the molecular axis and the secondary axis any perpendicular direction, which is a valid choice because rotation about the axis is itself a symmetry. Cs places its mirror to contain the axis (a sigma_v, present in every linear molecule). Any axial group can be requested (C2v, D2h, C3v, D4h, S4, ...); a subgroup the molecule lacks fails in get_atom_mapping. eckart_conditions now recognizes a linear molecule from its zero moment of inertia as well, so it drops the rotation about the axis when the molecule is described by a finite subgroup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Finite-difference codes that exploit degeneracy displace along one component of a degenerate SALC and need the same quantity (dipole, gradient) for its partner. For linear groups the partner of a Pi component is that component rotated 90 degrees about the molecular axis, and every atom maps onto itself. The companion to generate_symmetric_partner; psi4's findif driver used to do this inline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… is a copy
- PointGroup.from_string normalizes case ("c2v", "C2V" -> "C2v"), so
callers can pass user-typed names straight through (psi4 stores its
point-group symbols in lower case).
- subgroup_symtext(<own group>) returns a copy of the Symtext. Re-deriving
the group's own axes can choose a different but equivalent orientation,
e.g. swapping which mirror is sigma_v(0) in C2v, which relabels B1/B2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Refactor saxis calculation to use more_planar_axis function for better accuracy.
sgoodlett
commented
Oct 8, 2026
| a, b = np.unravel_index(np.argmax(np.linalg.norm(seps, axis=2)), seps.shape[:2]) | ||
| return seps[a, b] / np.linalg.norm(seps[a, b]) | ||
|
|
||
| def _map_atoms(symtext, R, tol): |
Collaborator
Author
There was a problem hiding this comment.
This function seems unnecessary, rotating MolA to MolB should not permute the atoms
Collaborator
Author
There was a problem hiding this comment.
Unless it's just rewriting our "get_atom_map" function, in which case this seems redundant
The linear branch of finite_operations re-implemented atom mapping with a private _map_atoms. Wrap its C2v/D2h operation matrices as Symels and use the existing get_atom_mapping instead, as get_linear_atom_mapping already does for inversion. finite_operations drops its now-unused tol argument; mapping uses the molecule's tolerance like the rest of MolSym. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
subgroup_symtext is expected to re-derive the subgroup's standard frame even when the subgroup is the Symtext's own group: largest_D2h_subgroup's reference atom maps and the standard/nonstandard subgroup agreement test depend on it. Callers that want to keep an existing orientation should not request the group they already have. Case-insensitive point-group names are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linear point groups now somewhat handled.
Cartesian SALCs available for linear point groups.
Ih symels now align with Prof. Allen's definitions.
goat_checkis much more efficient.