Skip to content

Commit

Permalink
dirty fix for diatomic He
Browse files Browse the repository at this point in the history
I'm not sure why primat and rotcon are only backwards in *some* places. should
they be reversed at the very beginning in Spectro::load?
  • Loading branch information
ntBre committed Dec 7, 2023
1 parent 681083b commit 0d8bebf
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions spectro/src/sextic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ fn scc(
// some kind of tolerance for messing with certain values
const TOL: f64 = 1e-4;
let mut scc = Tensor3::zeros(3, 3, 3);
let mut rotcon = rotcon.to_vec();
if freq.len() == 6 {
// proxy for is_diatomic
rotcon.reverse();
}
for ixyz in 1..=maxcor {
let x = ixyz - 1;
let iixyz = ioff(ixyz + 1);
Expand Down Expand Up @@ -402,12 +407,23 @@ impl Sextic {
let mut ret = Self::default();
let nvib = s.nvib;
let maxcor = if s.is_linear() { 2 } else { 3 };
let c = c_mat(maxcor, nvib, freq, &s.primat, wila);
let primat = if s.rotor.is_diatomic() {
let mut p = s.primat.clone();
p.reverse();
p
} else {
s.primat.clone()
};
let c = c_mat(maxcor, nvib, freq, &primat, wila);
let cc = cc_tensor(nvib, maxcor, freq, &c, zmat, &s.rotcon);
let tau = make_tau(maxcor, nvib, freq, &s.primat, wila);
let tau = make_tau(maxcor, nvib, freq, &primat, wila);
let taucpm = tau_prime(maxcor, &tau);
let scc = scc(maxcor, tau, &s.rotcon, nvib, freq, cc, f3qcm, &c, s);
if s.rotor.is_linear() {

if s.rotor.is_diatomic() {
ret.he = scc[(1, 1, 1)];
return ret;
} else if s.rotor.is_linear() {
ret.he = scc[(0, 0, 0)];
return ret;
}
Expand Down

0 comments on commit 0d8bebf

Please sign in to comment.