dmorse / pscfpp

Polymer Self-Consistent Field Theory (C++/CUDA version)
https://pscf-home.cems.umn.edu
GNU General Public License v3.0
27 stars 20 forks source link

Use Rational for Phases in Basis #119

Open dmorse opened 1 year ago

dmorse commented 1 year ago

1) Convert TWave::phase to a Rational value. Add Wave::phase member to Basis::Wave, which should also be a Rational object, in order to store value associated with a wave. Rework code that sets phases in Basis so as to use Rational objects throughout.

2) Store complex coefficient of each wave (double) separately from phase (Rational). Write code to compute coefficients that treats common special cases (phase = 0, phase = +- 1/2, 1/4, 1/3) with trivial or precomputed results.

3) (Unrelated) Add a negationId integer member to Basis::Wave. Once you've identified the index for the negation of a wave, you might as well retain it.