You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The conversion to Cartesian basis sets is needed for the WFN and WFX formats because these formats to not support pure functions. Just as in #258, this does not only require a change in the basis set definition, but also a transformation of all data expressed in the basis. At the lowest level, this can be implemented as function returning a transformed MolecularBasis instance and a transformation matrix. Also a utility function to transform everything in an IOData object (e.g. as a prepare function #191) would be useful. The transformation matrix is relatively easy to construct and is very sparse: block diagonal with blocks defined in iodata.overlap_cartpure.
Hi, I'd like to work on this, as a follow up to #409. Here is the plan, tell me if you want it different.
convert_to_cartesian(obasis) in convert.py, next to convert_to_segmented. It returns the new MolecularBasis (same shells, all kinds 'c') and the transformation matrix, so that coeffs_new = T @ coeffs_old. It builds T from tfs and takes the conventions of the old and new basis into account (ordering and signs), so sign flipped pure functions like the ORCA f ones work too.
In a second PR, a prepare_cartesian in prepare.py that applies T to the orbital coefficients and density matrices, for the WFN and WFX dumpers.
The main test: the overlap of the old basis must equal T.T @ S_cart @ T, with S_cart from compute_overlap on the new basis.
One question: should T be a dense array or a scipy.sparse matrix? Dense is simpler, sparse scales better for big basis sets. Unless you prefer dense, I would return a sparse matrix.
Activity
ARYAMANN7279 commentedon Oct 23, 2026
Hi, I'd like to work on this, as a follow up to #409. Here is the plan, tell me if you want it different.
convert_to_cartesian(obasis)inconvert.py, next toconvert_to_segmented. It returns the newMolecularBasis(same shells, all kinds'c') and the transformation matrix, so thatcoeffs_new = T @ coeffs_old. It builds T fromtfsand takes the conventions of the old and new basis into account (ordering and signs), so sign flipped pure functions like the ORCA f ones work too.prepare_cartesianinprepare.pythat applies T to the orbital coefficients and density matrices, for the WFN and WFX dumpers.T.T @ S_cart @ T, withS_cartfromcompute_overlapon the new basis.One question: should T be a dense array or a
scipy.sparsematrix? Dense is simpler, sparse scales better for big basis sets. Unless you prefer dense, I would return a sparse matrix.